Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsHandlerFunc ¶
func AsHandlerFunc(a Action) http.HandlerFunc
AsHandlerFunc is a helper wrapper to make implementing actions easier
Types ¶
type AuthMiddleware ¶
type AuthMiddleware struct {
// contains filtered or unexported fields
}
AuthMiddleware implements https://tools.ietf.org/html/draft-cavage-http-signatures-12 authentication scheme as an HTTP middleware
func NewAuthMiddleware ¶
func NewAuthMiddleware(v *httpsig.Verifier) *AuthMiddleware
NewAuthMiddleware creates a new AuthMiddleware using the v httpsig.Verifier
func (*AuthMiddleware) Middleware ¶
func (a *AuthMiddleware) Middleware(handler http.Handler) http.Handler
Middleware implements mux.Middlware interface
type DatabaseMiddleware ¶
type DatabaseMiddleware struct {
// contains filtered or unexported fields
}
DatabaseMiddleware middleware
func NewDatabaseMiddleware ¶
func NewDatabaseMiddleware(dbName string, client *mongo.Client) (*DatabaseMiddleware, error)
NewDatabaseMiddleware creates a new database middleware
func (*DatabaseMiddleware) Database ¶
func (d *DatabaseMiddleware) Database() *mongo.Database
Database return database as configured in the middleware
func (*DatabaseMiddleware) Middleware ¶
func (d *DatabaseMiddleware) Middleware(next http.Handler) http.Handler
Middleware is the middleware function
type NodeKeyGetter ¶
type NodeKeyGetter struct{}
NodeKeyGetter implements httpsig.KeyGetter for the nodes collections
func NewNodeKeyGetter ¶
func NewNodeKeyGetter() NodeKeyGetter
NewNodeKeyGetter create a httpsig.KeyGetter that uses the nodes collection to find the key
func (NodeKeyGetter) GetKey ¶
func (m NodeKeyGetter) GetKey(id string) interface{}
GetKey implements httpsig.KeyGetter
type Response ¶
type Response interface { Status() int Err() error // header getter Header() http.Header // header setter WithHeader(k, v string) Response }
Response interface
type UserKeyGetter ¶
type UserKeyGetter struct {
// contains filtered or unexported fields
}
UserKeyGetter implements httpsig.KeyGetter for the users collections
func NewUserKeyGetter ¶
func NewUserKeyGetter(db *mongo.Database) UserKeyGetter
NewUserKeyGetter create a httpsig.KeyGetter that uses the users collection to find the key
func (UserKeyGetter) GetKey ¶
func (u UserKeyGetter) GetKey(id string) interface{}
GetKey implements httpsig.KeyGetter