Documentation
¶
Index ¶
- Constants
- func EncodeKnownModule(hashSum []byte) string
- func PublicErrorString(err error, alternative string) string
- type Cause
- type DebugConfig
- type DebugOp
- type DebugRequest
- type DebugResponse
- type Features
- type FunctionNotFound
- type Instance
- type InstanceInfo
- type InstanceNotFound
- type InstanceUpdate
- type Instances
- type InvokeOptions
- type LaunchOptions
- type ModuleInfo
- type ModuleNotFound
- type ModuleOptions
- type ModuleUpload
- type Modules
- type NotFound
- type Op
- type PermissionDenied
- type PublicError
- type ResumeOptions
- type Server
- type State
- type Status
- type TooManyRequests
- type Unauthenticated
- type Unavailable
Constants ¶
const ( StateRunning = pb.State_RUNNING StateSuspended = pb.State_SUSPENDED StateHalted = pb.State_HALTED StateTerminated = pb.State_TERMINATED StateKilled = pb.State_KILLED )
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 )
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 )
const ( KnownModuleSource = "sha256" KnownModuleHash = crypto.SHA256 )
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 OpLaunchHost = pb.Op_LAUNCH_HOST 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 )
Op types.
Variables ¶
This section is empty.
Functions ¶
func EncodeKnownModule ¶
func PublicErrorString ¶
PublicErrorString returns err.PublicError() if err is public. Otherwise the alternative is returned.
Types ¶
type DebugConfig ¶
type DebugConfig = pb.DebugConfig
type DebugRequest ¶
type DebugRequest = pb.DebugRequest
type DebugResponse ¶
type DebugResponse = pb.DebugResponse
type FunctionNotFound ¶
FunctionNotFound error.
func AsFunctionNotFound ¶
func AsFunctionNotFound(err error) FunctionNotFound
AsFunctionNotFound returns the error if it is an existence error (FunctionNotFound method returns true).
type InstanceInfo ¶
type InstanceInfo = pb.InstanceInfo
type InstanceNotFound ¶
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 InvokeOptions ¶
type InvokeOptions = pb.InvokeOptions
type LaunchOptions ¶
type LaunchOptions = pb.LaunchOptions
type ModuleInfo ¶
type ModuleInfo = pb.ModuleInfo
type ModuleNotFound ¶
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 NotFound ¶
type NotFound interface {
PublicError
NotFound() bool
}
NotFound error.
func AsNotFound ¶
AsNotFound returns the error if it is an existence error (NotFound method returns true).
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 ¶
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 Server interface {
DebugInstance(Context, string, *DebugRequest) (*DebugResponse, error)
DeleteInstance(Context, string) error
Features() *Features
InstanceConnection(Context, string) (Instance, func(Context, io.Reader, io.WriteCloser) *Status, error)
InstanceInfo(Context, string) (*InstanceInfo, error)
Instances(Context) (*Instances, error)
KillInstance(Context, string) (Instance, error)
ModuleContent(Context, string) (io.ReadCloser, int64, error)
ModuleInfo(Context, string) (*ModuleInfo, error)
Modules(Context) (*Modules, error)
NewInstance(Context, string, *LaunchOptions) (Instance, error)
PinModule(Context, string, *ModuleOptions) error
ResumeInstance(Context, string, *ResumeOptions) (Instance, error)
Snapshot(Context, string, *ModuleOptions) (string, error)
SourceModule(Context, string, *ModuleOptions) (string, error)
SourceModuleInstance(Context, string, *ModuleOptions, *LaunchOptions) (string, Instance, error)
SuspendInstance(Context, string) (Instance, error)
UUID() string
UnpinModule(Context, string) error
UpdateInstance(Context, string, *InstanceUpdate) (*InstanceInfo, error)
UploadModule(Context, *ModuleUpload, *ModuleOptions) (string, error)
UploadModuleInstance(Context, *ModuleUpload, *ModuleOptions, *LaunchOptions) (string, Instance, error)
WaitInstance(Context, string) (*Status, error)
}
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 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).