Documentation ¶
Index ¶
- Constants
- Variables
- func Cors(opts ...cors.Option) func(http.Handler) http.Handler
- func ExtractAccountUUID(opts ...account.Option) func(http.Handler) http.Handler
- func Logger(logger log.Logger) func(http.Handler) http.Handler
- func NoCache(next http.Handler) http.Handler
- func Secure(next http.Handler) http.Handler
- func Static(root string, fs http.FileSystem, ttl int) func(http.Handler) http.Handler
- func Token(token string) func(http.Handler) http.Handler
- func TraceContext(next http.Handler) http.Handler
- func Version(name, version string) func(http.Handler) http.Handler
Constants ¶
View Source
const AccountID string = "Account-Id"
AccountID serves as key for the account uuid in the context
View Source
const RoleIDs string = "Role-Ids"
RoleIDs serves as key for the roles in the context
Variables ¶
View Source
var ( // ErrInvalidToken is returned when the request token is invalid. ErrInvalidToken = errors.New("invalid or missing token") )
Functions ¶
func ExtractAccountUUID ¶
ExtractAccountUUID provides a middleware to extract the account uuid from the x-access-token header value and write it to the context. If there is no x-access-token the middleware is omitted.
func Logger ¶
Logger is a middleware to log http requests. It uses debug level logging and should be used by all services save the proxy (which uses info level logging).
func TraceContext ¶
TraceContext unpacks the request context looking for an existing trace id.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.