Documentation ¶
Index ¶
- Constants
- Variables
- func AllowLocalhost() bool
- func CategoryChildren(resp http.ResponseWriter, req *http.Request)
- func CategoryDeleteEmpty(resp http.ResponseWriter, req *http.Request)
- func CategoryInfo(resp http.ResponseWriter, req *http.Request)
- func CategoryListEmpty(resp http.ResponseWriter, req *http.Request)
- func CategoryUpdate(resp http.ResponseWriter, req *http.Request)
- func CategoryUpdateRelated(resp http.ResponseWriter, req *http.Request)
- func DateChildren(resp http.ResponseWriter, req *http.Request)
- func DateDeleteEmpty(resp http.ResponseWriter, req *http.Request)
- func DateListEmpty(resp http.ResponseWriter, req *http.Request)
- func DbCheckAndFixVisTokenCounts(resp http.ResponseWriter, req *http.Request)
- func DbSchemaUpdate(resp http.ResponseWriter, req *http.Request)
- func DbSchemaVersion(resp http.ResponseWriter, req *http.Request)
- func EventAdd(resp http.ResponseWriter, req *http.Request)
- func EventCount(resp http.ResponseWriter, req *http.Request)
- func FolderChildren(resp http.ResponseWriter, req *http.Request)
- func FolderDeleteEmpty(resp http.ResponseWriter, req *http.Request)
- func FolderInfo(resp http.ResponseWriter, req *http.Request)
- func FolderListEmpty(resp http.ResponseWriter, req *http.Request)
- func FolderUpdate(resp http.ResponseWriter, req *http.Request)
- func FolderVisibilityToken(resp http.ResponseWriter, req *http.Request)
- func GetDomain() string
- func GetSessionFromRequest(ctx context.Context, req *http.Request) (*docs.Session, error)
- func HomeGroups(resp http.ResponseWriter, req *http.Request)
- func IsAdminSession(ctx context.Context, req *http.Request) bool
- func KeywordChildren(resp http.ResponseWriter, req *http.Request)
- func KeywordDeleteEmpty(resp http.ResponseWriter, req *http.Request)
- func KeywordInfo(resp http.ResponseWriter, req *http.Request)
- func KeywordListEmpty(resp http.ResponseWriter, req *http.Request)
- func KeywordUpdate(resp http.ResponseWriter, req *http.Request)
- func LocationChildren(resp http.ResponseWriter, req *http.Request)
- func LocationDeleteEmpty(resp http.ResponseWriter, req *http.Request)
- func LocationInfo(resp http.ResponseWriter, req *http.Request)
- func LocationListEmpty(resp http.ResponseWriter, req *http.Request)
- func LocationUpdate(resp http.ResponseWriter, req *http.Request)
- func NotifyDeletePhotoTask(resp http.ResponseWriter, req *http.Request)
- func NotifyFinalizePhotoTask(resp http.ResponseWriter, req *http.Request)
- func NotifyMasterStorageUpdates(resp http.ResponseWriter, req *http.Request)
- func PhotoGetMetadata(resp http.ResponseWriter, req *http.Request)
- func PhotoList(resp http.ResponseWriter, req *http.Request)
- func PhotoRandom(resp http.ResponseWriter, req *http.Request)
- func PhotoResize(resp http.ResponseWriter, req *http.Request)
- func SetAuth(auth Auth)
- func SetHomeGroupCountThreshold(t int)
- func SetTasks(tasks Tasks)
- func SitemapGenerate(resp http.ResponseWriter, req *http.Request)
- func SitemapGet(resp http.ResponseWriter, req *http.Request)
- func TimelineGroupChildren(resp http.ResponseWriter, req *http.Request)
- func TimelineGroupCreate(resp http.ResponseWriter, req *http.Request)
- func TimelineGroupDelete(resp http.ResponseWriter, req *http.Request)
- func TimelineGroupInfo(resp http.ResponseWriter, req *http.Request)
- func TimelineGroupSync(resp http.ResponseWriter, req *http.Request)
- func TimelineGroupUpdate(resp http.ResponseWriter, req *http.Request)
- func TimelineGroupUpdateFilter(resp http.ResponseWriter, req *http.Request)
- func TimelineGroupVisibilityToken(resp http.ResponseWriter, req *http.Request)
- func UserAdd(resp http.ResponseWriter, req *http.Request)
- func UserLogin(resp http.ResponseWriter, req *http.Request)
- func UserLogout(resp http.ResponseWriter, req *http.Request)
- func UserSessionRefresh(resp http.ResponseWriter, req *http.Request)
- func VisibilityActivateLink(resp http.ResponseWriter, req *http.Request)
- func VisibilityCreate(resp http.ResponseWriter, req *http.Request)
- func VisibilityCreateLink(resp http.ResponseWriter, req *http.Request)
- func VisibilityHasTokens(resp http.ResponseWriter, req *http.Request)
- func VisibilityList(resp http.ResponseWriter, req *http.Request)
- func VisibilityTokensClear(resp http.ResponseWriter, req *http.Request)
- func VisibilityUpdateLink(resp http.ResponseWriter, req *http.Request)
- type Auth
- type Tasks
Constants ¶
const CookieSessionID = "sid"
CookieSessionID is the session id cookie
const CookieVisTokenValues = "vtv"
CookieVisTokenValues is the visibility token values cookie
Variables ¶
var ReferrerRegex = compileReferrerRegex()
Functions ¶
func AllowLocalhost ¶ added in v0.10.0
func AllowLocalhost() bool
AllowLocalhost returns the flag controlling if localhost is a valid origin
func CategoryChildren ¶ added in v1.0.0
func CategoryChildren(resp http.ResponseWriter, req *http.Request)
CategoryChildren returns info about the children of the given category
func CategoryDeleteEmpty ¶ added in v1.22.7
func CategoryDeleteEmpty(resp http.ResponseWriter, req *http.Request)
func CategoryInfo ¶
func CategoryInfo(resp http.ResponseWriter, req *http.Request)
CategoryInfo returns info about the given category or category-value slug
func CategoryListEmpty ¶ added in v1.22.7
func CategoryListEmpty(resp http.ResponseWriter, req *http.Request)
func CategoryUpdate ¶ added in v1.4.0
func CategoryUpdate(resp http.ResponseWriter, req *http.Request)
CategoryUpdate updates a category. Must be admin.
func CategoryUpdateRelated ¶ added in v1.9.0
func CategoryUpdateRelated(resp http.ResponseWriter, req *http.Request)
CategoryUpdateRelated updates the related categories. Must be admin.
func DateChildren ¶ added in v1.0.0
func DateChildren(resp http.ResponseWriter, req *http.Request)
DateChildren returns info about the children of the given date
func DateDeleteEmpty ¶ added in v1.22.7
func DateDeleteEmpty(resp http.ResponseWriter, req *http.Request)
func DateListEmpty ¶ added in v1.22.7
func DateListEmpty(resp http.ResponseWriter, req *http.Request)
func DbCheckAndFixVisTokenCounts ¶ added in v1.20.4
func DbCheckAndFixVisTokenCounts(resp http.ResponseWriter, req *http.Request)
func DbSchemaUpdate ¶ added in v1.0.0
func DbSchemaUpdate(resp http.ResponseWriter, req *http.Request)
DbSchemaUpdate updates schema to latest version. Must be admin.
func DbSchemaVersion ¶ added in v1.0.0
func DbSchemaVersion(resp http.ResponseWriter, req *http.Request)
DbSchemaVersion returns info about the database schema version. Admin only.
func EventCount ¶ added in v1.18.6
func EventCount(resp http.ResponseWriter, req *http.Request)
Query event counts. Admin only.
func FolderChildren ¶ added in v1.0.0
func FolderChildren(resp http.ResponseWriter, req *http.Request)
FolderChildren returns info about the children of the given folder
func FolderDeleteEmpty ¶ added in v1.22.7
func FolderDeleteEmpty(resp http.ResponseWriter, req *http.Request)
func FolderInfo ¶
func FolderInfo(resp http.ResponseWriter, req *http.Request)
FolderInfo returns info about the given folder path
func FolderListEmpty ¶ added in v1.22.7
func FolderListEmpty(resp http.ResponseWriter, req *http.Request)
func FolderUpdate ¶ added in v1.0.0
func FolderUpdate(resp http.ResponseWriter, req *http.Request)
FolderUpdate updates a folder. Must be admin.
func FolderVisibilityToken ¶ added in v0.11.0
func FolderVisibilityToken(resp http.ResponseWriter, req *http.Request)
FolderVisibilityToken can add or delete a visibility token on a folder. Admin only.
func GetDomain ¶ added in v0.10.0
func GetDomain() string
GetDomain returns the DOMAIN env var or a default
func GetSessionFromRequest ¶
GetSessionFromRequest tries to get the active session associated with a request. Uses the session cookie.
func HomeGroups ¶ added in v1.0.0
func HomeGroups(resp http.ResponseWriter, req *http.Request)
HomeGroups returns a selection of groups for listing on the home page
func IsAdminSession ¶
IsAdminSession checks if the session associated with the request belongs to an admin user. If there is no session, fallbacks to indicating a non-admin session.
func KeywordChildren ¶ added in v1.0.0
func KeywordChildren(resp http.ResponseWriter, req *http.Request)
KeywordChildren returns info about the children of the given keyword
func KeywordDeleteEmpty ¶ added in v1.22.7
func KeywordDeleteEmpty(resp http.ResponseWriter, req *http.Request)
func KeywordInfo ¶
func KeywordInfo(resp http.ResponseWriter, req *http.Request)
KeywordInfo returns info about the given keyword slug
func KeywordListEmpty ¶ added in v1.22.7
func KeywordListEmpty(resp http.ResponseWriter, req *http.Request)
func KeywordUpdate ¶ added in v1.4.0
func KeywordUpdate(resp http.ResponseWriter, req *http.Request)
KeywordUpdate updates a keyword. Must be admin.
func LocationChildren ¶ added in v1.0.0
func LocationChildren(resp http.ResponseWriter, req *http.Request)
LocationChildren returns info about the children of the given location
func LocationDeleteEmpty ¶ added in v1.22.7
func LocationDeleteEmpty(resp http.ResponseWriter, req *http.Request)
func LocationInfo ¶
func LocationInfo(resp http.ResponseWriter, req *http.Request)
LocationInfo returns info about the given location slug
func LocationListEmpty ¶ added in v1.22.7
func LocationListEmpty(resp http.ResponseWriter, req *http.Request)
func LocationUpdate ¶ added in v1.4.0
func LocationUpdate(resp http.ResponseWriter, req *http.Request)
LocationUpdate updates a location. Must be admin.
func NotifyDeletePhotoTask ¶
func NotifyDeletePhotoTask(resp http.ResponseWriter, req *http.Request)
NotifyDeletePhotoTask is the handler for deleting photo tasks
func NotifyFinalizePhotoTask ¶
func NotifyFinalizePhotoTask(resp http.ResponseWriter, req *http.Request)
NotifyFinalizePhotoTask is the handler for finalizing photo tasks
func NotifyMasterStorageUpdates ¶
func NotifyMasterStorageUpdates(resp http.ResponseWriter, req *http.Request)
NotifyMasterStorageUpdates handles storage notifications from the photo master bucket
func PhotoGetMetadata ¶
func PhotoGetMetadata(resp http.ResponseWriter, req *http.Request)
PhotoGetMetadata returns metadata for a photo. For groups, returns both the id and the display string.
func PhotoList ¶
func PhotoList(resp http.ResponseWriter, req *http.Request)
PhotoList responds with a listing of photos for the given parameters
func PhotoRandom ¶ added in v1.0.0
func PhotoRandom(resp http.ResponseWriter, req *http.Request)
PhotoRandom responds with a random photo selection for the given parameters
func PhotoResize ¶
func PhotoResize(resp http.ResponseWriter, req *http.Request)
PhotoResize returns a resized version of a photo
func SetHomeGroupCountThreshold ¶ added in v1.0.0
func SetHomeGroupCountThreshold(t int)
SetHomeGroupCountThreshold changes the threshold (intended for testing)
func SitemapGenerate ¶ added in v1.12.0
func SitemapGenerate(resp http.ResponseWriter, req *http.Request)
SitemapGenerate generates the sitemap. Must be admin.
func SitemapGet ¶ added in v1.12.0
func SitemapGet(resp http.ResponseWriter, req *http.Request)
SitemapGet retrieves the sitemap. Must have been generated.
func TimelineGroupChildren ¶ added in v1.6.0
func TimelineGroupChildren(resp http.ResponseWriter, req *http.Request)
TimelineGroupChildren returns info about the children of the given timeline group
func TimelineGroupCreate ¶ added in v1.6.0
func TimelineGroupCreate(resp http.ResponseWriter, req *http.Request)
TimelineGroupCreate handles timeline group creation. Admin only.
func TimelineGroupDelete ¶ added in v1.7.0
func TimelineGroupDelete(resp http.ResponseWriter, req *http.Request)
TimelineGroupDelete deletes a timeline group. Admin only.
func TimelineGroupInfo ¶ added in v1.6.0
func TimelineGroupInfo(resp http.ResponseWriter, req *http.Request)
TimelineGroupInfo returns info about the given timeline group
func TimelineGroupSync ¶ added in v1.6.0
func TimelineGroupSync(resp http.ResponseWriter, req *http.Request)
TimelineGroupSync syncs a timeline group. Admin only.
func TimelineGroupUpdate ¶ added in v1.6.0
func TimelineGroupUpdate(resp http.ResponseWriter, req *http.Request)
TimelineGroupUpdate updates a timeline group. Must be admin.
func TimelineGroupUpdateFilter ¶ added in v1.6.0
func TimelineGroupUpdateFilter(resp http.ResponseWriter, req *http.Request)
TimelineGroupUpdateFilter updates the filter for a timeline group. Must be admin.
func TimelineGroupVisibilityToken ¶ added in v1.6.0
func TimelineGroupVisibilityToken(resp http.ResponseWriter, req *http.Request)
TimelineGroupVisibilityToken can add or delete a visibility token on a timeline group. Admin only.
func UserLogin ¶
func UserLogin(resp http.ResponseWriter, req *http.Request)
UserLogin attempts to login a user
func UserLogout ¶
func UserLogout(resp http.ResponseWriter, req *http.Request)
UserLogout ends the active session
func UserSessionRefresh ¶
func UserSessionRefresh(resp http.ResponseWriter, req *http.Request)
UserSessionRefresh refreshes the active session
func VisibilityActivateLink ¶ added in v0.11.0
func VisibilityActivateLink(resp http.ResponseWriter, req *http.Request)
VisibilityActivateLink activates a visibility token link.
func VisibilityCreate ¶ added in v0.11.0
func VisibilityCreate(resp http.ResponseWriter, req *http.Request)
VisibilityCreate creates a new visibility token. Admin only.
func VisibilityCreateLink ¶ added in v0.11.0
func VisibilityCreateLink(resp http.ResponseWriter, req *http.Request)
VisibilityCreateLink creates a new link on a visibility token. Admin only.
func VisibilityHasTokens ¶ added in v1.5.0
func VisibilityHasTokens(resp http.ResponseWriter, req *http.Request)
VisibilityHasTokens checks if the vis token value cookie has a value. Does not validate that the tokens are valid.
func VisibilityList ¶ added in v0.11.0
func VisibilityList(resp http.ResponseWriter, req *http.Request)
VisibilityList returns a list of all visibility tokens. Admin only.
func VisibilityTokensClear ¶ added in v1.5.0
func VisibilityTokensClear(resp http.ResponseWriter, req *http.Request)
VisibilityTokensClear clears any active tokens.
func VisibilityUpdateLink ¶ added in v0.11.0
func VisibilityUpdateLink(resp http.ResponseWriter, req *http.Request)
VisibilityUpdateLink updates an existing visibility token link. Admin only.
Types ¶
type Auth ¶
type Auth interface {
CheckServiceAccountAuthorization(ctx context.Context, req *http.Request) bool
}
Auth interface for authorization checks. This interface is here to allow for testing to substitute something different.
func GetOrCreateAuth ¶ added in v1.6.0
GetOrCreateAuth gets the Auth object to use. Creates it if it does not exist.