golang

package
v1.18.6 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InitRxTmpl []byte
View Source
var InitTestTmpl []byte
View Source
var InitTmpl []byte
View Source
var MainFuncRxTmpl []byte

MainFuncRxTmpl the rxstream serverless of the main function template

View Source
var MainFuncTmpl []byte

MainFuncTmpl the raw bytes serverless of the main function template

View Source
var PartialsTmpl []byte

PartialsTmpl partials template, used for rendering the partials

View Source
var WasmMainFuncTmpl []byte

Functions

func RenderTmpl

func RenderTmpl(tpl string, ctx *Context) ([]byte, error)

RenderTmpl renders the template with the given context

Types

type AppOpts added in v1.18.5

type AppOpts struct {
	WithInit         bool
	WithWantedTarget bool
	WithDescription  bool
	WithInputSchema  bool
}

func ParseSrc added in v1.18.5

func ParseSrc(appFile string) (*AppOpts, error)

ParseSrc parse app option from source code to run serverless

type Context

type Context struct {
	// Name of the servcie
	Name string
	// ZipperAddrs is the address of the zipper server
	ZipperAddr string
	// Client credential
	Credential string
	// use environment variables
	UseEnv bool
	// WithInitFunc determines whether to work with init function
	WithInitFunc bool
	// WithWantedTarget determines whether to work with SetWantedTarget
	WithWantedTarget bool
}

Context defines context for the template

type GolangServerless

type GolangServerless struct {
	// contains filtered or unexported fields
}

GolangServerless defines golang implementation of Serverless interface.

func (*GolangServerless) Build

func (s *GolangServerless) Build(clean bool) error

Build compiles the serverless to executable

func (*GolangServerless) Executable

func (s *GolangServerless) Executable() bool

func (*GolangServerless) Init

func (s *GolangServerless) Init(opts *serverless.Options) error

Init initializes the serverless

func (*GolangServerless) Run

func (s *GolangServerless) Run(verbose bool) error

Run compiles and runs the serverless

Jump to

Keyboard shortcuts

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