faas-cli: github.com/openfaas/faas-cli/proxy Index | Files

package proxy

import "github.com/openfaas/faas-cli/proxy"

Index

Package Files

auth.go client.go delete.go deploy.go describe.go function_store.go invoke.go list.go logs.go namespaces.go proxy.go secret.go utils.go version.go

func FunctionStoreList Uses

func FunctionStoreList(store string) ([]v2.StoreFunction, error)

FunctionStoreList returns functions from a store URL

func InvokeFunction Uses

func InvokeFunction(gateway string, name string, bytesIn *[]byte, contentType string, query []string, headers []string, async bool, httpMethod string, tlsInsecure bool, namespace string) (*[]byte, error)

InvokeFunction a function

func MakeHTTPClient Uses

func MakeHTTPClient(timeout *time.Duration, tlsInsecure bool) http.Client

MakeHTTPClient makes a HTTP client with good defaults for timeouts.

type BasicAuth Uses

type BasicAuth struct {
    // contains filtered or unexported fields
}

BasicAuth basic authentication type

func (*BasicAuth) Set Uses

func (auth *BasicAuth) Set(req *http.Request) error

type BearerToken Uses

type BearerToken struct {
    // contains filtered or unexported fields
}

BearerToken bearer token

func (*BearerToken) Set Uses

func (c *BearerToken) Set(req *http.Request) error

type CLIAuth Uses

type CLIAuth struct {
    Username string
    Password string
    Token    string
}

CLIAuth auth struct for the CLI

type Client Uses

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 Uses

func NewClient(auth ClientAuth, gatewayURL string, transport http.RoundTripper, timeout *time.Duration) (*Client, error)

NewClient initializes a new API client

func (*Client) AddCheckRedirect Uses

func (c *Client) AddCheckRedirect(checkRedirect func(*http.Request, []*http.Request) error)

AddCheckRedirect add CheckRedirect to the client

func (*Client) CreateSecret Uses

func (c *Client) CreateSecret(ctx context.Context, secret types.Secret) (int, string)

CreateSecret create secret

func (*Client) DeleteFunction Uses

func (c *Client) DeleteFunction(ctx context.Context, functionName string, namespace string) error

DeleteFunction delete a function from the OpenFaaS server

func (*Client) DeployFunction Uses

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 Uses

func (c *Client) GetFunctionInfo(ctx context.Context, functionName string, namespace string) (types.FunctionStatus, error)

GetFunctionInfo get an OpenFaaS function information

func (*Client) GetLogs Uses

func (c *Client) GetLogs(ctx context.Context, params logs.Request) (<-chan logs.Message, error)

GetLogs return stream for the logs

func (*Client) GetSecretList Uses

func (c *Client) GetSecretList(ctx context.Context, namespace string) ([]types.Secret, error)

GetSecretList get secrets list

func (*Client) GetSystemInfo Uses

func (c *Client) GetSystemInfo(ctx context.Context) (map[string]interface{}, error)

GetSystemInfo get system information from /system/info endpoint

func (*Client) ListFunctions Uses

func (c *Client) ListFunctions(ctx context.Context, namespace string) ([]types.FunctionStatus, error)

ListFunctions list deployed functions

func (*Client) ListNamespaces Uses

func (c *Client) ListNamespaces(ctx context.Context) ([]string, error)

ListNamespaces lists available function namespaces

func (*Client) RemoveSecret Uses

func (c *Client) RemoveSecret(ctx context.Context, secret types.Secret) error

RemoveSecret remove a secret via the OpenFaaS API by name

func (*Client) UpdateSecret Uses

func (c *Client) UpdateSecret(ctx context.Context, secret types.Secret) (int, string)

UpdateSecret update a secret via the OpenFaaS API by name

type ClientAuth Uses

type ClientAuth interface {
    Set(req *http.Request) error
}

ClientAuth an interface for client authentication. to add authentication to the client implement this interface

func NewCLIAuth Uses

func NewCLIAuth(token string, gateway string) (ClientAuth, error)

NewCLIAuth returns a new CLI Auth

type DeployFunctionSpec Uses

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 Uses

type FunctionResourceRequest struct {
    Limits   *stack.FunctionResources
    Requests *stack.FunctionResources
}

FunctionResourceRequest defines a request to set function resources

type StoreResult Uses

type StoreResult struct {
    Version   string             `json:"version"`
    Functions []v2.StoreFunction `json:"functions"`
}

Package proxy imports 23 packages (graph) and is imported by 7 packages. Updated 2020-06-02. Refresh now. Tools for package owners.