fn

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: 16 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) Help added in v0.4.0

func (c *Build) Help() string

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"`
	Module   string `short:"m" default:"_" help:"Module of the function to create"`
	Language string `short:"l" required:"" enum:"rust,js" help:"Programming language of the function"`
}

func (*Create) Help added in v0.4.0

func (c *Create) Help() string

func (*Create) Run

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

type Delete

type Delete struct {
	Name   string `arg:"" name:"name" help:"Name of the function to delete"`
	Module string `name:"module" short:"m" default:"_" help:"Module of the function to delete"`
}

func (*Delete) Help added in v0.4.0

func (c *Delete) Help() string

func (*Delete) Run

func (f *Delete) Run(ctx context.Context, fnHandler client.FnHandler, logger log.FLogger, parent *Fn) 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"`

	Host string `short:"H" help:"API host/port of the platform (no protocol)"`
}

type Invoke

type Invoke struct {
	Name     string            `arg:"" name:"name" help:"Name of the function to invoke"`
	Module   string            `name:"module" short:"m" default:"_" help:"Module 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) Help added in v0.4.0

func (c *Invoke) Help() string

func (*Invoke) Run

func (f *Invoke) Run(ctx context.Context, fnHandler client.FnHandler, logger log.FLogger, parent *Fn) 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) Help added in v0.4.0

func (n *New) Help() string

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"`
	Module string `short:"m" default:"_" help:"The module of the function"`
}

func (*Upload) Help added in v0.4.0

func (c *Upload) Help() string

func (*Upload) Run added in v0.3.0

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

Jump to

Keyboard shortcuts

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