photoprism/internal/form/search_folders.go
Michael Mayer 650817a9e0 API: Add prefix to the source filename of search request handlers
Finding the right code is easier when the name matches related
functionality in other packages.
2021-11-26 14:28:50 +01:00

34 lines
875 B
Go

package form
// SearchFolders represents search form fields for "/api/v1/folders".
type SearchFolders struct {
Query string `form:"q"`
Recursive bool `form:"recursive"`
Files bool `form:"files"`
Uncached bool `form:"uncached"`
Count int `form:"count" serialize:"-"`
Offset int `form:"offset" serialize:"-"`
}
func (f *SearchFolders) GetQuery() string {
return f.Query
}
func (f *SearchFolders) SetQuery(q string) {
f.Query = q
}
func (f *SearchFolders) ParseQueryString() error {
return ParseQueryString(f)
}
// Serialize returns a string containing non-empty fields and values of a struct.
func (f *SearchFolders) Serialize() string {
return Serialize(f, false)
}
// SerializeAll returns a string containing all non-empty fields and values of a struct.
func (f *SearchFolders) SerializeAll() string {
return Serialize(f, true)
}