client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 8 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
	BaseURL *url.URL
}

type FnHandler

type FnHandler interface {
	Invoke(ctx context.Context, fnName string, fnMod string, fnArgs map[string]interface{}) (openapi.InvokeResult, error)
	Create(ctx context.Context, fnName string, fnMod string, code *os.File) error
	Delete(ctx context.Context, fnName string, fnMod string) error
	Update(ctx context.Context, fnName string, fnMod string, code *os.File, newName string) error
}

type FnService

type FnService struct {
	*Client
	InputValidatorHandler
}

func (*FnService) Create

func (fn *FnService) Create(ctx context.Context, fnName string, fnMod string, code *os.File) error

func (*FnService) Delete

func (fn *FnService) Delete(ctx context.Context, fnName string, fnMod string) error

func (*FnService) Invoke

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

func (*FnService) Update added in v0.3.0

func (fn *FnService) Update(ctx context.Context, fnName string, fnMod string, code *os.File, newName string) error

type InputValidator added in v0.3.0

type InputValidator struct{}

func (*InputValidator) ValidateName added in v0.3.0

func (i *InputValidator) ValidateName(name, entity string) error

type InputValidatorHandler added in v0.3.0

type InputValidatorHandler interface {
	ValidateName(name, entity string) error
}

type ModHandler added in v0.3.0

type ModHandler interface {
	Get(ctx context.Context, modName string) (openapi.SingleModuleResult, error)
	Create(ctx context.Context, modName string) error
	Delete(ctx context.Context, modName string) error
	Update(ctx context.Context, modName string, newName string) error
	List(ctx context.Context) (openapi.ModuleNamesResult, error)
}

type ModService added in v0.3.0

type ModService struct {
	*Client
	InputValidatorHandler
}

func (*ModService) Create added in v0.3.0

func (fn *ModService) Create(ctx context.Context, modName string) error

func (*ModService) Delete added in v0.3.0

func (fn *ModService) Delete(ctx context.Context, modName string) error

func (*ModService) Get added in v0.3.0

func (fn *ModService) Get(ctx context.Context, modName string) (openapi.SingleModuleResult, error)

func (*ModService) List added in v0.3.0

func (*ModService) Update added in v0.3.0

func (fn *ModService) Update(ctx context.Context, modName string, newName string) error

Jump to

Keyboard shortcuts

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