api

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBuildInProgress added in v0.6.0

func IsBuildInProgress(status DeploymentStatus) bool

func IsDeployInProgress added in v0.6.0

func IsDeployInProgress(status DeploymentStatus) bool

func IsJobInProgress added in v0.6.0

func IsJobInProgress(state JobRunState) bool

Types

type Client added in v0.1.0

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

func New added in v0.1.0

func New(server, token, version string, debug bool) *Client

func (*Client) BuildProject added in v0.1.0

func (c *Client) BuildProject(ctx context.Context, projectID uuid.UUID, branch string, noCache bool) (*Deployment, error)

func (*Client) DeleteRepo added in v0.6.1

func (c *Client) DeleteRepo(ctx context.Context, repoID uuid.UUID) error

func (*Client) DeployProjectBranch added in v0.1.0

func (c *Client) DeployProjectBranch(ctx context.Context, projectID uuid.UUID, branch string, noCache bool) (*Deployment, error)

func (*Client) GetBuildLogs added in v0.1.0

func (c *Client) GetBuildLogs(ctx context.Context, deployID uuid.UUID) (out []LogEntry, err error)

func (*Client) GetCloudAWS added in v0.7.0

func (c *Client) GetCloudAWS(ctx context.Context, cloudID uuid.UUID) (*GetCloudAWSResponse, error)

func (*Client) GetCloudDigitalOcean added in v0.7.0

func (c *Client) GetCloudDigitalOcean(ctx context.Context, cloudID uuid.UUID) (*GetCloudDigitalOceanResponse, error)

func (*Client) GetCloudGCP added in v0.7.0

func (c *Client) GetCloudGCP(ctx context.Context, cloudID uuid.UUID) (*GetCloudGCPResponse, error)

func (*Client) GetCloudLinode added in v0.7.0

func (c *Client) GetCloudLinode(ctx context.Context, cloudID uuid.UUID) (*GetCloudLinodeResponse, error)

func (*Client) GetClusterKubeconfig added in v0.7.0

func (c *Client) GetClusterKubeconfig(ctx context.Context, clusterID uuid.UUID) (*GetClusterKubeconfigResponse, error)

func (*Client) GetCurrentUser added in v0.1.0

func (c *Client) GetCurrentUser(ctx context.Context) (*User, error)

func (*Client) GetDeployment added in v0.1.0

func (c *Client) GetDeployment(ctx context.Context, deploymentID uuid.UUID) (*Deployment, error)

func (*Client) GetDeploymentLogs added in v0.1.0

func (c *Client) GetDeploymentLogs(ctx context.Context, deployID uuid.UUID) (out []LogEntry, err error)

func (*Client) GetDeploymentStatus added in v0.5.2

func (c *Client) GetDeploymentStatus(ctx context.Context, deploymentID uuid.UUID) (*DeploymentReplicaStatus, error)

func (*Client) GetEnvVars added in v0.2.0

func (c *Client) GetEnvVars(ctx context.Context, repoID uuid.UUID) (map[string]string, error)

func (*Client) GetJob added in v0.5.2

func (c *Client) GetJob(ctx context.Context, projectID uuid.UUID, jobID uuid.UUID) (*Job, error)

func (*Client) GetJobLogs added in v0.5.2

func (c *Client) GetJobLogs(ctx context.Context, repoID uuid.UUID, jobID uuid.UUID) ([]LogEntry, error)

func (*Client) GetLatestDeployment added in v0.5.2

func (c *Client) GetLatestDeployment(ctx context.Context, project string, branch string) (*Deployment, error)

func (*Client) GetProductionBranch added in v0.1.0

func (c *Client) GetProductionBranch(ctx context.Context, projectID uuid.UUID) (string, error)

func (*Client) GetProductionDeployment added in v0.1.2

func (c *Client) GetProductionDeployment(ctx context.Context, project string) (*Deployment, error)

func (*Client) GetProjectByPath added in v0.1.0

func (c *Client) GetProjectByPath(ctx context.Context, project string) (*Project, error)

func (*Client) GetProjectPath added in v0.5.2

func (c *Client) GetProjectPath(ctx context.Context, id uuid.UUID) (string, error)

func (*Client) GetRepo added in v0.6.1

func (c *Client) GetRepo(ctx context.Context, path string) (*Repo, error)

func (*Client) GetRuntimeLogs added in v0.2.0

func (c *Client) GetRuntimeLogs(ctx context.Context, deployID uuid.UUID) (out []LogEntry, err error)

func (*Client) RunJob added in v0.5.2

func (c *Client) RunJob(ctx context.Context, projectID uuid.UUID, command string, build bool) (*Job, error)

func (*Client) SetEnvVars added in v0.2.0

