client

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNamespace = "_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Config    Config
	ApiClient *openapi.APIClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient *http.Client, config Config) (*Client, error)

NewClient creates a new funless client with the provided http client and configuration.

type Config

type Config struct {
	Host      string
	Namespace string
	BaseURL   *url.URL
}

type FnHandler

type FnHandler interface {
	Invoke(ctx context.Context, fnName string, fnNamespace string, fnArgs map[string]interface{}) (openapi.FunctionInvocationSuccess, error)
	Create(ctx context.Context, fnName string, fnNamespace string, code *os.File, language string) (openapi.FunctionCreationSuccess, error)
	Delete(ctx context.Context, fnName string, fnNamespace string) (openapi.FunctionDeletionSuccess, error)
}

type FnService

type FnService struct {
	*Client
}

func (*FnService) Create

func (fn *FnService) Create(ctx context.Context, fnName string, fnNamespace string, code *os.File, language string) (openapi.FunctionCreationSuccess, error)

func (*FnService) Delete

func (fn *FnService) Delete(ctx context.Context, fnName string, fnNamespace string) (openapi.FunctionDeletionSuccess, error)

func (*FnService) Invoke

func (fn *FnService) Invoke(ctx context.Context, fnName string, fnNamespace string, fnArgs map[string]interface{}) (openapi.FunctionInvocationSuccess, error)

Jump to

Keyboard shortcuts

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