Documentation ¶
Overview ¶
Package form contains tagged structs for input value validation.
Copyright (c) 2018 - 2024 PhotoPrism UG. All rights reserved.
This program is free software: you can redistribute it and/or modify it under Version 3 of the GNU Affero General Public License (the "AGPL"): <https://docs.photoprism.app/license/agpl> This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. The AGPL is supplemented by our Trademark and Brand Guidelines, which describe how our Brand Assets may be used: <https://www.photoprism.app/trademark>
Feel free to send an email to hello@photoprism.app if you have questions, want to support our work, or just want to say hello.
Additional information can be found in our Developer Guide: <https://docs.photoprism.app/developer-guide/>
Index ¶
- Constants
- func AsJson(frm interface{}) string
- func AsReader(frm interface{}) io.Reader
- func ParseQueryString(f SearchForm) (result error)
- func Report(f interface{}) (rows [][]string, cols []string)
- func Serialize(f interface{}, all bool) string
- func Unserialize(f SearchForm, q string) (result error)
- type Album
- type ChangePassword
- type Client
- func (f Client) Expires() int64
- func (f *Client) ID() string
- func (f *Client) Method() authn.MethodType
- func (f *Client) Name() string
- func (f *Client) Provider() authn.ProviderType
- func (f *Client) Role() string
- func (f Client) Scope() string
- func (f *Client) Secret() string
- func (f Client) Tokens() int64
- type ClientCredentials
- type ClientToken
- type Connect
- type Details
- type Face
- type Feedback
- type File
- type Folder
- type ImportOptions
- type IndexOptions
- type Label
- type Link
- type Login
- type Marker
- type Photo
- type SearchAlbums
- type SearchFaces
- type SearchFolders
- type SearchForm
- type SearchLabels
- type SearchPhotos
- type SearchPhotosGeo
- type SearchServices
- type SearchSessions
- type SearchSubjects
- type SearchUsers
- type Selection
- type Service
- type Subject
- type SyncUpload
- type UploadOptions
- type User
- type UserDetails
- type UserPasscode
Constants ¶
const (
ClientAccessToken = "access_token"
)
Variables ¶
This section is empty.
Functions ¶
func AsJson ¶
func AsJson(frm interface{}) string
AsJson returns the form data as a JSON string or an empty string in case of error.
func ParseQueryString ¶
func ParseQueryString(f SearchForm) (result error)
func Unserialize ¶
func Unserialize(f SearchForm, q string) (result error)
Types ¶
type Album ¶
type Album struct { Thumb string `json:"Thumb"` ThumbSrc string `json:"ThumbSrc"` AlbumType string `json:"Type"` AlbumTitle string `json:"Title"` AlbumLocation string `json:"Location"` AlbumCategory string `json:"Category"` AlbumCaption string `json:"Caption"` AlbumDescription string `json:"Description"` AlbumNotes string `json:"Notes"` AlbumFilter string `json:"Filter"` AlbumOrder string `json:"Order"` AlbumTemplate string `json:"Template"` AlbumCountry string `json:"Country"` AlbumFavorite bool `json:"Favorite"` AlbumPrivate bool `json:"Private"` }
Album represents an album edit form.
type ChangePassword ¶
ChangePassword represents a password update form.
type Client ¶
type Client struct { UserUID string `json:"UserUID,omitempty" yaml:"UserUID,omitempty"` UserName string `gorm:"size:64;index;" json:"UserName" yaml:"UserName,omitempty"` ClientID string `json:"ClientID,omitempty" yaml:"ClientID,omitempty"` ClientSecret string `json:"ClientSecret,omitempty" yaml:"ClientSecret,omitempty"` ClientName string `json:"ClientName,omitempty" yaml:"ClientName,omitempty"` ClientRole string `json:"ClientRole,omitempty" yaml:"ClientRole,omitempty"` AuthProvider string `json:"AuthProvider,omitempty" yaml:"AuthProvider,omitempty"` AuthMethod string `json:"AuthMethod,omitempty" yaml:"AuthMethod,omitempty"` AuthScope string `json:"AuthScope,omitempty" yaml:"AuthScope,omitempty"` AuthExpires int64 `json:"AuthExpires,omitempty" yaml:"AuthExpires,omitempty"` AuthTokens int64 `json:"AuthTokens,omitempty" yaml:"AuthTokens,omitempty"` AuthEnabled bool `json:"AuthEnabled,omitempty" yaml:"AuthEnabled,omitempty"` }
Client represents client application settings.
func AddClientFromCli ¶
AddClientFromCli creates a new form for adding a client with values from the specified CLI context.
func ModClientFromCli ¶
ModClientFromCli creates a new form for modifying a client with values from the specified CLI context.
func (Client) Expires ¶
Expires returns the access token expiry time in seconds or 0 if not specified.
func (*Client) Method ¶
func (f *Client) Method() authn.MethodType
Method returns the sanitized auth method name.
func (*Client) Provider ¶
func (f *Client) Provider() authn.ProviderType
Provider returns the sanitized auth provider name.
type ClientCredentials ¶
type ClientCredentials struct { ClientID string `form:"client_id" json:"client_id,omitempty"` ClientSecret string `form:"client_secret" json:" client_secret,omitempty"` AuthScope string `form:"scope" json:"scope,omitempty"` }
ClientCredentials represents client authentication request credentials.
func (ClientCredentials) Scope ¶
func (f ClientCredentials) Scope() string
Scope returns the client scopes as sanitized string.
func (ClientCredentials) Validate ¶
func (f ClientCredentials) Validate() error
Validate checks the grant type and credentials.
type ClientToken ¶
type ClientToken struct { AuthToken string `form:"token" binding:"required" json:"token,omitempty"` TypeHint string `form:"token_type_hint" json:" token_type_hint,omitempty"` }
ClientToken represents a client authentication token.
func (ClientToken) Empty ¶
func (f ClientToken) Empty() bool
Empty checks if all form values are unset.
func (ClientToken) Validate ¶
func (f ClientToken) Validate() error
Validate checks the token and token type.
type Connect ¶
type Connect struct {
Token string `json:"Token"`
}
Connect represents a connection request with an external service.
type Details ¶
type Details struct { PhotoID uint `json:"PhotoID" deepcopier:"skip"` Keywords string `json:"Keywords"` KeywordsSrc string `json:"KeywordsSrc"` Notes string `json:"Notes"` NotesSrc string `json:"NotesSrc"` Subject string `json:"Subject"` SubjectSrc string `json:"SubjectSrc"` Artist string `json:"Artist"` ArtistSrc string `json:"ArtistSrc"` Copyright string `json:"Copyright"` CopyrightSrc string `json:"CopyrightSrc"` License string `json:"License"` LicenseSrc string `json:"LicenseSrc"` }
Details contains detailed photo information
type Feedback ¶
type Feedback struct { Category string `json:"Category"` Message string `json:"Message"` UserName string `json:"UserName"` UserEmail string `json:"UserEmail"` UserAgent string `json:"UserAgent"` UserLocales string `json:"UserLocales"` }
Feedback represents support requests / customer feedback.
func NewFeedback ¶
type File ¶
type File struct {
FileOrientation int `json:"Orientation"`
}
File represents a file edit form.
func (*File) Orientation ¶
Orientation returns the Exif orientation value within a valid range or 0 if it is invalid.
type Folder ¶
type Folder struct { Path string `json:"Path"` Root string `json:"Root"` FolderType string `json:"Type"` FolderTitle string `json:"Title"` FolderCategory string `json:"Category"` FolderDescription string `json:"Description"` FolderOrder string `json:"Order"` FolderCountry string `json:"Country"` FolderYear int `json:"Year"` FolderMonth int `json:"Month"` FolderFavorite bool `json:"Favorite"` FolderPrivate bool `json:"Private"` FolderIgnore bool `json:"Ignore"` FolderWatch bool `json:"Watch"` }
Folder represents a file system directory edit form.
type ImportOptions ¶
type IndexOptions ¶
type Label ¶
type Label struct { LabelName string `json:"Name"` Uncertainty int `json:"Uncertainty"` LabelPriority int `json:"Priority"` }
Label represents a label edit form.
type Link ¶
type Link struct { Password string `json:"Password"` LinkToken string `json:"Token"` LinkExpires int `json:"Expires"` MaxViews uint `json:"MaxViews"` CanComment bool `json:"CanComment"` CanEdit bool `json:"CanEdit"` }
Link represents a link sharing form.
type Login ¶
type Login struct { UserName string `json:"username,omitempty"` UserEmail string `json:"email,omitempty"` Password string `json:"password,omitempty"` Passcode string `json:"passcode,omitempty"` }
Login represents a login form.
func (Login) HasCredentials ¶
HasCredentials checks if all credentials is set.
func (Login) HasPasscode ¶
HasPasscode checks if a passcode is set.
func (Login) HasPassword ¶
HasPassword checks if a password is set.
func (Login) HasShareToken ¶
HasShareToken checks if a link share token has been provided.
func (Login) HasUsername ¶
HasUsername checks if a username is set.
type Marker ¶
type Marker struct { FileUID string `json:"FileUID,omitempty"` MarkerType string `json:"Type,omitempty"` MarkerSrc string `json:"Src,omitempty"` X float32 `json:"X"` Y float32 `json:"Y"` W float32 `json:"W,omitempty"` H float32 `json:"H,omitempty"` SubjSrc string `json:"SubjSrc"` MarkerName string `json:"Name"` MarkerReview bool `json:"MarkerReview"` MarkerInvalid bool `json:"Invalid"` }
Marker represents an image marker edit form.
type Photo ¶
type Photo struct { PhotoType string `json:"Type"` TypeSrc string `json:"TypeSrc"` TakenAt time.Time `json:"TakenAt"` TakenAtLocal time.Time `json:"TakenAtLocal"` TakenSrc string `json:"TakenSrc"` TimeZone string `json:"TimeZone"` PhotoYear int `json:"Year"` PhotoMonth int `json:"Month"` PhotoDay int `json:"Day"` PhotoTitle string `json:"Title"` TitleSrc string `json:"TitleSrc"` PhotoDescription string `json:"Description"` DescriptionSrc string `json:"DescriptionSrc"` Details Details `json:"Details"` PhotoStack int8 `json:"Stack"` PhotoFavorite bool `json:"Favorite"` PhotoPrivate bool `json:"Private"` PhotoScan bool `json:"Scan"` PhotoPanorama bool `json:"Panorama"` PhotoAltitude int `json:"Altitude"` PhotoLat float32 `json:"Lat"` PhotoLng float32 `json:"Lng"` PhotoIso int `json:"Iso"` PhotoFocalLength int `json:"FocalLength"` PhotoFNumber float32 `json:"FNumber"` PhotoExposure string `json:"Exposure"` PhotoCountry string `json:"Country"` CellID string `json:"CellID"` CellAccuracy int `json:"CellAccuracy"` PlaceID string `json:"PlaceID"` PlaceSrc string `json:"PlaceSrc"` CameraID uint `json:"CameraID"` CameraSrc string `json:"CameraSrc"` LensID uint `json:"LensID"` OriginalName string `json:"OriginalName"` }
Photo represents a photo edit form.
type SearchAlbums ¶
type SearchAlbums struct { Query string `form:"q"` UID string `form:"uid"` Type string `form:"type"` Location string `form:"location"` Category string `form:"category"` Slug string `form:"slug"` Title string `form:"title"` Country string `json:"country"` Year string `form:"year" example:"year:1990|2003" notes:"Year (separate with |)"` Month string `form:"month" example:"month:7|10" notes:"Month (1-12, separate with |)"` Day string `form:"day" example:"day:3|13" notes:"Day of Month (1-31, separate with |)"` Favorite bool `form:"favorite"` Public bool `form:"public"` Private bool `form:"private"` Count int `form:"count" binding:"required" serialize:"-"` Offset int `form:"offset" serialize:"-"` Order string `form:"order" serialize:"-"` }
SearchAlbums represents search form fields for "/api/v1/albums".
func NewAlbumSearch ¶
func NewAlbumSearch(query string) SearchAlbums
func (*SearchAlbums) GetQuery ¶
func (f *SearchAlbums) GetQuery() string
func (*SearchAlbums) ParseQueryString ¶
func (f *SearchAlbums) ParseQueryString() error
func (*SearchAlbums) SetQuery ¶
func (f *SearchAlbums) SetQuery(q string)
type SearchFaces ¶
type SearchFaces struct { Query string `form:"q"` UID string `form:"uid"` Subject string `form:"subject"` Unknown string `form:"unknown"` Hidden string `form:"hidden"` Markers bool `form:"markers"` Count int `form:"count" binding:"required" serialize:"-"` Offset int `form:"offset" serialize:"-"` Order string `form:"order" serialize:"-"` }
SearchFaces represents search form fields for "/api/v1/faces".
func NewFaceSearch ¶
func NewFaceSearch(query string) SearchFaces
func (*SearchFaces) GetQuery ¶
func (f *SearchFaces) GetQuery() string
func (*SearchFaces) ParseQueryString ¶
func (f *SearchFaces) ParseQueryString() error
func (*SearchFaces) SetQuery ¶
func (f *SearchFaces) SetQuery(q string)
type SearchFolders ¶
type SearchFolders struct { Query string `form:"q"` Recursive bool `form:"recursive"` Files bool `form:"files"` Uncached bool `form:"uncached"` Public bool `form:"public"` Count int `form:"count" serialize:"-"` Offset int `form:"offset" serialize:"-"` }
SearchFolders represents search form fields for "/api/v1/folders".
func (*SearchFolders) GetQuery ¶
func (f *SearchFolders) GetQuery() string
func (*SearchFolders) ParseQueryString ¶
func (f *SearchFolders) ParseQueryString() error
func (*SearchFolders) Serialize ¶
func (f *SearchFolders) Serialize() string
Serialize returns a string containing non-empty fields and values of a struct.
func (*SearchFolders) SerializeAll ¶
func (f *SearchFolders) SerializeAll() string
SerializeAll returns a string containing all non-empty fields and values of a struct.
func (*SearchFolders) SetQuery ¶
func (f *SearchFolders) SetQuery(q string)
type SearchForm ¶
type SearchLabels ¶
type SearchLabels struct { Query string `form:"q"` UID string `form:"uid"` Slug string `form:"slug"` Name string `form:"name"` All bool `form:"all"` Favorite bool `form:"favorite"` Count int `form:"count" binding:"required" serialize:"-"` Offset int `form:"offset" serialize:"-"` Order string `form:"order" serialize:"-"` }
SearchLabels represents search form fields for "/api/v1/labels".
func NewLabelSearch ¶
func NewLabelSearch(query string) SearchLabels
func (*SearchLabels) GetQuery ¶
func (f *SearchLabels) GetQuery() string
func (*SearchLabels) ParseQueryString ¶
func (f *SearchLabels) ParseQueryString() error
func (*SearchLabels) SetQuery ¶
func (f *SearchLabels) SetQuery(q string)
type SearchPhotos ¶
type SearchPhotos struct { Query string `form:"q"` Scope string `form:"s" serialize:"-" example:"s:ariqwb43p5dh9h13" notes:"Limits the results to one album or another scope, if specified"` Filter string `form:"filter" serialize:"-" notes:"-"` ID string `form:"id" example:"id:123e4567-e89b-..." notes:"Finds pictures by Exif UID, XMP Document ID or Instance ID"` UID string `form:"uid" example:"uid:pqbcf5j446s0futy" notes:"Limits results to the specified internal unique IDs"` Type string `form:"type" example:"type:raw" notes:"Media Type (image, video, raw, live, animated); separate with |"` Path string `form:"path" example:"path:2020/Holiday" notes:"Path Name (separate with |), supports * wildcards"` Folder string `form:"folder" example:"folder:\"*/2020\"" notes:"Path Name (separate with |), supports * wildcards"` // Alias for Path Name string `form:"name" example:"name:\"IMG_9831-112*\"" notes:"File Name without path and extension (separate with |)"` Filename string `form:"filename" example:"filename:\"2021/07/12345.jpg\"" notes:"File Name with path and extension (separate with |)"` Original string `form:"original" example:"original:\"IMG_9831-112*\"" notes:"Original file name of imported files (separate with |)"` Title string `form:"title" example:"title:\"Lake*\"" notes:"Title (separate with |)"` Hash string `form:"hash" example:"hash:2fd4e1c67a2d" notes:"SHA1 File Hash (separate with |)"` Primary bool `form:"primary" notes:"Finds primary JPEG files only"` Stack bool `form:"stack" notes:"Finds pictures with more than one media file"` Unstacked bool `form:"unstacked" notes:"Finds pictures with a file that has been removed from a stack"` Stackable bool `form:"stackable" notes:"Finds pictures that can be stacked with additional media files"` Video bool `form:"video" notes:"Finds video files only"` Vector bool `form:"vector" notes:"Finds vector graphics only"` Animated bool `form:"animated" notes:"Finds animated GIFs"` Photo bool `form:"photo" notes:"Finds only photos, no videos"` Raw bool `form:"raw" notes:"Finds pictures with RAW image file"` Live bool `form:"live" notes:"Finds Live Photos and short videos"` Scan string `form:"scan" example:"scan:true scan:false" notes:"Finds scanned photos and documents"` Mp string `form:"mp" example:"mp:3-6" notes:"Resolution in Megapixels (MP)"` Panorama bool `form:"panorama" notes:"Finds pictures with an aspect ratio > 1.9:1"` Portrait bool `form:"portrait" notes:"Finds pictures in portrait format"` Landscape bool `form:"landscape" notes:"Finds pictures in landscape format"` Square bool `form:"square" notes:"Finds images with an aspect ratio of 1:1"` Error bool `form:"error" notes:"Finds pictures with errors"` Hidden bool `form:"hidden" notes:"Finds hidden pictures (broken or unsupported)"` Archived bool `form:"archived" notes:"Finds archived pictures"` Public bool `form:"public" notes:"Excludes private pictures"` Private bool `form:"private" notes:"Finds private pictures"` Favorite string `form:"favorite" example:"favorite:true favorite:false" notes:"Finds images by favorite status"` Unsorted bool `form:"unsorted" notes:"Finds pictures not in an album"` Near string `form:"near" example:"near:pqbcf5j446s0futy" notes:"Finds nearby pictures (UID)"` S2 string `form:"s2" example:"s2:4799e370ca54c8b9" notes:"S2 Position (Cell ID)"` Olc string `form:"olc" example:"olc:8FWCHX7W+" notes:"OLC Position (Open Location Code)"` Lat float64 `form:"lat" example:"lat:41.894043" notes:"GPS Position (Latitude)"` Lng float64 `form:"lng" example:"lng:-87.62448" notes:"GPS Position (Longitude)"` Alt string `form:"alt" example:"alt:300-500" notes:"GPS Altitude (m)"` Dist float64 `form:"dist" example:"dist:50" notes:"Distance to Position (km)"` Latlng string `form:"latlng" notes:"GPS Bounding Box (Lat N, Lng E, Lat S, Lng W)"` Camera string `form:"camera" example:"camera:canon" notes:"Camera Make/Model Name"` // Camera UID or name Lens string `form:"lens" example:"lens:ef24" notes:"Lens Make/Model Name"` // Lens UID or name Iso string `form:"iso" example:"iso:200-400" notes:"ISO Number (light sensitivity)"` Mm string `form:"mm" example:"mm:28-35" notes:"Focal Length (35mm equivalent)"` F string `form:"f" example:"f:2.8-4.5" notes:"Aperture (f-number)"` Color string `` // Main color /* 187-byte string literal not displayed */ Chroma int16 `form:"chroma" example:"chroma:70" notes:"Chroma (0-100)"` Mono bool `form:"mono" notes:"Finds pictures with few or no colors"` Diff uint32 `form:"diff" notes:"Differential Perceptual Hash (000000-FFFFFF)"` Geo string `form:"geo" example:"geo:yes" notes:"Finds pictures with or without coordinates"` Keywords string `form:"keywords" example:"keywords:\"sand&water\"" notes:"Keywords (combinable with & and |)"` Label string `form:"label" example:"label:cat|dog" notes:"Label Names (separate with |)"` Category string `form:"category" example:"category:airport" notes:"Location Category"` Country string `form:"country" example:"country:\"de|us\"" notes:"Location Country Code (separate with |)"` // Moments State string `form:"state" example:"state:\"Baden-Württemberg\"" notes:"Location State (separate with |)"` // Moments City string `form:"city" example:"city:\"Berlin\"" notes:"Location City (separate with |)"` // Moments Year string `form:"year" example:"year:1990|2003" notes:"Year (separate with |)"` // Moments Month string `form:"month" example:"month:7|10" notes:"Month (1-12, separate with |)"` // Moments Day string `form:"day" example:"day:3|13" notes:"Day of Month (1-31, separate with |)"` // Moments Face string `form:"face" example:"face:PN6QO5INYTUSAATOFL43LL2ABAV5ACZG" notes:"Face ID, yes, no, new, or kind"` // UIDs Faces string `form:"faces" example:"faces:yes faces:3" notes:"Minimum number of Faces (yes = 1)"` // Find or exclude faces if detected. Subject string `form:"subject" example:"subject:\"Jane Doe & John Doe\"" notes:"Alias for person"` // UIDs Person string `form:"person" example:"person:\"Jane Doe & John Doe\"" notes:"Subject Names, exact matches (combinable with & and |)"` // Alias for Subject Subjects string `form:"subjects" example:"subjects:\"Jane & John\"" notes:"Alias for people"` // People names People string `form:"people" example:"people:\"Jane & John\"" notes:"Subject Names (combinable with & and |)"` // Alias for Subjects Album string `form:"album" example:"album:berlin" notes:"Album UID or Name, supports * wildcards"` // Album UIDs or name Albums string `form:"albums" example:"albums:\"South Africa & Birds\"" notes:"Album Names (combinable with & and |)"` // Multi search with and/or Quality int `form:"quality" notes:"Minimum quality score (1-7)"` // Photo quality score Review bool `form:"review" notes:"Finds pictures in review"` // Find photos in review Before time.Time `form:"before" time_format:"2006-01-02" notes:"Finds pictures taken before this date"` // Finds images taken before date After time.Time `form:"after" time_format:"2006-01-02" notes:"Finds pictures taken after this date"` // Finds images taken after date Count int `form:"count" binding:"required" serialize:"-"` // Result FILE limit Offset int `form:"offset" serialize:"-"` // Result FILE offset Order string `form:"order" serialize:"-"` // Sort order Merged bool `form:"merged" serialize:"-"` // Merge FILES in response }
SearchPhotos represents search form fields for "/api/v1/photos".
func NewSearchPhotos ¶
func NewSearchPhotos(query string) SearchPhotos
func (*SearchPhotos) FindUidOnly ¶
func (f *SearchPhotos) FindUidOnly() bool
FindUidOnly checks if search filters other than UID may be skipped to improve performance.
func (*SearchPhotos) GetQuery ¶
func (f *SearchPhotos) GetQuery() string
func (*SearchPhotos) ParseQueryString ¶
func (f *SearchPhotos) ParseQueryString() error
func (*SearchPhotos) Serialize ¶
func (f *SearchPhotos) Serialize() string
Serialize returns a string containing non-empty fields and values of a struct.
func (*SearchPhotos) SerializeAll ¶
func (f *SearchPhotos) SerializeAll() string
SerializeAll returns a string containing all non-empty fields and values of a struct.
func (*SearchPhotos) SetQuery ¶
func (f *SearchPhotos) SetQuery(q string)
type SearchPhotosGeo ¶
type SearchPhotosGeo struct { Query string `form:"q"` Scope string `form:"s" serialize:"-" example:"s:ariqwb43p5dh9h13" notes:"Limits the results to one album or another scope, if specified"` Filter string `form:"filter" serialize:"-" notes:"-"` ID string `form:"id" example:"id:123e4567-e89b-..." notes:"Finds pictures by Exif UID, XMP Document ID or Instance ID"` UID string `form:"uid" example:"uid:pqbcf5j446s0futy" notes:"Limits results to the specified internal unique IDs"` Type string `form:"type"` Path string `form:"path"` Folder string `form:"folder"` // Alias for Path Name string `form:"name"` Title string `form:"title"` Before time.Time `form:"before" time_format:"2006-01-02"` After time.Time `form:"after" time_format:"2006-01-02"` Favorite string `form:"favorite" example:"favorite:yes" notes:"Finds favorites only"` Unsorted bool `form:"unsorted"` Video bool `form:"video"` Vector bool `form:"vector"` Animated bool `form:"animated"` Photo bool `form:"photo"` Raw bool `form:"raw"` Live bool `form:"live"` Scan string `form:"scan" example:"scan:true scan:false" notes:"Finds scanned photos and documents"` Mp string `form:"mp" example:"mp:3-6" notes:"Resolution in Megapixels (MP)"` Panorama bool `form:"panorama"` Portrait bool `form:"portrait"` Landscape bool `form:"landscape"` Square bool `form:"square"` Archived bool `form:"archived"` Public bool `form:"public"` Private bool `form:"private"` Review bool `form:"review"` Quality int `form:"quality" notes:"Minimum quality score (1-7)"` Face string `form:"face" notes:"Face ID, yes, no, new, or kind"` Faces string `form:"faces"` // Find or exclude faces if detected. Subject string `form:"subject"` Near string `form:"near" example:"near:pqbcf5j446s0futy" notes:"Finds nearby pictures (UID)"` S2 string `form:"s2" example:"s2:4799e370ca54c8b9" notes:"S2 Position (Cell ID)"` Olc string `form:"olc" example:"olc:8FWCHX7W+" notes:"OLC Position (Open Location Code)"` Lat float64 `form:"lat" example:"lat:41.894043" notes:"GPS Position (Latitude)"` Lng float64 `form:"lng" example:"lng:-87.62448" notes:"GPS Position (Longitude)"` Alt string `form:"alt" example:"alt:300-500" notes:"GPS Altitude (m)"` Dist float64 `form:"dist" example:"dist:50" notes:"Distance to Position (km)"` Latlng string `form:"latlng" notes:"GPS Bounding Box (Lat N, Lng E, Lat S, Lng W)"` Camera int `form:"camera"` Lens int `form:"lens"` Iso string `form:"iso" example:"iso:200-400" notes:"ISO Number (light sensitivity)"` Mm string `form:"mm" example:"mm:28-35" notes:"Focal Length (35mm equivalent)"` F string `form:"f" example:"f:2.8-4.5" notes:"Aperture (f-number)"` Color string `form:"color"` Chroma int16 `form:"chroma" example:"chroma:70" notes:"Chroma (0-100)"` Mono bool `form:"mono" notes:"Finds pictures with few or no colors"` Person string `form:"person"` // Alias for Subject Subjects string `form:"subjects"` // Text People string `form:"people"` // Alias for Subjects Keywords string `form:"keywords" example:"keywords:\"sand&water\"" notes:"Keywords (combinable with & and |)"` Label string `form:"label" example:"label:cat|dog" notes:"Label Names (separate with |)"` Category string `form:"category" example:"category:airport" notes:"Location Category"` Album string `form:"album" example:"album:berlin" notes:"Album UID or Name, supports * wildcards"` Albums string `form:"albums" example:"albums:\"South Africa & Birds\"" notes:"Album Names (combinable with & and |)"` Country string `form:"country"` State string `form:"state"` // Moments City string `form:"city"` Year string `form:"year"` // Moments Month string `form:"month"` // Moments Day string `form:"day"` // Moments Count int `form:"count" serialize:"-"` Offset int `form:"offset" serialize:"-"` }
SearchPhotosGeo represents search form fields for "/api/v1/geo".
func NewSearchPhotosGeo ¶
func NewSearchPhotosGeo(query string) SearchPhotosGeo
func (*SearchPhotosGeo) FindUidOnly ¶
func (f *SearchPhotosGeo) FindUidOnly() bool
FindUidOnly checks if search filters other than UID may be skipped to improve performance.
func (*SearchPhotosGeo) GetQuery ¶
func (f *SearchPhotosGeo) GetQuery() string
GetQuery returns the query parameter as string.
func (*SearchPhotosGeo) ParseQueryString ¶
func (f *SearchPhotosGeo) ParseQueryString() error
ParseQueryString parses the query parameter if possible.
func (*SearchPhotosGeo) Serialize ¶
func (f *SearchPhotosGeo) Serialize() string
Serialize returns a string containing non-empty fields and values of a struct.
func (*SearchPhotosGeo) SerializeAll ¶
func (f *SearchPhotosGeo) SerializeAll() string
SerializeAll returns a string containing all non-empty fields and values of a struct.
func (*SearchPhotosGeo) SetQuery ¶
func (f *SearchPhotosGeo) SetQuery(q string)
SetQuery sets the query parameter.
type SearchServices ¶
type SearchServices struct { Query string `form:"q"` Sync bool `form:"sync"` Status string `form:"status"` Count int `form:"count" binding:"required" serialize:"-"` Offset int `form:"offset" serialize:"-"` Order string `form:"order" serialize:"-"` }
SearchServices represents search form fields for "/api/v1/services".
func NewSearchServices ¶
func NewSearchServices(query string) SearchServices
func (*SearchServices) GetQuery ¶
func (f *SearchServices) GetQuery() string
func (*SearchServices) ParseQueryString ¶
func (f *SearchServices) ParseQueryString() error
func (*SearchServices) SetQuery ¶
func (f *SearchServices) SetQuery(q string)
type SearchSessions ¶
type SearchSessions struct { Query string `form:"q"` UID string `form:"uid"` Count int `form:"count" binding:"required" serialize:"-"` Offset int `form:"offset" serialize:"-"` Order string `form:"order" serialize:"-"` }
SearchSessions represents a session search form.
func (*SearchSessions) GetQuery ¶
func (f *SearchSessions) GetQuery() string
func (*SearchSessions) ParseQueryString ¶
func (f *SearchSessions) ParseQueryString() error
func (*SearchSessions) SetQuery ¶
func (f *SearchSessions) SetQuery(q string)
type SearchSubjects ¶
type SearchSubjects struct { Query string `form:"q"` UID string `form:"uid"` Type string `form:"type"` Name string `form:"name"` All bool `form:"all"` Hidden string `form:"hidden"` Favorite string `form:"favorite"` Private string `form:"private"` Excluded string `form:"excluded"` Files int `form:"files"` Photos int `form:"photos"` Count int `form:"count" binding:"required" serialize:"-"` Offset int `form:"offset" serialize:"-"` Order string `form:"order" serialize:"-"` }
SearchSubjects represents search form fields for "/api/v1/subjects".
func NewSubjectSearch ¶
func NewSubjectSearch(query string) SearchSubjects
func (*SearchSubjects) GetQuery ¶
func (f *SearchSubjects) GetQuery() string
func (*SearchSubjects) ParseQueryString ¶
func (f *SearchSubjects) ParseQueryString() error
func (*SearchSubjects) SetQuery ¶
func (f *SearchSubjects) SetQuery(q string)
type SearchUsers ¶
type SearchUsers struct { User string `form:"user"` Query string `form:"q"` Name string `form:"name"` Email string `form:"email"` Count int `form:"count" binding:"required" serialize:"-"` Offset int `form:"offset" serialize:"-"` Order string `form:"order" serialize:"-"` }
SearchUsers represents a user search form.
func (*SearchUsers) GetQuery ¶
func (f *SearchUsers) GetQuery() string
func (*SearchUsers) ParseQueryString ¶
func (f *SearchUsers) ParseQueryString() error
func (*SearchUsers) SetQuery ¶
func (f *SearchUsers) SetQuery(q string)
type Selection ¶
type Selection struct { All bool `json:"all"` Files []string `json:"files"` Photos []string `json:"photos"` Albums []string `json:"albums"` Labels []string `json:"labels"` Places []string `json:"places"` Subjects []string `json:"subjects"` }
Selection represents items selected in the user interface.
type Service ¶
type Service struct { AccName string `json:"AccName"` AccOwner string `json:"AccOwner"` AccURL string `json:"AccURL"` AccType string `json:"AccType"` AccKey string `json:"AccKey"` AccUser string `json:"AccUser"` AccPass string `json:"AccPass"` AccTimeout string `json:"AccTimeout"` // Request timeout: default, high, medium, low, none AccError string `json:"AccError"` AccSync bool `json:"AccSync"` // Background sync enabled, see SyncDownload and SyncUpload. RetryLimit int `json:"RetryLimit"` // Maximum number of failed requests. SyncPath string `json:"SyncPath"` SyncInterval int `json:"SyncInterval"` SyncUpload bool `json:"SyncUpload"` SyncDownload bool `json:"SyncDownload"` SyncFilenames bool `json:"SyncFilenames"` SyncRaw bool `json:"SyncRaw"` }
Service represents a remote service form for uploading, downloading or syncing media files.
func NewService ¶
NewService creates a new service form.
type Subject ¶
type Subject struct { SubjName string `json:"Name"` SubjAlias string `json:"Alias"` SubjAbout string `json:"About"` SubjBio string `json:"Bio"` SubjNotes string `json:"Notes"` SubjFavorite bool `json:"Favorite"` SubjHidden bool `json:"Hidden"` SubjPrivate bool `json:"Private"` SubjExcluded bool `json:"Excluded"` }
Subject represents an image subject edit form.
func NewSubject ¶
type SyncUpload ¶
type UploadOptions ¶
type UploadOptions struct {
Albums []string `json:"albums"`
}
type User ¶
type User struct { UserName string `json:"Name,omitempty" yaml:"Name,omitempty"` AuthProvider string `json:"AuthProvider,omitempty" yaml:"AuthProvider,omitempty"` AuthMethod string `json:"AuthMethod,omitempty" yaml:"AuthMethod,omitempty"` UserEmail string `json:"Email,omitempty" yaml:"Email,omitempty"` DisplayName string `json:"DisplayName,omitempty" yaml:"DisplayName,omitempty"` UserRole string `json:"Role,omitempty" yaml:"Role,omitempty"` SuperAdmin bool `json:"SuperAdmin,omitempty" yaml:"SuperAdmin,omitempty"` CanLogin bool `json:"CanLogin,omitempty" yaml:"CanLogin,omitempty"` WebDAV bool `json:"WebDAV,omitempty" yaml:"WebDAV,omitempty"` UserAttr string `json:"Attr,omitempty" yaml:"Attr,omitempty"` BasePath string `json:"BasePath,omitempty" yaml:"BasePath,omitempty"` UploadPath string `json:"UploadPath,omitempty" yaml:"UploadPath,omitempty"` Password string `json:"Password,omitempty" yaml:"Password,omitempty"` UserDetails *UserDetails `json:"Details,omitempty"` }
User represents a user account form.
func NewUserFromCli ¶
NewUserFromCli creates a new form with values from a CLI context.
func (*User) Method ¶
func (f *User) Method() authn.MethodType
Method returns the sanitized auth method name.
func (*User) Provider ¶
func (f *User) Provider() authn.ProviderType
Provider returns the sanitized auth provider name.
type UserDetails ¶
type UserDetails struct { BirthYear int `json:"BirthYear"` BirthMonth int `json:"BirthMonth"` BirthDay int `json:"BirthDay"` NameTitle string `json:"NameTitle"` GivenName string `json:"GivenName"` MiddleName string `json:"MiddleName"` FamilyName string `json:"FamilyName"` NameSuffix string `json:"NameSuffix"` NickName string `json:"NickName"` NameSrc string `json:"NameSrc"` UserGender string `json:"Gender"` UserAbout string `json:"About"` UserBio string `json:"Bio"` UserLocation string `json:"Location"` UserCountry string `json:"Country"` UserPhone string `json:"Phone"` SiteURL string `json:"SiteURL"` ProfileURL string `json:"ProfileURL"` FeedURL string `json:"FeedURL"` OrgTitle string `json:"OrgTitle"` OrgName string `json:"OrgName"` OrgEmail string `json:"OrgEmail"` OrgPhone string `json:"OrgPhone"` OrgURL string `json:"OrgURL"` }
UserDetails represents a user details form.
type UserPasscode ¶
type UserPasscode struct { Type string `form:"type" json:"type,omitempty"` Passcode string `form:"passcode" json:"passcode,omitempty"` Password string `form:"password" json:"password,omitempty"` }
UserPasscode represents a multi-factor authentication key setup form.
func (UserPasscode) HasPassword ¶
func (f UserPasscode) HasPassword() bool
HasPassword checks if a password is set.
Source Files ¶
- album.go
- change_password.go
- client.go
- client_credentials.go
- client_token.go
- connect.go
- face.go
- feedback.go
- file.go
- folder.go
- form.go
- form_report.go
- import_options.go
- index_options.go
- json.go
- label.go
- link.go
- login.go
- marker.go
- photo.go
- search.go
- search_albums.go
- search_faces.go
- search_folders.go
- search_labels.go
- search_photos.go
- search_photos_geo.go
- search_sessions.go
- search_subjects.go
- search_users.go
- selection.go
- serialize.go
- service.go
- service_search.go
- service_upload.go
- subject.go
- upload_options.go
- user.go
- user_details.go
- user_passcode.go