api

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	Domain    string              `json:"domain"`
	Challenge types.ChallengeType `json:"challenge"`
	PEM       string              `json:"pem,omitempty"`
	Meta      struct {
		Subject            string    `json:"subject"`
		Issuer             string    `json:"issuer"`
		Since              time.Time `json:"since"`
		Expiry             time.Time `json:"expiry"`
		SerialNumber       string    `json:"serial"`
		SignatureAlgorithm string    `json:"signature_algorithm"`
		PublicAlgorithm    string    `json:"public_algorithm"`
	} `json:"meta,omitempty"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(base *url.URL, http *http.Client) *Client

NewClient creates a new API client with the specified base URL and HTTP client.

func NewClientFromEnv

func NewClientFromEnv() *Client

NewClientFromEnv will create a new API client for the current environment it's running in.

func (*Client) CertificateInspect

func (c *Client) CertificateInspect(ctx context.Context, domain string) (*Certificate, error)

CertificateInspect will return the detailed information about the certificate for the given domain.

func (*Client) CertificateList

func (c *Client) CertificateList(ctx context.Context) ([]Certificate, error)

CertificateList will return the current certificates known in the system.

func (*Client) CertificateRenew

func (c *Client) CertificateRenew(ctx context.Context, domain string) error

CertificateRenew will renew an existing certificate for the given domain.

func (*Client) ProjectApply

func (c *Client) ProjectApply(ctx context.Context, cmd ProjectApplyCommand) (*Project, error)

ProjectApply will apply the project configuration to the system.

func (*Client) ProjectInspect

func (c *Client) ProjectInspect(ctx context.Context, name string) (*Project, error)

ProjectInspect will return the detailed information about the project for the given name.

func (*Client) ProjectList

func (c *Client) ProjectList(ctx context.Context) ([]ProjectSummary, error)

ProjectList will return the current projects known to the system

func (*Client) ProjectRemove

func (c *Client) ProjectRemove(ctx context.Context, name string) error

ProjectRemove will remove the project from the system.

type Project

type Project struct {
	Name     string    `json:"project"`
	Services []Service `json:"services"`
}

type ProjectApplyCommand

type ProjectApplyCommand struct {
	ProjectName string `json:"project_name"`
	Services    []struct {
		Name          string              `json:"name"`
		Source        types.Source        `json:"source"`
		Environment   map[string]string   `json:"environment"`
		IngressDomain string              `json:"ingress_domain"`
		ContainerPort int                 `json:"container_port"`
		ChallengeType types.ChallengeType `json:"challenge_type"`
		Quota         types.Quota         `json:"quota"`
	} `json:"services"`
}

type ProjectSummary

type ProjectSummary struct {
	Name     string   `json:"name"`
	Running  bool     `json:"running"`
	Services []string `json:"services"`
}

type Service

type Service struct {
	Name    string `json:"name"`
	Hash    string `json:"hash"`
	Status  string `json:"status"`
	Ingress struct {
		Domain           string              `json:"domain"`
		InternalEndpoint string              `json:"internal"`
		ChallengeType    types.ChallengeType `json:"challenge"`
	} `json:"ingress,omitempty"`
}

type StatusError

type StatusError struct {
	StatusCode   int
	Status       string
	ErrorMessage string `json:"error"`
}

StatusError is an error with an HTTP status code and message.

func (StatusError) Error

func (e StatusError) Error() string

Jump to

Keyboard shortcuts

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