config

package
v1.106.0-rc.16 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const AuthorizerTypeProperty = "authorizerType"

AuthorizerTypeProperty is the property where the id of an Authorizer should be placed in its custom MarshalJSON function

View Source
const Redacted = "REDACTED"

Variables

This section is empty.

Functions

func AuthorizerFromInterface

func AuthorizerFromInterface[T Authorizer](f any, authSelectFn AuthorizerSelectorFn[T]) (T, error)

AuthorizerFromInterface this generic function provides Authorizer unmarshalling for all providers

func GetInterfaceValue

func GetInterfaceValue[T any](fmap map[string]interface{}, key string) (T, error)

Types

type Authorizer

type Authorizer interface {
	Config
	json.Marshaler
}

type AuthorizerSelectorFn

type AuthorizerSelectorFn[T Authorizer] func(string) (T, error)

AuthorizerSelectorFn implementations of this function should be a simple switch and acts as a register for the Authorizer types, returned Authorizer should be empty except for its default type property and will have other values marshalled into it

type Config

type Config interface {
	Validate() error
	Sanitize() Config
	Equals(Config) bool
}

Config allows for nested configurations which encapsulate their functionality to be validated and compared easily

type KeyedConfig

type KeyedConfig interface {
	Config
	Key() string
}

KeyedConfig is a top level Config which uses its public values as a unique identifier allowing duplicates to be identified

type KeyedConfigWatcher

type KeyedConfigWatcher interface {
	GetConfigs() []KeyedConfig
}

Jump to

Keyboard shortcuts

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