runtimectx

package
v0.395.7 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: AGPL-3.0 Imports: 9 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 GetStorage added in v0.388.0

func GetStorage(ctx context.Context) (storage.Storer, error)

GetStorage will return the Storer service from the context

func HasStorage added in v0.388.0

func HasStorage(ctx context.Context) bool

HasStorage checks if the context has a Storer service

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

func WithStorage added in v0.388.0

func WithStorage(ctx context.Context, svc storage.Storer) context.Context

WithStorage adds the given storage service to the 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