/
search_sessions.go
39 lines (32 loc) Β· 1.09 KB
/
search_sessions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package form
import "github.com/photoprism/photoprism/pkg/authn"
// SearchSessions represents a session search form.
type SearchSessions struct {
Query string `form:"q"`
UID string `form:"uid"`
Provider string `form:"provider"`
Method string `form:"method"`
Count int `form:"count" binding:"required" serialize:"-"`
Offset int `form:"offset" serialize:"-"`
Order string `form:"order" serialize:"-"`
}
// AuthProviders returns the normalized authentication provider types.
func (f *SearchSessions) AuthProviders() []authn.ProviderType {
return authn.Providers(f.Provider)
}
// AuthMethods returns the normalized authentication method types.
func (f *SearchSessions) AuthMethods() []authn.MethodType {
return authn.Methods(f.Method)
}
// GetQuery returns the query string.
func (f *SearchSessions) GetQuery() string {
return f.Query
}
// SetQuery sets the query string.
func (f *SearchSessions) SetQuery(q string) {
f.Query = q
}
// ParseQueryString parses the query string into form fields.
func (f *SearchSessions) ParseQueryString() error {
return ParseQueryString(f)
}