contextutil

package
v0.0.5-alpha1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrSelfNotFound must be used when self value is not found in the context
	ErrSelfNotFound = errors.Error("self value not found in the context")

	// ErrDIDMissingFromContext sentinel error when did is missing from the context.
	ErrDIDMissingFromContext = errors.Error("failed to extract did from context")
)

Variables

This section is empty.

Functions

func Account

func Account(ctx context.Context) (config.Account, error)

Account extracts the TenantConfig from the given context value

func AccountDID

func AccountDID(ctx context.Context) (identity.DID, error)

AccountDID extracts the AccountConfig DID from the given context value

func Context

func Context(ctx context.Context, cs config.Service) (context.Context, error)

Context updates a context with account info using the configstore, must only be used for api handlers

func Copy added in v1.0.0

func Copy(ctx context.Context) context.Context

Copy creates a copy of the given context with relevant values

func DIDFromContext added in v1.0.0

func DIDFromContext(ctx context.Context) (did identity.DID, err error)

DIDFromContext returns did from the context.

func Job

func Job(ctx context.Context) jobs.JobID

Job returns current jobID

func New

New creates new instance of the request headers.

func WithJob

func WithJob(ctx context.Context, jobID jobs.JobID) context.Context

WithJob returns a context with Job ID

Types

This section is empty.

Jump to

Keyboard shortcuts

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