warp10

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ElapsedHeader      = "X-Warp10-Elapsed"
	ErrorsLineHeader   = "X-Warp10-Error-Line"
	ErrorMessageHeader = "X-Warp10-Error-Message"
	FetchedHeader      = "X-Warp10-Fetched"
	OpsHeader          = "X-Warp10-Ops"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	Endpoint   string `json:"endpoint"`
	WarpScript string `json:"warpscript"`
}

func NewRequest

func NewRequest(endpoint, warpscript string) Request

func (Request) Exec

func (req Request) Exec(ctx context.Context) *Response

Exec execute the given WarpScript

type Response

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

func Exec

func Exec(ctx context.Context, request Request) *Response

Exec execute the given WarpScript

func (Response) Elapsed

func (res Response) Elapsed() time.Duration

func (Response) Error

func (res Response) Error() error

func (Response) Fetched

func (res Response) Fetched() int64

func (Response) IsErrored

func (res Response) IsErrored() bool

func (Response) Ops

func (res Response) Ops() int64

func (Response) StackRaw

func (res Response) StackRaw() []byte

func (Response) StackRawString

func (res Response) StackRawString() string

func (Response) StackSlice

func (res Response) StackSlice() []interface{}

func (Response) StackUnmarshal

func (res Response) StackUnmarshal(i interface{}) error

type ResponseError

type ResponseError struct {
	Message string
	Line    int64
}

func (ResponseError) Error

func (err ResponseError) Error() string

Jump to

Keyboard shortcuts

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