context

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendGCloudTokenToOutgoingContext

func AppendGCloudTokenToOutgoingContext(
	ctx context.Context, gcloudToken string,
) context.Context

AppendGCloudTokenToOutgoingContext appends the GCloud token to the outgoing context

func ExtractErrorFromStatus

func ExtractErrorFromStatus(flag *commonflag.ModeFlag, err error) error

ExtractErrorFromStatus extracts the error from the status

func GetCtxWithMetadata

func GetCtxWithMetadata(
	ctxMetadata *CtxMetadata, ctx context.Context,
) context.Context

GetCtxWithMetadata gets the context with the metadata

func GetOutgoingCtx

func GetOutgoingCtx(ctx context.Context) (context.Context, error)

GetOutgoingCtx returns a context with the token string

Types

type CtxMetadata

type CtxMetadata struct {
	MetadataFields []MetadataField
}

CtxMetadata is the metadata for the context

func NewAuthenticatedCtxMetadata

func NewAuthenticatedCtxMetadata(
	gcloudToken string, jwtToken string,
) *CtxMetadata

NewAuthenticatedCtxMetadata creates a new authenticated CtxMetadata

func NewCtxMetadata

func NewCtxMetadata(metadataFields map[string]string) *CtxMetadata

NewCtxMetadata creates a new CtxMetadata

func NewUnauthenticatedCtxMetadata

func NewUnauthenticatedCtxMetadata(gcloudToken string) *CtxMetadata

NewUnauthenticatedCtxMetadata creates a new unauthenticated CtxMetadata

type MetadataField

type MetadataField struct {
	Key   string
	Value string
}

MetadataField is a field in the metadata

Jump to

Keyboard shortcuts

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