fn

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Create

type Create struct {
	Name       string `arg:"" name:"name" help:"name of the function to create"`
	Namespace  string `name:"namespace" short:"n" default:"_" help:"namespace of the function to create"`
	SourceDir  string `name:"source-dir" short:"d" required:"" xor:"dir-file,dir-build" type:"existingdir" help:"path of the source directory"`
	SourceFile string `name:"source-file" short:"f" required:"" xor:"dir-file" type:"existingFile" help:"path of the source file"`
	OutDir     string `name:"out-dir" short:"o" xor:"out-build" type:"existingdir" help:"path where the compiled code file will be saved"`
	NoBuild    bool   `name:"no-build" short:"b" xor:"dir-build,out-build" help:"upload the file as-is, without building it"`
	Language   string `name:"language" short:"l" required:"" enum:"js,rust" help:"programming language of the function"`
}

func (*Create) Run

func (f *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:"" help:"run a function on an instance of the platform"`
	Create Create `cmd:"" help:"create a function and upload it to the platform"`
	Delete Delete `cmd:"" help:"delete an existing function from the platform"`
}

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

Jump to

Keyboard shortcuts

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