Versions in this module Expand all Collapse all v1 v1.0.0 Jan 23, 2016 Changes in this version + var NewContextFunc = func(r *http.Request) context.Context + var TimeNow = time.Now + func Param(ctx context.Context, name string) string + type Auth interface + RequireUser func(ctx context.Context, w http.ResponseWriter, r *http.Request) (string, error) + type Config struct + AdminKey usermgr.AdminKey + Auth Auth + DownloadURL string + Storage Storage + type FileStorage struct + Path string + func (fs FileStorage) Get(ctx context.Context, etag string) ([]byte, string, error) + func (fs FileStorage) Put(ctx context.Context, data []byte) (string, error) + type NilAuth struct + func (na NilAuth) RequireUser(ctx context.Context, w http.ResponseWriter, r *http.Request) (string, error) + type OauthAuth struct + Config oauth2.Config + EmailSuffix string + TokenSigningKey []byte + UserInfoURL string + ValidateRemoteUser func(usermgr.User) (isAdmin bool, err error) + func (a OauthAuth) HandleCallback(ctx context.Context, w http.ResponseWriter, r *http.Request) error + func (a OauthAuth) RequireUser(ctx context.Context, w http.ResponseWriter, r *http.Request) (string, error) + type OpenIDUserInfo struct + Email string + Name string + Sub string + type RemoteUser struct + IsAdmin bool + Name string + type Server struct + AdminKey usermgr.AdminKey + Auth Auth + ContextFunc func() context.Context + DownloadURL string + Mux *web.Mux + Storage Storage + func New(config Config) *Server + func (s *Server) RequireUser(ctx context.Context, w http.ResponseWriter, r *http.Request) (*RemoteUser, error) + type Storage interface + Get func(ctx context.Context, etag string) (data []byte, newEtag string, err error) + Put func(ctx context.Context, data []byte) (etag string, err error)