api

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorStatusCode

func ErrorStatusCode(err error) (int, bool)

Types

type APIApp

type APIApp struct {
	*models.App
	URL string `json:"url"`
}

type APIDeployment

type APIDeployment struct {
	*models.Deployment
	SiteName *string `json:"siteName"`
	URL      *string `json:"url"`
}

type APIDomain added in v0.5.0

type APIDomain struct {
	*models.Domain
}

type APIManifest added in v0.5.0

type APIManifest struct {
	Version             string `json:"version"`
	CustomDomainMessage string `json:"customDomainMessage,omitempty"`
}

type APISite

type APISite struct {
	*models.Site
	URL            string  `json:"url"`
	DeploymentName *string `json:"deploymentName"`
}

type APIUser

type APIUser struct {
	ID          string                `json:"id"`
	Name        string                `json:"name"`
	Credentials []models.CredentialID `json:"credentials"`
}

type Client

type Client struct {
	TokenFunc func(r *http.Request) (string, error)
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint string) *Client

func NewClientWithTransport

func NewClientWithTransport(endpoint string, transport http.RoundTripper) *Client

func (*Client) AddUser

func (c *Client) AddUser(ctx context.Context, appID string, userID string) error

func (*Client) AuthGitHubOIDC

func (c *Client) AuthGitHubOIDC(ctx context.Context, oidcToken string) (string, error)

func (*Client) ConfigureApp

func (c *Client) ConfigureApp(ctx context.Context, appID string, conf *config.AppConfig) (*APIApp, error)

func (*Client) CreateApp

func (c *Client) CreateApp(ctx context.Context, appID string) (*APIApp, error)

func (*Client) CreateDomain added in v0.5.0

func (c *Client) CreateDomain(ctx context.Context, appID string, domainName string, replaceApp string) (*APIDomain, error)

func (*Client) CreateSite

func (c *Client) CreateSite(ctx context.Context, appID string, siteName string) (*APISite, error)

func (*Client) DeleteDomain added in v0.5.0

func (c *Client) DeleteDomain(ctx context.Context, appID string, domainName string) (*APIDomain, error)

func (*Client) DeleteUser

func (c *Client) DeleteUser(ctx context.Context, appID string, userID string) error

func (*Client) Endpoint

func (c *Client) Endpoint() string

func (*Client) GetApp

func (c *Client) GetApp(ctx context.Context, id string) (*APIApp, error)

func (*Client) GetDeployment

func (c *Client) GetDeployment(ctx context.Context, appID string, deploymentName string) (*APIDeployment, error)

func (*Client) GetManifest added in v0.5.0

func (c *Client) GetManifest(ctx context.Context) (*APIManifest, error)

func (*Client) GetMe

func (c *Client) GetMe(ctx context.Context) (*APIUser, error)

func (*Client) ListApps

func (c *Client) ListApps(ctx context.Context) ([]APIApp, error)

func (*Client) ListDeployments

func (c *Client) ListDeployments(ctx context.Context, appID string) ([]APIDeployment, error)

func (*Client) ListDomains added in v0.5.0

func (c *Client) ListDomains(ctx context.Context, appID string) ([]APIDomain, error)

func (*Client) ListSites

func (c *Client) ListSites(ctx context.Context, appID string) ([]APISite, error)

func (*Client) ListUsers

func (c *Client) ListUsers(ctx context.Context, appID string) ([]APIUser, error)

func (*Client) OpenAuthGitHubSSH

func (c *Client) OpenAuthGitHubSSH(ctx context.Context) (*websocket.Conn, error)

func (*Client) SetupDeployment

func (c *Client) SetupDeployment(
	ctx context.Context,
	appID string,
	name string,
	files []models.FileEntry,
	siteConfig *config.SiteConfig,
) (*models.Deployment, error)

func (*Client) UpdateSite

func (c *Client) UpdateSite(
	ctx context.Context,
	appID string,
	siteName string,
	patch *SitePatchRequest,
) (*APISite, error)

func (*Client) UploadDeploymentTarball

func (c *Client) UploadDeploymentTarball(
	ctx context.Context,
	appID string,
	deploymentName string,
	tarball io.Reader,
	size int64,
) (*models.Deployment, error)

type HTTPStatusCodeError

type HTTPStatusCodeError struct {
	Status string
	Code   int
}

func (HTTPStatusCodeError) Error

func (e HTTPStatusCodeError) Error() string

func (HTTPStatusCodeError) StatusCode

func (e HTTPStatusCodeError) StatusCode() int

type ServerError

type ServerError struct {
	Message string
	Code    int
}

func (ServerError) Error

func (e ServerError) Error() string

func (ServerError) StatusCode

func (e ServerError) StatusCode() int

type SitePatchRequest

type SitePatchRequest struct {
	DeploymentName *string `json:"deploymentName,omitempty"`
}

Jump to

Keyboard shortcuts

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