Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppContext ¶
type AppContext interface { DB() *pop.Connection Logger() *zap.Logger NewTransaction(func(appCtx AppContext) error) error Session() *auth.Session }
AppContext should be the first argument passed to all stateless methods and contains all necessary config for the app
This is a separate package so that all parts of the app can import it without creating an import cycle
func NewAppContext ¶
func NewAppContext(db *pop.Connection, logger *zap.Logger, session *auth.Session) AppContext
NewAppContext creates a new AppContext
func NewAppContextFromContext ¶
func NewAppContextFromContext(ctx context.Context, appCtx AppContext) AppContext
NewAppContextFromContext creates a new AppContext taking context.Context into account and pulling some values from it
Click to show internal directories.
Click to hide internal directories.