Documentation ¶
Overview ¶
guest wasm application programming interface for guest module
Package guest is the wasm application programming interface for guest module
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DataTags set handler observed data tags DataTags func() []uint32 = func() []uint32 { return []uint32{0} } // Handler is the handler function for guest Handler func(ctx serverless.Context) = func(serverless.Context) {} // Init is the init function for guest Init func() error = func() error { return nil } )
View Source
var ( // ReadBuf is a buffer used to read data from the host. ReadBuf = make([]byte, ReadBufSize) // ReadBufPtr is a pointer to ReadBuf. ReadBufPtr = uintptr(unsafe.Pointer(&ReadBuf[0])) // ReadBufSize is the size of ReadBuf ReadBufSize = uint32(2048) )
Functions ¶
func ContextData ¶
ContextData returns the data of the context
Types ¶
type GuestContext ¶
type GuestContext struct{}
GuestContext is the context for guest
func (*GuestContext) Data ¶
func (c *GuestContext) Data() []byte
Data returns the data of the context
func (*GuestContext) HTTP ¶ added in v1.13.1
func (c *GuestContext) HTTP() serverless.HTTP
HTTP is the interface for HTTP request, but it is not implemented in the server side
type GuestHTTP ¶ added in v1.13.1
type GuestHTTP struct{}
GuestHTTP is the http client for guest
func (*GuestHTTP) Get ¶ added in v1.13.1
func (g *GuestHTTP) Get(url string) (*serverless.HTTPResponse, error)
Get send http GET request and return http response
func (*GuestHTTP) Post ¶ added in v1.13.1
func (g *GuestHTTP) Post( url string, contentType string, body []byte, ) (*serverless.HTTPResponse, error)
Post send http POST request and return http response
func (*GuestHTTP) Send ¶ added in v1.13.1
func (g *GuestHTTP) Send(req *serverless.HTTPRequest) (*serverless.HTTPResponse, error)
Send send http request and return http response
Click to show internal directories.
Click to hide internal directories.