func (c *Client) SetEnvVars(ctx context.Context, repoID uuid.UUID, vars map[string]string) error

func (*Client) ToProjectPath added in v0.6.0

func (c *Client) ToProjectPath(input string) (string, error)

ToProjectPath returns the path for a given project UUID or path

func (*Client) UpdateBranch added in v0.5.2

func (c *Client) UpdateBranch(ctx context.Context, projectID uuid.UUID, image string, branchName string, deploy bool) error

func (*Client) UpdateClusterKubeconfig added in v0.6.0

func (c *Client) UpdateClusterKubeconfig(ctx context.Context, clusterId uuid.UUID, kubeconfig []byte) (*Cluster, error)

func (*Client) UpdateProject added in v0.5.2

func (c *Client) UpdateProject(ctx context.Context, projectID uuid.UUID, image string) error

type Cluster added in v0.6.0

type Cluster struct {
	Id uuid.UUID `copier:"Id"`
}

type Deployment added in v0.1.0

type Deployment struct {
	ID              uuid.UUID        `copier:"Id"`
	Status          DeploymentStatus `copier:"Status"`
	Branch          string
	Endpoints       []string
	PrivateEndpoint string
	ErrorMessage    string
}

type DeploymentReplicaStatus added in v0.1.2

type DeploymentReplicaStatus struct {
	Replicas        int
	ReadyReplicas   int
	RunningReplicas int
	State           string
	ErrorMessage    string
}

TODO this should be named DeploymentStatus, but that's already used

type DeploymentStatus added in v0.1.0

type DeploymentStatus string
const (
	DeploymentStatusBuildPending      DeploymentStatus = "BUILD_PENDING"
	DeploymentStatusBuildInProgress   DeploymentStatus = "BUILD_IN_PROGRESS"
	DeploymentStatusBuildFailed       DeploymentStatus = "BUILD_FAILED"
	DeploymentStatusBuildSucceeded    DeploymentStatus = "BUILD_SUCCEEDED"
	DeploymentStatusDeployPending     DeploymentStatus = "DEPLOY_PENDING"
	DeploymentStatusDeployInProgress  DeploymentStatus = "DEPLOY_IN_PROGRESS"
	DeploymentStatusReleaseInProgress DeploymentStatus = "RELEASE_IN_PROGRESS"
	DeploymentStatusDeployFailed      DeploymentStatus = "DEPLOY_FAILED"
	DeploymentStatusDeploySucceeded   DeploymentStatus = "DEPLOY_SUCCEEDED"
	DeploymentStatusBuildAborted      DeploymentStatus = "BUILD_ABORTED"
	DeploymentStatusDeployStopped     DeploymentStatus = "DEPLOY_STOPPED"
	DeploymentStatusDeployHealhty     DeploymentStatus = "DEPLOY_HEALHTY"
	DeploymentStatusDeployCrashing    DeploymentStatus = "DEPLOY_CRASHING"
)

type EnvVarInput added in v0.2.0

type EnvVarInput struct {
	Name   string `json:"name"`
	Value  string `json:"value"`
	Sealed bool   `json:"sealed"`
}

func (*EnvVarInput) GetName added in v0.2.0

func (v *EnvVarInput) GetName() string

GetName returns EnvVarInput.Name, and is useful for accessing the field via an interface.

func (*EnvVarInput) GetSealed added in v0.6.1

func (v *EnvVarInput) GetSealed() bool

GetSealed returns EnvVarInput.Sealed, and is useful for accessing the field via an interface.

func (*EnvVarInput) GetValue added in v0.2.0

func (v *EnvVarInput) GetValue() string

GetValue returns EnvVarInput.Value, and is useful for accessing the field via an interface.

type GetCloudAWSCurrentUser added in v0.7.0

type GetCloudAWSCurrentUser struct {
	AwsAccount GetCloudAWSCurrentUserAwsAccountAWSAccount `json:"awsAccount"`
}

GetCloudAWSCurrentUser includes the requested fields of the GraphQL type User.

func (*GetCloudAWSCurrentUser) GetAwsAccount added in v0.7.0

GetAwsAccount returns GetCloudAWSCurrentUser.AwsAccount, and is useful for accessing the field via an interface.

type GetCloudAWSCurrentUserAwsAccountAWSAccount added in v0.7.0

type GetCloudAWSCurrentUserAwsAccountAWSAccount struct {
	Id         uuid.UUID `json:"id"`
	RoleARN    string    `json:"roleARN"`
	ExternalID string    `json:"externalID"`
}

GetCloudAWSCurrentUserAwsAccountAWSAccount includes the requested fields of the GraphQL type AWSAccount.

func (*GetCloudAWSCurrentUserAwsAccountAWSAccount) GetExternalID added in v0.7.0

