runtimectx

package
v0.380.0-next.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextIdentityField        = "identity"
	ContextIsAuthenticatedField = "isAuthenticated"
	ContextNowField             = "now"
	ContextEnvField             = "env"
	ContextSecretField          = "secret"
)
View Source
const ContextTarget string = "ctx"
View Source
const (
	SecretContextKey secretContextKey = "secret"
)

Variables

Functions

func GetMailClient

func GetMailClient(ctx context.Context) (mail.EmailClient, error)

func GetNow

func GetNow() time.Time

func GetOAuthConfig added in v0.372.0

func GetOAuthConfig(ctx context.Context) (*config.AuthConfig, error)

func GetPrivateKey

func GetPrivateKey(ctx context.Context) (*rsa.PrivateKey, error)

func GetRequestHeaders

func GetRequestHeaders(ctx context.Context) (map[string][]string, error)

func GetSecret

func GetSecret(ctx context.Context, secret string) (string, error)

func GetSecrets

func GetSecrets(ctx context.Context) map[string]string

func WithEnv

func WithEnv(ctx context.Context, env KeelEnv) context.Context

func WithMailClient

func WithMailClient(ctx context.Context, client mail.EmailClient) context.Context

func WithOAuthConfig added in v0.372.0

func WithOAuthConfig(ctx context.Context, config *config.AuthConfig) context.Context

func WithPrivateKey

func WithPrivateKey(ctx context.Context, privateKey *rsa.PrivateKey) context.Context

func WithRequestHeaders

func WithRequestHeaders(ctx context.Context, headers map[string][]string) context.Context

func WithSecrets

func WithSecrets(ctx context.Context, secrets map[string]string) context.Context

Types

type EnvKeyContextType

type EnvKeyContextType string

type KeelEnv

type KeelEnv string
const (
	// The Test environment denotes any Keel environment that isn't production or staging. So this includes the
	// runtime inside of the Keel Test Framework runner, as well as the runtime locally (e.g 'keel run' in the CLI)
	KeelEnvTest       KeelEnv = "test"
	KeelEnvProduction KeelEnv = "production"
)

func GetEnv

func GetEnv(ctx context.Context) KeelEnv

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL