api

package
v0.0.0-...-9ccd474 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KnownModuleSource = "sha256"
	KnownModuleHash   = crypto.SHA256
)
View Source
const (
	StateRunning    = pb.State_RUNNING
	StateSuspended  = pb.State_SUSPENDED
	StateHalted     = pb.State_HALTED
	StateTerminated = pb.State_TERMINATED
	StateKilled     = pb.State_KILLED
)
View Source
const (
	CauseNormal                        = pb.Cause_NORMAL
	CauseUnreachable                   = pb.Cause_UNREACHABLE
	CauseCallStackExhausted            = pb.Cause_CALL_STACK_EXHAUSTED
	CauseMemoryAccessOutOfBounds       = pb.Cause_MEMORY_ACCESS_OUT_OF_BOUNDS
	CauseIndirectCallIndexOutOfBounds  = pb.Cause_INDIRECT_CALL_INDEX_OUT_OF_BOUNDS
	CauseIndirectCallSignatureMismatch = pb.Cause_INDIRECT_CALL_SIGNATURE_MISMATCH
	CauseIntegerDivideByZero           = pb.Cause_INTEGER_DIVIDE_BY_ZERO
	CauseIntegerOverflow               = pb.Cause_INTEGER_OVERFLOW
	CauseBreakpoint                    = pb.Cause_BREAKPOINT
	CauseABIDeficiency                 = pb.Cause_ABI_DEFICIENCY
	CauseABIViolation                  = pb.Cause_ABI_VIOLATION
	CauseInternal                      = pb.Cause_INTERNAL
)
View Source
const (
	DebugOpConfigGet        = pb.DebugOp_CONFIG_GET
	DebugOpConfigSet        = pb.DebugOp_CONFIG_SET
	DebugOpConfigUnion      = pb.DebugOp_CONFIG_UNION
	DebugOpConfigComplement = pb.DebugOp_CONFIG_COMPLEMENT
	DebugOpReadGlobals      = pb.DebugOp_READ_GLOBALS
	DebugOpReadMemory       = pb.DebugOp_READ_MEMORY
	DebugOpReadStack        = pb.DebugOp_READ_STACK
)
View Source
const (
	OpModuleList       = pb.Op_MODULE_LIST
	OpModuleInfo       = pb.Op_MODULE_INFO
	OpModuleDownload   = pb.Op_MODULE_DOWNLOAD
	OpModuleUpload     = pb.Op_MODULE_UPLOAD
	OpModuleSource     = pb.Op_MODULE_SOURCE
	OpModulePin        = pb.Op_MODULE_PIN
	OpModuleUnpin      = pb.Op_MODULE_UNPIN
	OpCallExtant       = pb.Op_CALL_EXTANT
	OpCallUpload       = pb.Op_CALL_UPLOAD
	OpCallSource       = pb.Op_CALL_SOURCE
	OpLaunchExtant     = pb.Op_LAUNCH_EXTANT
	OpLaunchUpload     = pb.Op_LAUNCH_UPLOAD
	OpLaunchSource     = pb.Op_LAUNCH_SOURCE
	OpInstanceList     = pb.Op_INSTANCE_LIST
	OpInstanceInfo     = pb.Op_INSTANCE_INFO
	OpInstanceConnect  = pb.Op_INSTANCE_CONNECT
	OpInstanceWait     = pb.Op_INSTANCE_WAIT
	OpInstanceKill     = pb.Op_INSTANCE_KILL
	OpInstanceSuspend  = pb.Op_INSTANCE_SUSPEND
	OpInstanceResume   = pb.Op_INSTANCE_RESUME
	OpInstanceSnapshot = pb.Op_INSTANCE_SNAPSHOT
	OpInstanceDelete   = pb.Op_INSTANCE_DELETE
	OpInstanceUpdate   = pb.Op_INSTANCE_UPDATE
	OpInstanceDebug    = pb.Op_INSTANCE_DEBUG
)

Server operation types. Returned by ContextOp(context.Context) function.

Variables

This section is empty.

Functions

func ContextWithAddress

func ContextWithAddress(ctx context.Context, addr string) context.Context

func ContextWithIface

func ContextWithIface(ctx context.Context, iface Iface) context.Context

func ContextWithMeta

func ContextWithMeta(ctx context.Context, m *Meta) (context.Context, error)

func ContextWithOp

func ContextWithOp(ctx context.Context, op Op) context.Context

func ContextWithRequest

func ContextWithRequest(ctx context.Context, req uint64) context.Context

func EncodeKnownModule

func EncodeKnownModule(hashSum []byte) string

func PublicErrorString

func PublicErrorString(err error, alternative string) string

PublicErrorString returns err.PublicError() if err is public. Otherwise the alternative is returned.

Types

type Cause

type Cause = pb.Cause

type DebugConfig

type DebugConfig = pb.DebugConfig

type DebugRequest

type DebugRequest = pb.DebugRequest

type DebugResponse

