envcontext

package
v0.0.0-...-4308112 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CredentialKeyGetter

type CredentialKeyGetter func() (credential.Key, error)

CredentialKeyGetter is a function which returns a credential key.

type InvalidateCredentialFunc

type InvalidateCredentialFunc func(ctx context.Context, key credential.Key, reason string) error

InvalidateCredentialFunc records a credential with the given key as being invalid.

type ModelCredentialInvalidator

type ModelCredentialInvalidator interface {
	// InvalidateModelCredential invalidate cloud credential for the model.
	InvalidateModelCredential(context.Context, string) error
}

ModelCredentialInvalidator defines a point of use interface for invalidating a model credential.

func NewCredentialInvalidator

func NewCredentialInvalidator(
	keyGetter CredentialKeyGetter,
	invalidateFunc InvalidateCredentialFunc,
	legacyInvalidateFunc func(reason string) error,
) ModelCredentialInvalidator

NewCredentialInvalidator creates a credential validator with callbacks which update dqlite and mongo.

type ModelCredentialInvalidatorFunc

type ModelCredentialInvalidatorFunc func(ctx context.Context, reason string) error

ModelCredentialInvalidatorFunc records a credential as being invalid.

type ModelCredentialInvalidatorGetter

type ModelCredentialInvalidatorGetter func() (ModelCredentialInvalidatorFunc, error)

ModelCredentialInvalidatorGetter returns a function which records a credential as being invalid.

type ProviderCallContext

type ProviderCallContext struct {
	context.Context
	// contains filtered or unexported fields
}

ProviderCallContext wraps a standard context and is used in provider api calls.

func WithCredentialInvalidator

func WithCredentialInvalidator(ctx context.Context, invalidationFunc ModelCredentialInvalidatorFunc) ProviderCallContext

WithCredentialInvalidator returns a ProviderCallContext with the specified credential invalidation callback.

func WithoutCredentialInvalidator

func WithoutCredentialInvalidator(ctx context.Context) ProviderCallContext

WithoutCredentialInvalidator returns a ProviderCallContext without any credential invalidation callback.

func (ProviderCallContext) InvalidateCredential

func (ctx ProviderCallContext) InvalidateCredential(reason string) error

InvalidateCredential invalidates a credential with a reason.

Jump to

Keyboard shortcuts

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