Documentation ¶
Index ¶
- Constants
- func CanonicalFnAPIUrl(urlStr string) (*url.URL, error)
- func GetRequestID(ctx context.Context) string
- func WithRequestID(ctx context.Context, requestID string) context.Context
- type ConfigSource
- type FnResourceType
- type NopPassPhraseSource
- type PassPhraseSource
- type Provider
- type ProviderFunc
- type Providers
- type TerminalPassPhraseSource
Constants ¶
const ( //CfgFnAPIURL is a config key used as the default URL for resolving the API server - different providers may generate URLs in their own way CfgFnAPIURL = "api-url" CfgFnToken = "token" )
Variables ¶
This section is empty.
Functions ¶
func CanonicalFnAPIUrl ¶
CanonicalFnAPIUrl canonicalises an *FN_API_URL to a default value
func GetRequestID ¶
GetRequestID returns the request-id from the context
Types ¶
type ConfigSource ¶
ConfigSource abstracts loading configuration keys from an underlying configuration system such as Viper
func NewConfigSourceFromMap ¶
func NewConfigSourceFromMap(m map[string]string) ConfigSource
NewConfigSourceFromMap creates a config source from a map of literal string
type FnResourceType ¶
type FnResourceType string
const ( ApplicationResourceType FnResourceType = "app" FunctionResourceType FnResourceType = "function" TriggerResourceType FnResourceType = "trigger" )
func (FnResourceType) String ¶
func (t FnResourceType) String() string
type NopPassPhraseSource ¶
type NopPassPhraseSource struct{}
NopPassPhraseSource always returns an error when request for a passphrase
func (*NopPassPhraseSource) ChallengeForPassPhrase ¶
func (*NopPassPhraseSource) ChallengeForPassPhrase(id, msg string) (string, error)
type PassPhraseSource ¶
type PassPhraseSource interface { //ChallengeForPassPhrase requests a passphrase with a given prompt from the user ChallengeForPassPhrase(id, prompt string) (string, error) }
PassPhraseSource provides a passphrase from an external source (e.g. a user prompt or a terminal)
type Provider ¶
type Provider interface { APIClientv2() *clientv2.Fn // APIURL returns the current API URL base to use with this provider APIURL() *url.URL // Returns a list of resource types that are not supported by this provider VersionClient() *version.Client // WrapCallTransport adds any request signing or auth to an existing round tripper for calls WrapCallTransport(http.RoundTripper) http.RoundTripper }
Provider creates API clients for Fn calls adding any required middleware
type ProviderFunc ¶
type ProviderFunc func(config ConfigSource, source PassPhraseSource) (Provider, error)
ProviderFunc constructs a provider
type Providers ¶
type Providers struct {
Providers map[string]ProviderFunc
}
Providers describes a set of providers
func (*Providers) ProviderFromConfig ¶
func (c *Providers) ProviderFromConfig(id string, source ConfigSource, phraseSource PassPhraseSource) (Provider, error)
ProviderFromConfig returns the provider corresponding to a given identifier populated with configuration from source - if a passphrase is required then it is request from phraseSource
func (*Providers) Register ¶
func (c *Providers) Register(name string, pf ProviderFunc)
Register adds a named provider to a configuration
type TerminalPassPhraseSource ¶
type TerminalPassPhraseSource struct{}
TerminalPassPhraseSource requests a passphrase from the terminal
func (*TerminalPassPhraseSource) ChallengeForPassPhrase ¶
func (*TerminalPassPhraseSource) ChallengeForPassPhrase(id, msg string) (string, error)
Directories ¶
Path | Synopsis |
---|---|
shim/client
Package client is a generated GoMock package.
|
Package client is a generated GoMock package. |