Documentation ¶
Index ¶
- func AllowLocalhost() bool
- func CategoryInfo(resp http.ResponseWriter, req *http.Request)
- func FolderInfo(resp http.ResponseWriter, req *http.Request)
- func GetDomain() string
- func GetSessionFromRequest(ctx context.Context, req *http.Request) (*docs.Session, error)
- func IsAdminSession(ctx context.Context, req *http.Request) bool
- func KeywordInfo(resp http.ResponseWriter, req *http.Request)
- func LocationInfo(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 PhotoResize(resp http.ResponseWriter, req *http.Request)
- func SetAuth(auth Auth)
- func SetTasks(tasks Tasks)
- 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)
- type Auth
- type Tasks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowLocalhost ¶ added in v0.10.0
func AllowLocalhost() bool
AllowLocalhost returns the flag controlling if localhost is a valid origin
func CategoryInfo ¶
func CategoryInfo(resp http.ResponseWriter, req *http.Request)
CategoryInfo returns info about the given category or category-value slug
func FolderInfo ¶
func FolderInfo(resp http.ResponseWriter, req *http.Request)
FolderInfo returns info about the given folder path and optionally its subfolders
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 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 KeywordInfo ¶
func KeywordInfo(resp http.ResponseWriter, req *http.Request)
KeywordInfo returns info about the given keyword slug
func LocationInfo ¶
func LocationInfo(resp http.ResponseWriter, req *http.Request)
LocationInfo returns info about the given location slug
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
func PhotoList ¶
func PhotoList(resp http.ResponseWriter, req *http.Request)
PhotoList responds with a listing of photos for the given parameters
func PhotoResize ¶
func PhotoResize(resp http.ResponseWriter, req *http.Request)
PhotoResize returns a resized version of a photo
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
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.