Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GraphQLMiddleware ¶
GraphQLMiddleware: Adds things to context that are needed for serving requests
func ToResolverContext ¶
func ToResolverContext(ctx context.Context, opts ...ReqContextOption) context.Context
ToResolverContext: decorates a context with items needed for the GraphQL api.
Types ¶
type ContextKey ¶
type ContextKey string
const ( CurrentUser ContextKey = "CurrentUser" AccountsApi ContextKey = "AccountsApi" DatabasePool ContextKey = "DatabasePool" )
type PlatformStuff ¶
type PlatformStuff struct { Pool connection.Pool NewApi api.AccountsApiFactory }
func GetPlatformStuff ¶
func GetPlatformStuff(ctx context.Context) PlatformStuff
type ReqContextOption ¶
func WithAccountsApi ¶
func WithAccountsApi(factory api.AccountsApiFactory) ReqContextOption
WithAccountsApi: sets a custom AccountsApiFactory. The factory alloows the calling function to control the txn semantics of the database connection.
func WithDatabasePool ¶
func WithDatabasePool(pool connection.Pool) ReqContextOption
WithDatabasePool: sets a custom DatabasePool.
Click to show internal directories.
Click to hide internal directories.