GetExternalID returns GetCloudAWSCurrentUserAwsAccountAWSAccount.ExternalID, and is useful for accessing the field via an interface.

func (*GetCloudAWSCurrentUserAwsAccountAWSAccount) GetId added in v0.7.0

GetId returns GetCloudAWSCurrentUserAwsAccountAWSAccount.Id, and is useful for accessing the field via an interface.

func (*GetCloudAWSCurrentUserAwsAccountAWSAccount) GetRoleARN added in v0.7.0

GetRoleARN returns GetCloudAWSCurrentUserAwsAccountAWSAccount.RoleARN, and is useful for accessing the field via an interface.

type GetCloudAWSResponse added in v0.7.0

type GetCloudAWSResponse struct {
	CurrentUser GetCloudAWSCurrentUser `json:"currentUser"`
}

GetCloudAWSResponse is returned by GetCloudAWS on success.

func GetCloudAWS added in v0.7.0

func GetCloudAWS(
	ctx context.Context,
	client graphql.Client,
	id uuid.UUID,
) (*GetCloudAWSResponse, error)

func (*GetCloudAWSResponse) GetCurrentUser added in v0.7.0

func (v *GetCloudAWSResponse) GetCurrentUser() GetCloudAWSCurrentUser

GetCurrentUser returns GetCloudAWSResponse.CurrentUser, and is useful for accessing the field via an interface.

type GetCloudDigitalOceanCurrentUser added in v0.7.0

type GetCloudDigitalOceanCurrentUser struct {
	DoAccount GetCloudDigitalOceanCurrentUserDoAccountDOAccount `json:"doAccount"`
}

GetCloudDigitalOceanCurrentUser includes the requested fields of the GraphQL type User.

func (*GetCloudDigitalOceanCurrentUser) GetDoAccount added in v0.7.0

GetDoAccount returns GetCloudDigitalOceanCurrentUser.DoAccount, and is useful for accessing the field via an interface.

type GetCloudDigitalOceanCurrentUserDoAccountDOAccount added in v0.7.0

type GetCloudDigitalOceanCurrentUserDoAccountDOAccount struct {
	Id          uuid.UUID `json:"id"`
	AccessToken string    `json:"accessToken"`
}

GetCloudDigitalOceanCurrentUserDoAccountDOAccount includes the requested fields of the GraphQL type DOAccount.

func (*GetCloudDigitalOceanCurrentUserDoAccountDOAccount) GetAccessToken added in v0.7.0

GetAccessToken returns GetCloudDigitalOceanCurrentUserDoAccountDOAccount.AccessToken, and is useful for accessing the field via an interface.

func (*GetCloudDigitalOceanCurrentUserDoAccountDOAccount) GetId added in v0.7.0

GetId returns GetCloudDigitalOceanCurrentUserDoAccountDOAccount.Id, and is useful for accessing the field via an interface.

type GetCloudDigitalOceanResponse added in v0.7.0

type GetCloudDigitalOceanResponse struct {
	CurrentUser GetCloudDigitalOceanCurrentUser `json:"currentUser"`
}

GetCloudDigitalOceanResponse is returned by GetCloudDigitalOcean on success.

func GetCloudDigitalOcean added in v0.7.0

func GetCloudDigitalOcean(
	ctx context.Context,
	client graphql.Client,
	id uuid.UUID,
) (*GetCloudDigitalOceanResponse, error)

func (*GetCloudDigitalOceanResponse) GetCurrentUser added in v0.7.0

GetCurrentUser returns GetCloudDigitalOceanResponse.CurrentUser, and is useful for accessing the field via an interface.

type GetCloudGCPCurrentUser added in v0.7.0

type GetCloudGCPCurrentUser struct {
	GcpAccount GetCloudGCPCurrentUserGcpAccountGCPAccount `json:"gcpAccount"`
}

GetCloudGCPCurrentUser includes the requested fields of the GraphQL type User.

func (*GetCloudGCPCurrentUser) GetGcpAccount added in v0.7.0

GetGcpAccount returns GetCloudGCPCurrentUser.GcpAccount, and is useful for accessing the field via an interface.

type GetCloudGCPCurrentUserGcpAccountGCPAccount added in v0.7.0

type GetCloudGCPCurrentUserGcpAccountGCPAccount struct {
	Id          uuid.UUID `json:"id"`
	Credentials string    `json:"credentials"`
}

GetCloudGCPCurrentUserGcpAccountGCPAccount includes the requested fields of the GraphQL type GCPAccount.

func (*GetCloudGCPCurrentUserGcpAccountGCPAccount) GetCredentials added in v0.7.0

