api

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithClient

func WithClient(ctx context.Context, client *Depot) context.Context

Types

type Depot

type Depot struct {
	BaseURL string
	// contains filtered or unexported fields
}

func GetContextClient

func GetContextClient(ctx context.Context) *Depot

func New

func New(baseURL string, token string) *Depot

func NewFromEnv

func NewFromEnv(token string) *Depot

func (*Depot) Example

func (d *Depot) Example(id string) error

func (*Depot) RegisterMachine added in v0.0.6

func (d *Depot) RegisterMachine(request RegisterMachineRequest) (*RegisterMachineResponse, error)

func (*Depot) ReportHealth added in v0.0.6

func (d *Depot) ReportHealth(request ReportHealthRequest) (*ReportHealthResponse, error)

type ErrorResponse

type ErrorResponse struct {
	OK    bool   `json:"ok"`
	Error string `json:"error"`
}

type ExampleResponse

type ExampleResponse struct {
	OK bool `json:"ok"`
}

type Mount added in v0.0.6

type Mount struct {
	Path   string `json:"path"`
	Device string `json:"device"`
}

type RegisterMachineRequest added in v0.0.6

type RegisterMachineRequest struct {
	Cloud     string `json:"cloud"`
	Document  string `json:"document"`
	Signature string `json:"signature"`
}

type RegisterMachineResponse added in v0.0.6

type RegisterMachineResponse struct {
	OK     bool    `json:"ok"`
	Role   string  `json:"role"`
	Mounts []Mount `json:"mounts"`
	Token  string  `json:"token,omitempty"`
	CaCert string  `json:"caCert,omitempty"`
	Cert   string  `json:"cert,omitempty"`
	Key    string  `json:"key,omitempty"`
}

type ReportHealthRequest added in v0.0.6

type ReportHealthRequest struct {
	Cloud     string `json:"cloud"`
	Document  string `json:"document"`
	Signature string `json:"signature"`
	State     string `json:"state"`
}

type ReportHealthResponse added in v0.0.6

type ReportHealthResponse struct {
	OK           bool   `json:"ok"`
	DesiredState string `json:"desiredState"`
}

Jump to

Keyboard shortcuts

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