v1

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PingValue = "ping"
	PongValue = "pong"
)

Variables

This section is empty.

Functions

func IsValidProtocol

func IsValidProtocol(value string) (string, error)

Types

type BoxCreateRequestBody

type BoxCreateRequestBody struct {
	TemplateName string `json:"templateName"`
	Size         string `json:"size"` // expected
}

type BoxCreateResponseBody

type BoxCreateResponseBody struct {
	Name string `json:"name"`
	Size string `json:"size"` // actual
}

type BoxDeleteRequestBody

type BoxDeleteRequestBody struct {
	Names []string `json:"names"`
}

type BoxDeleteResponseBody

type BoxDeleteResponseBody struct {
	Names []string `json:"names"`
}

type BoxDescribeRequestBody

type BoxDescribeRequestBody struct {
	Name string `json:"name"`
}

type BoxDescribeResponseBody

type BoxDescribeResponseBody struct {
	Id       string                   `json:"id"`
	Name     string                   `json:"name"`
	Created  string                   `json:"created"`
	Healthy  bool                     `json:"healthy"`
	Size     string                   `json:"size"`
	Template *BoxDescribeTemplateInfo `json:"template"`
	Env      []string                 `json:"env"`
	Ports    []string                 `json:"ports"`
}

type BoxDescribeTemplateInfo

type BoxDescribeTemplateInfo struct {
	Public   bool   `json:"public"`
	Url      string `json:"url"`
	Revision string `json:"revision"`
	Commit   string `json:"commit"`
	Name     string `json:"name"`
}

type BoxExecSessionBody

type BoxExecSessionBody struct {
	Name string `json:"name"`
}

type BoxListItem

type BoxListItem struct {
	Id      string
	Name    string
	Healthy bool
}

type BoxListRequestBody

type BoxListRequestBody struct{}

type BoxListResponseBody

type BoxListResponseBody struct {
	Items []BoxListItem `json:"items"`
}

type LabCreateRequestBody added in v0.8.1

type LabCreateRequestBody struct {
	TemplateName string            `json:"templateName"`
	Parameters   map[string]string `json:"params"` // expected
}

type LabCreateResponseBody added in v0.8.1

type LabCreateResponseBody struct {
	Name string `json:"name"`
}

type Message

type Message[T body] struct {
	Kind   string `json:"kind"`
	Origin string `json:"origin"`
	Method string `json:"method"`
	Body   T      `json:"body"` // TODO omitempty to remove "body":{}
}

func Decode

func Decode[T body](value string) (*Message[T], error)

func NewBoxCreateRequest

func NewBoxCreateRequest(origin string, templateName string, size string) *Message[BoxCreateRequestBody]

func NewBoxCreateResponse

func NewBoxCreateResponse(origin string, name string, size string) *Message[BoxCreateResponseBody]

func NewBoxDeleteRequest

func NewBoxDeleteRequest(origin string, names []string) *Message[BoxDeleteRequestBody]

func NewBoxDeleteResponse

func NewBoxDeleteResponse(origin string, names []string) *Message[BoxDeleteResponseBody]

func NewBoxDescribeRequest

func NewBoxDescribeRequest(origin string, name string) *Message[BoxDescribeRequestBody]

func NewBoxDescribeResponse

func NewBoxDescribeResponse(origin string, body BoxDescribeResponseBody) *Message[BoxDescribeResponseBody]

func NewBoxExecSession

func NewBoxExecSession(origin string, name string) *Message[BoxExecSessionBody]

func NewBoxListRequest

func NewBoxListRequest(origin string) *Message[BoxListRequestBody]

func NewBoxListResponse

func NewBoxListResponse(origin string, items []BoxListItem) *Message[BoxListResponseBody]

func NewLabCreateRequest added in v0.8.1

func NewLabCreateRequest(origin string, templateName string, parameters map[string]string) *Message[LabCreateRequestBody]

func NewLabCreateResponse added in v0.8.1

func NewLabCreateResponse(origin string, name string) *Message[LabCreateResponseBody]

func NewPingMessage

func NewPingMessage(origin string) *Message[PingBody]

func NewPongMessage

func NewPongMessage(origin string) *Message[PongBody]

func (*Message[T]) Encode

func (req *Message[T]) Encode() (string, error)

func (*Message[T]) Protocol

func (req *Message[T]) Protocol() string

type MethodName

type MethodName int
const (
	MethodPing MethodName = iota
	MethodBoxCreate
	MethodBoxDelete
	MethodBoxDescribe
	MethodBoxExec
	MethodBoxList
	MethodLabCreate
)

func (MethodName) String

func (c MethodName) String() string

type PingBody

type PingBody struct {
	Value string `json:"value"`
}

type PongBody

type PongBody struct {
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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