-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge v.1.2.0 from dev
- Loading branch information
Showing
19 changed files
with
426 additions
and
572 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,10 @@ | ||
package baraka | ||
|
||
// Informer is a interface which contains information functions about request | ||
// Informer is a interface that wraps information functions about parsed multipart request | ||
type Informer interface { | ||
Content() []*Part | ||
Length() int | ||
Filenames() []string | ||
ContentTypes() []string | ||
} | ||
|
||
// Length returns total count of files | ||
func (parts *Parts) Length() int { | ||
return parts.len | ||
} | ||
|
||
// Filenames returns names of files | ||
func (parts *Parts) Filenames() []string { | ||
filenames := make([]string, parts.len) | ||
for k, v := range parts.files { | ||
filenames[k] = v.Filename | ||
} | ||
return filenames | ||
} | ||
|
||
// ContentTypes returns content types of files | ||
func (parts *Parts) ContentTypes() []string { | ||
contentTypes := make([]string, parts.len) | ||
for k, v := range parts.files { | ||
contentTypes[k] = v.Header.Get("Content-Type") | ||
} | ||
return contentTypes | ||
GetJSON() ([]string, error) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.