type DebugResponse = pb.DebugResponse

type Features

type Features = pb.Features

type FunctionNotFound

type FunctionNotFound interface {
	NotFound
	FunctionNotFound() bool
}

FunctionNotFound error.

func AsFunctionNotFound

func AsFunctionNotFound(err error) FunctionNotFound

AsFunctionNotFound returns the error if it is an existence error (FunctionNotFound method returns true).

type Iface

type Iface = pb.Iface

type Instance

type Instance interface {
	Connect(context.Context, io.Reader, io.WriteCloser) error
	ID() string
	Kill(context.Context) error
	Status(context.Context) *Status
	Suspend(context.Context) error
	Wait(context.Context) *Status
}

type InstanceInfo

type InstanceInfo = pb.InstanceInfo

type InstanceNotFound

type InstanceNotFound interface {
	NotFound
	InstanceNotFound() bool
}

InstanceNotFound error.

func AsInstanceNotFound

func AsInstanceNotFound(err error) InstanceNotFound

AsInstanceNotFound returns the error if it is an existence error (InstanceNotFound method returns true).

type InstanceUpdate

type InstanceUpdate = pb.InstanceUpdate

type Instances

type Instances = pb.Instances

type InvokeOptions

type InvokeOptions = pb.InvokeOptions

type LaunchOptions

type LaunchOptions = pb.LaunchOptions

type Meta

type Meta = pb.Meta

func ContextMeta

func ContextMeta(ctx context.Context) *Meta

type ModuleInfo

type ModuleInfo = pb.ModuleInfo

type ModuleNotFound

type ModuleNotFound interface {
	NotFound
	ModuleNotFound() bool
}

ModuleNotFound error.

func AsModuleNotFound

func AsModuleNotFound(err error) ModuleNotFound

AsModuleNotFound returns the error if it is an existence error (ModuleNotFound method returns true).

type ModuleOptions

type ModuleOptions = pb.ModuleOptions

type ModuleUpload

type ModuleUpload struct {
	Stream io.ReadCloser
	Length int64
	Hash   string
}

ModuleUpload parameters. Server may take possession of Stream; Close must be called in case it remains non-nil.

func (*ModuleUpload) Close

func (opts *ModuleUpload) Close() error

Close the stream unless it has been appropriated.

func (*ModuleUpload) TakeStream

func (opt *ModuleUpload) TakeStream() io.ReadCloser

TakeStream removes Stream from ModuleUpload.

type Modules

type Modules = pb.Modules

type NotFound

type NotFound interface {
	PublicError
	NotFound() bool
}

NotFound error.

func AsNotFound

func AsNotFound(err error) NotFound

AsNotFound returns the error if it is an existence error (NotFound method returns true).

type Op

type Op = pb.Op

func ContextOp

func ContextOp(ctx context.Context) (op Op)

ContextOp returns the server operation type.

type PermissionDenied

type PermissionDenied interface {
	PublicError
	PermissionDenied() bool
}

PermissionDenied error. The client is denied access to a resource.

func AsPermissionDenied

func AsPermissionDenied(err error) PermissionDenied

AsPermissionDenied returns the error if it is an authorization error (PermissionDenied method returns true).

type PublicError

type PublicError interface {
	error
	PublicError() string
}

PublicError with separate level of detail for clients and internal logging.

func AsPublicError

func AsPublicError(err error) PublicError

AsPublicError returns the error if it is public (PublicError method returns non-empty string).

type ResumeOptions

type ResumeOptions = pb.ResumeOptions

type Server

type Sortable

type Sortable interface {
	Len() int
	Swap(i, j int)
	Less(i, j int) bool
}

func SortableInstances

func SortableInstances(x *Instances) Sortable

func SortableModules

func SortableModules(x *Modules) Sortable

type State

type State = pb.State

type Status

type Status = pb.Status

func CloneStatus

func CloneStatus(s *Status) *Status

type TooManyRequests

type TooManyRequests interface {
	Unavailable
	TooManyRequests() bool
	RetryAfter() time.Duration // Zero means unknown.
}

TooManyRequests error occurs when request rate limit has been exceeded.

func AsTooManyRequests

func AsTooManyRequests(err error) TooManyRequests

AsTooManyRequests returns the error if it is a rate limit error (TooManyRequests method returns true).

type Unauthenticated

type Unauthenticated interface {
	PublicError
	Unauthenticated() bool
}

Unauthenticated error. The client doesn't have authentication credentials or they are invalid.

func AsUnauthenticated

func AsUnauthenticated(err error) Unauthenticated

AsUnauthenticated returns the error if it is an authentication error (Unauthenticated method returns true).

type Unavailable

type Unavailable interface {
	PublicError
	Unavailable() bool
}

Unavailable error. Service is not available for the client at the moment.

func AsUnavailable

func AsUnavailable(err error) Unavailable

AsUnavailable returns the error if it is an availability error (Unavailable method returns true).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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