Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTenantFromEchoContext ¶
GetTenantFromEchoContext tries to extract the tenant from the echo context. If the "tenantID" is missing from the context, then a default value and nil are returned as the int64 and error values.
func GetUserFromEchoContext ¶
Types ¶
type NoUnknownFieldsBinder ¶
type NoUnknownFieldsBinder struct{}
struct containing our custom "bind" logic
func (*NoUnknownFieldsBinder) Bind ¶
func (binder *NoUnknownFieldsBinder) Bind(i interface{}, c echo.Context) error
The single "Bind" method implements the echo.Binder interface.
For our custom binder we want to not allow any fields that aren't declared on the `*CreateRequest` structs. This is easily achieved by switching on the `DisallowUnknownFields` Decoder setting for unmarshaling json.
type SourcesContext ¶
type SourcesContext struct{ echo.Context }
SourcesContext is a wrapper around the echo.Context struct so we can override methods provided by the echo library
func (*SourcesContext) Logger ¶
func (sc *SourcesContext) Logger() echo.Logger
overriding the Logger method so we can inject custom fields into the logger. The first time this method is called (for the request) some parsing is done and stored back on the echo context. From there the fields will be present on every invocation of (*echo.Context).Logger().Debug/Info/Error/Warn