Help us shape the future of Go! Take the 2026 Go Developer Survey

sdk

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 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 ExecutionContext

type ExecutionContext struct {
	HTTPRequest *HTTPRequest

	Workspace *entities.Workspace
	Source    *entities.Source
	Event     *entities.Event
}

type ExecutionResult

type ExecutionResult struct {
	ReturnValue  interface{}
	HTTPResponse *HTTPResponse
}

type HTTPRequest

type HTTPRequest struct {
	R    *http.Request
	Body []byte
}

type HTTPResponse

type HTTPResponse struct {
	Code    int
	Headers map[string]string
	Body    string
}

type LogSDK

type LogSDK struct{}

func NewLogSDK

func NewLogSDK() *LogSDK

func (*LogSDK) Debug

func (m *LogSDK) Debug(message string)

func (*LogSDK) Error

func (m *LogSDK) Error(message string)

func (*LogSDK) Info

func (m *LogSDK) Info(message string)

func (*LogSDK) Warn

func (m *LogSDK) Warn(message string)

type Options

type Options struct {
	VM      *goja.Runtime
	Context *ExecutionContext
	Result  *ExecutionResult
}

type RequestSDK

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

func NewRequestSDK

func NewRequestSDK(opts *Options) *RequestSDK

func (*RequestSDK) GetBody

func (sdk *RequestSDK) GetBody() string

func (*RequestSDK) GetHeader

func (sdk *RequestSDK) GetHeader(call goja.FunctionCall) goja.Value

func (*RequestSDK) GetHeaders

func (sdk *RequestSDK) GetHeaders() map[string]string

func (*RequestSDK) GetHost

func (sdk *RequestSDK) GetHost() string

func (*RequestSDK) GetMethod

func (sdk *RequestSDK) GetMethod() string

func (*RequestSDK) GetPath

func (sdk *RequestSDK) GetPath() string

func (*RequestSDK) SetBody

func (sdk *RequestSDK) SetBody(body string)

type ResponseSDK

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

func NewResponseSDK

func NewResponseSDK(opts *Options) *ResponseSDK

func (*ResponseSDK) Exit

func (sdk *ResponseSDK) Exit(status int, headers map[string]string, body interface{})

type SDK

type SDK struct {
	Request  *RequestSDK  `json:"request"`
	Response *ResponseSDK `json:"response"`
	Utils    *UtilsSDK    `json:"utils"`
	Log      *LogSDK      `json:"log"`
	// contains filtered or unexported fields
}

func NewSDK

func NewSDK(opts *Options) *SDK

type UtilsSDK

type UtilsSDK struct{}

func NewUtilsSDK

func NewUtilsSDK() *UtilsSDK

func (*UtilsSDK) Encode

func (sdk *UtilsSDK) Encode(encoding string, data []byte) string

func (*UtilsSDK) Hmac

func (sdk *UtilsSDK) Hmac(algorithm string, key string, data string) []byte

func (*UtilsSDK) TimingSafeEqual

func (sdk *UtilsSDK) TimingSafeEqual(str1 string, str2 string) bool

Jump to

Keyboard shortcuts

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