Documentation ¶
Index ¶
- func AsHandlerFunc(a Action) http.HandlerFunc
- func NewAuthMiddleware(users provision.Twins) mux.MiddlewareFunc
- func TwinID(ctx context.Context) uint32
- func TwinPublicKey(ctx context.Context) ed25519.PublicKey
- type Action
- type Response
- func Accepted() Response
- func BadRequest(err error) Response
- func Conflict(err error) Response
- func Created() Response
- func Error(err error, code ...int) Response
- func Forbidden(err error) Response
- func NoContent() Response
- func NotFound(err error) Response
- func Ok() Response
- func PaymentRequired(err error) Response
- func UnAuthorized(err error) Response
- func Unavailable(err error) Response
- type UserMap
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
func NewAuthMiddleware ¶
func NewAuthMiddleware(users provision.Twins) mux.MiddlewareFunc
NewAuthMiddleware creates a new AuthMiddleware using jwt signed by the caller
Types ¶
type Response ¶
type Response interface { Status() int Err() error // header getter Header() http.Header // header setter WithHeader(k, v string) Response }
Response interface
func Unavailable ¶
Unavailable returned when server is too busy
type UserMap ¶
UserMap implements provision.Twins for the users collections
func NewUserMap ¶
func NewUserMap() UserMap
NewUserMap create a new UserMap that uses the users collection to find the key
func (UserMap) AddKeyFromHex ¶
AddKeyFromHex adds a user key to map from a hex string
Click to show internal directories.
Click to hide internal directories.