utility

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context, key ContextKey) (string, bool)

func Load

func Load(spec any) error

func NewContext

func NewContext(ctx context.Context, key ContextKey, value string) context.Context

Types

type ContextKey

type ContextKey string
const (
	TokenContextKey ContextKey = "bearer"
	UIDContextKey   ContextKey = "uid"
)

func (ContextKey) String added in v0.0.32

func (c ContextKey) String() string

type Deployments

type Deployments string
const (
	DeploymentsLocal Deployments = "local"
	DeploymentsDev   Deployments = "dev"
	DeploymentsProd  Deployments = "prod"
)

func ParseDeployments

func ParseDeployments(value string) Deployments

func (Deployments) IsProd added in v0.0.15

func (d Deployments) IsProd() bool

func (Deployments) String

func (d Deployments) String() string

type Tag added in v0.0.20

type Tag string
const WithOutTag Tag = "auth.disabled"

func (Tag) String added in v0.0.20

func (t Tag) String() string

type WithoutAuth added in v0.0.19

type WithoutAuth struct{}

WithoutAuth overrides the default auth behavior and allows all methods to be called without an access token.

func (*WithoutAuth) AuthFuncOverride added in v0.0.19

func (w *WithoutAuth) AuthFuncOverride(ctx context.Context, _ string) (context.Context, error)

AuthFuncOverride allows all methods to be unauthenticated.

Jump to

Keyboard shortcuts

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