Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatabaseMiddleware ¶
func DatabaseMiddleware(db, rodb *pop.Connection) buffalo.MiddlewareFunc
DatabaseMiddleware returns a database connection provider middleware that will add the db into the `tx` context variable, in case its a PUT/POST/DELETE/PATCH method, it will wrap the handler in a transaction, otherwise it will just add the connection in the context.
Provided middleware can also consider a seccond read only replica database connection (rodb) that will be used on idempotent operations if present.
func DatabaseProvider ¶
DatabaseProvider returns a function that returns the database connection for the current environment.
func NewPartialFeeder ¶
NewPartialFeeder returns a partialFeeder that looks up for template files in the given FS and returns its contents as string.
func NewRequestIDMiddleware ¶
func NewRequestIDMiddleware(headerKey string) buffalo.MiddlewareFunc
NewRequestIDMiddleware returns a middleware that adds a request ID to the context. It will first attempt to look if the passed headerkey is set in the request headers. If it is not set, it will generate a new UUID and set it in the logs.
Types ¶
This section is empty.