api

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithClient added in v0.0.20

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

Types

type BuildReponse added in v0.0.19

type BuildReponse struct {
	OK bool   `json:"ok"`
	ID string `json:"id"`
}

type BuilderHealthResponse added in v0.1.4

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

type BuilderResponse added in v0.0.20

type BuilderResponse struct {
	OK           bool   `json:"ok"`
	Endpoint     string `json:"endpoint"`
	AccessToken  string `json:"accessToken"`
	BuilderState string `json:"builderState"`
	PollSeconds  int    `json:"pollSeconds"`
	Platform     string `json:"platform"`

	// Version 2 uses mTLS for authentication
	Version string `json:"version"`
	CACert  string `json:"caCert"`
	Cert    string `json:"cert"`
	Key     string `json:"key"`
}

type CLIAuthenticationResponse

type CLIAuthenticationResponse struct {
	RequestID  string `json:"requestID"`
	ExpiresIn  int    `json:"expiresIn"`
	Interval   int    `json:"interval"`
	ApproveURL string `json:"approveURL"`
	TokenURL   string `json:"tokenURL"`
}

type Depot

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

func GetContextClient added in v0.0.20

func GetContextClient(ctx context.Context) *Depot

func NewDepot

func NewDepot(baseURL string, token string) *Depot

func NewDepotFromEnv

func NewDepotFromEnv(token string) (*Depot, error)

func (*Depot) AuthorizeDevice

func (d *Depot) AuthorizeDevice() (*TokenResponse, error)

func (*Depot) CreateBuild added in v0.0.19

func (d *Depot) CreateBuild(projectID string) (*BuildReponse, error)

func (*Depot) FinishBuild

func (d *Depot) FinishBuild(buildID string, buildErr error) error

func (*Depot) GetBuilder added in v0.0.20

func (d *Depot) GetBuilder(buildID string, platform string) (*BuilderResponse, error)

func (*Depot) GetProjects added in v0.0.10

func (d *Depot) GetProjects() (*GetProjectsResponse, error)

func (*Depot) LatestRelease added in v0.0.9

func (d *Depot) LatestRelease() (*ReleaseResponse, error)

func (*Depot) ReportBuilderHealth added in v0.1.4

func (d *Depot) ReportBuilderHealth(buildID string, platform string, status string) (*BuilderHealthResponse, error)

type ErrorResponse added in v0.0.7

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

type FinishResponse added in v0.0.8

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

type GetProjectsResponse added in v0.0.10

type GetProjectsResponse struct {
	OK       bool       `json:"ok"`
	Projects []*Project `json:"projects"`
}

type Project added in v0.0.10

type Project struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	OrgID   string `json:"orgID"`
	OrgName string `json:"orgName"`
}

type ReleaseResponse added in v0.0.9

type ReleaseResponse struct {
	OK          bool      `json:"ok"`
	Version     string    `json:"version"`
	URL         string    `json:"url"`
	PublishedAt time.Time `json:"publishedAt"`
}

type TokenRequest

type TokenRequest struct {
	RequestID string `json:"requestID"`
}

type TokenResponse

type TokenResponse struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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