Documentation ¶
Index ¶
- func FunctionStoreList(store string) ([]v2.StoreFunction, error)
- func InvokeFunction(gateway string, name string, bytesIn *[]byte, contentType string, ...) (*[]byte, error)
- func MakeHTTPClient(timeout *time.Duration, tlsInsecure bool) http.Client
- type BasicAuth
- type BearerToken
- type CLIAuth
- type Client
- func (c *Client) AddCheckRedirect(checkRedirect func(*http.Request, []*http.Request) error)
- func (c *Client) CreateSecret(ctx context.Context, secret types.Secret) (int, string)
- func (c *Client) DeleteFunction(ctx context.Context, functionName string, namespace string) error
- func (c *Client) DeployFunction(context context.Context, spec *DeployFunctionSpec) int
- func (c *Client) GetFunctionInfo(ctx context.Context, functionName string, namespace string) (types.FunctionStatus, error)
- func (c *Client) GetLogs(ctx context.Context, params logs.Request) (<-chan logs.Message, error)
- func (c *Client) GetSecretList(ctx context.Context, namespace string) ([]types.Secret, error)
- func (c *Client) GetSystemInfo(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) ListFunctions(ctx context.Context, namespace string) ([]types.FunctionStatus, error)
- func (c *Client) ListNamespaces(ctx context.Context) ([]string, error)
- func (c *Client) RemoveSecret(ctx context.Context, secret types.Secret) error
- func (c *Client) ScaleFunction(ctx context.Context, functionName, namespace string, replicas uint64) error
- func (c *Client) UpdateSecret(ctx context.Context, secret types.Secret) (int, string)
- type ClientAuth
- type DeployFunctionSpec
- type FunctionResourceRequest
- type StoreResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FunctionStoreList ¶
func FunctionStoreList(store string) ([]v2.StoreFunction, error)
FunctionStoreList returns functions from a store URL
Types ¶
type BasicAuth ¶
type BasicAuth struct {
// contains filtered or unexported fields
}
BasicAuth basic authentication type
type BearerToken ¶
type BearerToken struct {
// contains filtered or unexported fields
}
BearerToken bearer token
type Client ¶
type Client struct { //ClientAuth a type implementing ClientAuth interface for client authentication ClientAuth ClientAuth //GatewayURL base URL of OpenFaaS gateway GatewayURL *url.URL //UserAgent user agent for the client UserAgent string // contains filtered or unexported fields }
Client an API client to perform all operations
func NewClient ¶
func NewClient(auth ClientAuth, gatewayURL string, transport http.RoundTripper, timeout *time.Duration) (*Client, error)
NewClient initializes a new API client
func (*Client) AddCheckRedirect ¶
AddCheckRedirect add CheckRedirect to the client
func (*Client) CreateSecret ¶
CreateSecret create secret
func (*Client) DeleteFunction ¶
DeleteFunction delete a function from the OpenFaaS server
func (*Client) DeployFunction ¶
func (c *Client) DeployFunction(context context.Context, spec *DeployFunctionSpec) int
DeployFunction first tries to deploy a function and if it exists will then attempt a rolling update. Warnings are suppressed for the second API call (if required.)
func (*Client) GetFunctionInfo ¶
func (c *Client) GetFunctionInfo(ctx context.Context, functionName string, namespace string) (types.FunctionStatus, error)
GetFunctionInfo get an OpenFaaS function information
func (*Client) GetSecretList ¶
GetSecretList get secrets list
func (*Client) GetSystemInfo ¶
GetSystemInfo get system information from /system/info endpoint
func (*Client) ListFunctions ¶
func (c *Client) ListFunctions(ctx context.Context, namespace string) ([]types.FunctionStatus, error)
ListFunctions list deployed functions
func (*Client) ListNamespaces ¶
ListNamespaces lists available function namespaces
func (*Client) RemoveSecret ¶
RemoveSecret remove a secret via the OpenFaaS API by name
type ClientAuth ¶
ClientAuth an interface for client authentication. to add authentication to the client implement this interface
func NewCLIAuth ¶
func NewCLIAuth(token string, gateway string) (ClientAuth, error)
NewCLIAuth returns a new CLI Auth
type DeployFunctionSpec ¶
type DeployFunctionSpec struct { FProcess string FunctionName string Image string RegistryAuth string Language string Replace bool EnvVars map[string]string Network string Constraints []string Update bool Secrets []string Labels map[string]string Annotations map[string]string FunctionResourceRequest FunctionResourceRequest ReadOnlyRootFilesystem bool TLSInsecure bool Token string Namespace string }
DeployFunctionSpec defines the spec used when deploying a function
type FunctionResourceRequest ¶
type FunctionResourceRequest struct { Limits *stack.FunctionResources Requests *stack.FunctionResources }
FunctionResourceRequest defines a request to set function resources
type StoreResult ¶
type StoreResult struct { Version string `json:"version"` Functions []v2.StoreFunction `json:"functions"` }