GetCredentials returns GetCloudGCPCurrentUserGcpAccountGCPAccount.Credentials, and is useful for accessing the field via an interface.

func (*GetCloudGCPCurrentUserGcpAccountGCPAccount) GetId added in v0.7.0

GetId returns GetCloudGCPCurrentUserGcpAccountGCPAccount.Id, and is useful for accessing the field via an interface.

type GetCloudGCPResponse added in v0.7.0

type GetCloudGCPResponse struct {
	CurrentUser GetCloudGCPCurrentUser `json:"currentUser"`
}

GetCloudGCPResponse is returned by GetCloudGCP on success.

func GetCloudGCP added in v0.7.0

func GetCloudGCP(
	ctx context.Context,
	client graphql.Client,
	id uuid.UUID,
) (*GetCloudGCPResponse, error)

func (*GetCloudGCPResponse) GetCurrentUser added in v0.7.0

func (v *GetCloudGCPResponse) GetCurrentUser() GetCloudGCPCurrentUser

GetCurrentUser returns GetCloudGCPResponse.CurrentUser, and is useful for accessing the field via an interface.

type GetCloudLinodeCurrentUser added in v0.7.0

type GetCloudLinodeCurrentUser struct {
	LinodeAccount GetCloudLinodeCurrentUserLinodeAccount `json:"linodeAccount"`
}

GetCloudLinodeCurrentUser includes the requested fields of the GraphQL type User.

func (*GetCloudLinodeCurrentUser) GetLinodeAccount added in v0.7.0

GetLinodeAccount returns GetCloudLinodeCurrentUser.LinodeAccount, and is useful for accessing the field via an interface.

type GetCloudLinodeCurrentUserLinodeAccount added in v0.7.0

type GetCloudLinodeCurrentUserLinodeAccount struct {
	Id          uuid.UUID `json:"id"`
	AccessToken string    `json:"accessToken"`
}

GetCloudLinodeCurrentUserLinodeAccount includes the requested fields of the GraphQL type LinodeAccount.

func (*GetCloudLinodeCurrentUserLinodeAccount) GetAccessToken added in v0.7.0

func (v *GetCloudLinodeCurrentUserLinodeAccount) GetAccessToken() string

GetAccessToken returns GetCloudLinodeCurrentUserLinodeAccount.AccessToken, and is useful for accessing the field via an interface.

func (*GetCloudLinodeCurrentUserLinodeAccount) GetId added in v0.7.0

GetId returns GetCloudLinodeCurrentUserLinodeAccount.Id, and is useful for accessing the field via an interface.

type GetCloudLinodeResponse added in v0.7.0

type GetCloudLinodeResponse struct {
	CurrentUser GetCloudLinodeCurrentUser `json:"currentUser"`
}

GetCloudLinodeResponse is returned by GetCloudLinode on success.

func GetCloudLinode added in v0.7.0

func GetCloudLinode(
	ctx context.Context,
	client graphql.Client,
	id uuid.UUID,
) (*GetCloudLinodeResponse, error)

func (*GetCloudLinodeResponse) GetCurrentUser added in v0.7.0

GetCurrentUser returns GetCloudLinodeResponse.CurrentUser, and is useful for accessing the field via an interface.

type GetClusterKubeconfigResponse added in v0.7.0

type GetClusterKubeconfigResponse struct {
	ID         uuid.UUID
	Name       string
	Kubeconfig string
}

type Job added in v0.5.2

type Job struct {
	ID    uuid.UUID `copier:"Id"`
	State JobRunState
}

type JobRunState added in v0.5.2

type JobRunState string
const (
	JobRunStateJobRunStarting  JobRunState = "JOB_RUN_STARTING"
	JobRunStateJobRunRunning   JobRunState = "JOB_RUN_RUNNING"
	JobRunStateJobRunFailed    JobRunState = "JOB_RUN_FAILED"
	JobRunStateJobRunSucceeded JobRunState = "JOB_RUN_SUCCEEDED"
)

type LogEntry added in v0.1.0

type LogEntry struct {
	Text      string
	Timestamp time.Time
}

type Project

type Project struct {
	ID uuid.UUID `copier:"Id"`
}

type Repo added in v0.2.0

type Repo struct {
	ID uuid.UUID `copier:"Id"`
}

type User added in v0.1.0

type User struct {
	Id    uuid.UUID
	Login string
}

type UserAgentTransport added in v0.1.2

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

UserAgentTransport implements a http.RoundTripper which adds a User-Agent header to requests

func NewUserAgentTransport added in v0.1.2

func NewUserAgentTransport(ua string, rt http.RoundTripper) *UserAgentTransport

func (*UserAgentTransport) RoundTrip added in v0.1.2

func (t *UserAgentTransport) RoundTrip(r *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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