Documentation ¶
Index ¶
- Constants
- func BuildHandler(r *Router, internalErrorHandler http.Handler, badRequestHandler http.Handler, ...) (rt http.Handler, err error)
- func ClarkeSays(moo string) string
- func LoadConfigFile(filename string, a app.Application, debug bool) (c *config.Config, err error)
- func NewHTTPClient(c *config.Config) *http.Client
- func PromptAdminUser() (username, email, password string, err error)
- func PromptFileExistsContinue(path string) (b bool, err error)
- func PromptNewConfig(file string) (c *config.Config, err error)
- func PromptOverwriteExistingFile(path string) (b bool, err error)
- func PromptServerProfile(scheme, host string) (sp services.ServerPreferences, err error)
- func SaveConfigFile(filename string, c *config.Config, others ...interface{}) error
- func Vars(r *http.Request) map[string]string
- type Framework
- func (f *Framework) Context(r *http.Request) context.Context
- func (f *Framework) CreateUser(c context.Context, username, email, password string) (userID string, err error)
- func (f *Framework) GetByIRI(c context.Context, id *url.URL) (vocab.Type, error)
- func (f *Framework) GetPrivileges(c context.Context, userID paths.UUID, appPrivileges interface{}) (admin bool, err error)
- func (f *Framework) IsNotUniqueEmail(err error) bool
- func (f *Framework) IsNotUniqueUsername(err error) bool
- func (f *Framework) OpenFollowRequests(c context.Context, userID paths.UUID) ([]vocab.ActivityStreamsFollow, error)
- func (f *Framework) Send(c context.Context, userID paths.UUID, t vocab.Type) error
- func (f *Framework) SendAcceptFollow(ctx context.Context, userID paths.UUID, followIRI *url.URL) error
- func (f *Framework) SendRejectFollow(ctx context.Context, userID paths.UUID, followIRI *url.URL) error
- func (f *Framework) Session(r *http.Request) (app.Session, error)
- func (f *Framework) SetPrivileges(c context.Context, userID paths.UUID, admin bool, appPrivileges interface{}) error
- func (f *Framework) UserIRI(userUUID paths.UUID) *url.URL
- func (f *Framework) Validate(w http.ResponseWriter, r *http.Request) (userID paths.UUID, authenticated bool, err error)
- type Route
- func (r *Route) ActivityPubAndWebHandleFunc(path string, authFn app.AuthorizeFunc, ...) app.Route
- func (r *Route) ActivityPubOnlyHandleFunc(path string, authFn app.AuthorizeFunc) app.Route
- func (r *Route) HandleAccessTokenRequest(path string) app.Route
- func (r *Route) HandleAuthorizationRequest(path string) app.Route
- func (r *Route) Handler(handler http.Handler) app.Route
- func (r *Route) HandlerFunc(f func(http.ResponseWriter, *http.Request)) app.Route
- func (r *Route) Headers(pairs ...string) app.Route
- func (r *Route) Host(tpl string) app.Route
- func (r *Route) Methods(methods ...string) app.Route
- func (r *Route) Name(name string) app.Route
- func (r *Route) Path(tpl string) app.Route
- func (r *Route) PathPrefix(tpl string) app.Route
- func (r *Route) Queries(pairs ...string) app.Route
- func (r *Route) Schemes(schemes ...string) app.Route
- func (r *Route) Subrouter() app.Router
- func (r *Route) WebOnlyHandler(path string, handler http.Handler) app.Route
- func (r *Route) WebOnlyHandlerFunc(path string, f func(http.ResponseWriter, *http.Request)) app.Route
- type Router
- func (r *Router) ActivityPubAndWebHandleFunc(path string, authFn app.AuthorizeFunc, ...) app.Route
- func (r *Router) ActivityPubOnlyHandleFunc(path string, authFn app.AuthorizeFunc) app.Route
- func (r *Router) Get(name string) app.Route
- func (r *Router) Handle(path string, handler http.Handler) app.Route
- func (r *Router) HandleAccessTokenRequest(path string) app.Route
- func (r *Router) HandleAuthorizationRequest(path string) app.Route
- func (r *Router) HandleFunc(path string, f func(http.ResponseWriter, *http.Request)) app.Route
- func (r *Router) Headers(pairs ...string) app.Route
- func (r *Router) Host(tpl string) app.Route
- func (r *Router) Methods(methods ...string) app.Route
- func (r *Router) Name(name string) app.Route
- func (r *Router) NewRoute() app.Route
- func (r *Router) Path(tpl string) app.Route
- func (r *Router) PathPrefix(tpl string) app.Route
- func (r *Router) Queries(pairs ...string) app.Route
- func (r *Router) Schemes(schemes ...string) app.Route
- func (r *Router) Use(mwf ...mux.MiddlewareFunc)
- func (r *Router) Walk(walkFn mux.WalkFunc) error
- func (r *Router) WebOnlyHandle(path string, handler http.Handler) app.Route
- func (r *Router) WebOnlyHandleFunc(path string, f func(http.ResponseWriter, *http.Request)) app.Route
- type RoutingDatabase
- type Server
- type StartStopper
Constants ¶
View Source
const ( LoginFormEmailKey = "email" LoginFormPasswordKey = "password" )
Variables ¶
This section is empty.
Functions ¶
func BuildHandler ¶
func BuildHandler(r *Router, internalErrorHandler http.Handler, badRequestHandler http.Handler, getAuthWebHandler http.Handler, getLoginWebHandler http.Handler, scheme string, c *config.Config, a app.Application, fr app.Framework, actor pub.Actor, db RoutingDatabase, users *services.Users, cy *services.Crypto, ni *services.NodeInfo, following *services.Following, followers *services.Followers, liked *services.Liked, sqldb *sql.DB, oauth *oauth2.Server, sl *web.Sessions, fw *Framework, clock pub.Clock, sw, apcore app.Software, debug bool) (rt http.Handler, err error)
func ClarkeSays ¶
func LoadConfigFile ¶
func PromptAdminUser ¶
func PromptServerProfile ¶
func PromptServerProfile(scheme, host string) (sp services.ServerPreferences, err error)
func SaveConfigFile ¶
Types ¶
type Framework ¶
type Framework struct {
// contains filtered or unexported fields
}
func BuildFramework ¶
func (*Framework) CreateUser ¶
func (*Framework) GetPrivileges ¶
func (*Framework) IsNotUniqueEmail ¶
func (*Framework) IsNotUniqueUsername ¶
func (*Framework) OpenFollowRequests ¶
func (*Framework) SendAcceptFollow ¶
func (*Framework) SendRejectFollow ¶
func (*Framework) SetPrivileges ¶
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
func (*Route) ActivityPubAndWebHandleFunc ¶
func (r *Route) ActivityPubAndWebHandleFunc(path string, authFn app.AuthorizeFunc, f func(http.ResponseWriter, *http.Request)) app.Route
func (*Route) ActivityPubOnlyHandleFunc ¶
func (*Route) HandleAccessTokenRequest ¶
func (*Route) HandleAuthorizationRequest ¶
func (*Route) HandlerFunc ¶
func (*Route) WebOnlyHandler ¶
func (*Route) WebOnlyHandlerFunc ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) ActivityPubAndWebHandleFunc ¶
func (r *Router) ActivityPubAndWebHandleFunc(path string, authFn app.AuthorizeFunc, f func(http.ResponseWriter, *http.Request)) app.Route
func (*Router) ActivityPubOnlyHandleFunc ¶
func (*Router) HandleAccessTokenRequest ¶
func (*Router) HandleAuthorizationRequest ¶
func (*Router) HandleFunc ¶
func (*Router) Use ¶
func (r *Router) Use(mwf ...mux.MiddlewareFunc)
func (*Router) WebOnlyHandle ¶
func (*Router) WebOnlyHandleFunc ¶
type RoutingDatabase ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewHTTPSServer ¶
func NewHTTPSServer(c *config.Config, h http.Handler, a app.Application, sqldb *sql.DB, d models.SqlDialect, models []models.Model, ss []StartStopper) (s *Server, err error)
func NewInsecureServer ¶
func NewInsecureServer(c *config.Config, h http.Handler, a app.Application, sqldb *sql.DB, d models.SqlDialect, models []models.Model, ss []StartStopper) (s *Server, err error)
type StartStopper ¶
type StartStopper interface { Start() Stop() }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.