client

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultModule = "_"
)

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 {
	Path          string
	Host          string
	BaseURL       *url.URL
	SecretKeyBase string // used when deploying the platform, unused when using API
	AdminToken    string
	APIToken      string
}

func NewConfig added in v0.4.0

func NewConfig(configPath string) (Config, error)

NewConfig creates a new funless config, reading the information from the given configPath

type FnHandler

type FnHandler interface {
	Invoke(ctx context.Context, fnName string, fnMod string, fnArgs map[string]interface{}) (pkg.IvkResult, 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{}) (pkg.IvkResult, 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) (pkg.SingleModule, 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) (pkg.ModuleNameList, error)
}

type ModService added in v0.3.0

type ModService struct {
	*Client
	InputValidatorHandler
}

func (*ModService) Create added in v0.3.0

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

func (*ModService) Delete added in v0.3.0

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

func (*ModService) Get added in v0.3.0

func (mod *ModService) Get(ctx context.Context, modName string) (pkg.SingleModule, error)

func (*ModService) List added in v0.3.0

func (mod *ModService) List(ctx context.Context) (pkg.ModuleNameList, error)

func (*ModService) Update added in v0.3.0

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

type UserHandler added in v0.4.0

type UserHandler interface {
	Create(ctx context.Context, name string) (pkg.UserNameToken, error)
	List(ctx context.Context) (pkg.UserNamesList, error)
}

type UserService added in v0.4.0

type UserService struct {
	*Client
}

func (*UserService) Create added in v0.4.0

func (u *UserService) Create(ctx context.Context, name string) (pkg.UserNameToken, error)

func (*UserService) List added in v0.4.0

Jump to

Keyboard shortcuts

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