fn

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Build added in v0.3.0

type Build struct {
	Name        string `arg:"" help:"the name of the function"`
	Source      string `arg:"" type:"existingdir" help:"path of the source directory"`
	Destination string `short:"d" type:"path" help:"path where the compiled wasm file will be saved" default:"."`
	Language    string `short:"l" enum:"rust,js" required:"" help:"programming language of the function"`
}

func (*Build) Run added in v0.3.0

func (b *Build) Run(ctx context.Context, builder build.DockerBuilder, logger log.FLogger) error

type Create

type Create struct {
	Name      string `arg:"" help:"name of the function to create"`
	Source    string `arg:"" type:"existingdir" help:"path of the source directory"`
	Namespace string `short:"n" default:"_" help:"namespace of the function to create"`
	Language  string `short:"l" required:"" enum:"rust,js" help:"programming language of the function"`
}

func (*Create) Run

func (c *Create) Run(ctx context.Context, builder build.DockerBuilder, fnHandler client.FnHandler, logger log.FLogger) error

type Delete

type Delete struct {
	Name      string `arg:"" name:"name" help:"name of the function to delete"`
	Namespace string `name:"namespace" short:"n" default:"_" help:"namespace of the function to delete"`
}

func (*Delete) Run

func (f *Delete) Run(ctx context.Context, fnHandler client.FnHandler, logger log.FLogger) error

type Fn

type Fn struct {
	Invoke Invoke `cmd:"" aliases:"i" help:"invoke a function"`
	Create Create `cmd:"" aliases:"c" help:"a combination of build and upload to create a function"`
	Delete Delete `cmd:"" aliases:"d" help:"delete an existing function"`
	Build  Build  `cmd:"" aliases:"b" help:"compile a function into a wasm binary"`
	Upload Upload `cmd:"" aliases:"up" help:"create functions by uploading wasm binaries"`
	New    New    `cmd:"" aliases:"n" help:"create a new function from a template"`
}

func (*Fn) Help added in v0.3.0

func (f *Fn) Help() string

type FnError added in v0.2.0

type FnError struct {
	Errors struct {
		Detail string `json:"detail"`
	} `json:"errors"`
}

type Invoke

type Invoke struct {
	Name      string            `arg:"" name:"name" help:"name of the function to invoke"`
	Namespace string            `name:"namespace" short:"n" default:"_" help:"namespace of the function to invoke"`
	Args      map[string]string `name:"args" short:"a" help:"arguments of the function to invoke" xor:"args"`
	JsonArgs  string            `name:"json" short:"j" help:"json encoded arguments of the function to invoke; overrides args" xor:"args"`
}

func (*Invoke) Run

func (f *Invoke) Run(ctx context.Context, fnHandler client.FnHandler, logger log.FLogger) error

type New added in v0.3.0

type New struct {
	Name        string `arg:"" help:"the name of the function"`
	Language    string `name:"lang" short:"l" required:"" enum:"rust, js" help:"the language of the function"`
	TemplateDir string `short:"t" type:"path" default:"." help:"the directory where the template are located"`
	OutDir      string `short:"o" type:"path" default:"." help:"the directory where the function will be created"`
}

func (*New) Run added in v0.3.0

func (n *New) Run(ctx context.Context, logger log.FLogger) error

type Upload added in v0.3.0

type Upload struct {
	Name      string `arg:"" help:"the name of the function"`
	Source    string `arg:"" type:"existingfile" help:"path of the wasm binary"`
	Namespace string `short:"n" default:"_" help:"the namespace of the function"`
}

func (*Upload) Run added in v0.3.0

func (u *Upload) Run(ctx context.Context, fnHandler client.FnHandler, logger log.FLogger) error

Jump to

Keyboard shortcuts

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