Documentation ¶
Index ¶
Constants ¶
View Source
const (
DBTypePostgres = DBType(ftlv1.ModuleContextResponse_POSTGRES)
)
Variables ¶
This section is empty.
Functions ¶
func ContextWithDBProvider ¶
func ContextWithDBProvider(ctx context.Context, provider *DBProvider) context.Context
Types ¶
type DBProvider ¶
type DBProvider struct {
// contains filtered or unexported fields
}
DBProvider takes in DSNs and holds a *sql.DB for each this allows us to: - pool db connections, rather than initializing anew each time - validate DSNs at startup, rather than returning errors or panicking at Database.Get()
func DBProviderFromContext ¶
func DBProviderFromContext(ctx context.Context) *DBProvider
func NewDBProvider ¶
func NewDBProvider() *DBProvider
type ModuleContext ¶
type ModuleContext struct {
// contains filtered or unexported fields
}
ModuleContext holds the context needed for a module, including configs, secrets and DSNs
func NewFromProto ¶
func NewFromProto(ctx context.Context, moduleName string, response *ftlv1.ModuleContextResponse) (*ModuleContext, error)
func (*ModuleContext) ApplyToContext ¶
func (m *ModuleContext) ApplyToContext(ctx context.Context) context.Context
ApplyToContext sets up the context so that configurations, secrets and DSNs can be retreived Each of these components have accessors to get a manager back from the context
Click to show internal directories.
Click to hide internal directories.