api

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// Services is used for talking to different parts of the Gitploy API.
	Repo             *RepoService
	Deployment       *DeploymentService
	DeploymentStatus *DeploymentStatusService
	Config           *ConfigService
	User             *UserService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(host string, httpClient *http.Client) *Client

type ConfigService

type ConfigService service

func (*ConfigService) Get

func (s *ConfigService) Get(ctx context.Context, namespace, name string) (*extent.Config, error)

type DeploymentCreateRequest

type DeploymentCreateRequest struct {
	Type           string                 `json:"type"`
	Ref            string                 `json:"ref"`
	Env            string                 `json:"env"`
	DynamicPayload map[string]interface{} `json:"dynamic_payload"`
}

type DeploymentListOptions

type DeploymentListOptions struct {
	ListOptions

	Env    string
	Status deployment.Status
}

type DeploymentService

type DeploymentService service

func (*DeploymentService) Create

func (s *DeploymentService) Create(ctx context.Context, namespace, name string, body *DeploymentCreateRequest) (*ent.Deployment, error)

Create requests a server to deploy a specific ref(branch, SHA, tag).

func (*DeploymentService) Get

func (s *DeploymentService) Get(ctx context.Context, namespace, name string, number int) (*ent.Deployment, error)

Get returns the deployment.

func (*DeploymentService) List

func (s *DeploymentService) List(ctx context.Context, namespace, name string, options *DeploymentListOptions) ([]*ent.Deployment, error)

List returns the deployment list. It returns an error for a bad request.

func (*DeploymentService) Update

func (s *DeploymentService) Update(ctx context.Context, namespace, name string, number int) (*ent.Deployment, error)

Update requests to trigger the 'waiting' deployment.

type DeploymentStatusCreateRemoteRequest

type DeploymentStatusCreateRemoteRequest struct {
	Status      string `json:"status"`
	Description string `json:"description"`
	LogURL      string `json:"log_url"`
}

type DeploymentStatusService

type DeploymentStatusService service

func (*DeploymentStatusService) CreateRemote

CreateRemote returns the remote status. It returns an error for a bad request.

func (*DeploymentStatusService) List

func (s *DeploymentStatusService) List(ctx context.Context, namespace, name string, number int, opt *ListOptions) ([]*ent.DeploymentStatus, error)

List returns the list of deployment statuses. It returns an error for a bad request.

type ErrorResponse

type ErrorResponse struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type ListOptions

type ListOptions struct {
	Page    int
	PerPage int
}

type RepoListOptions

type RepoListOptions struct {
	ListOptions
}

type RepoService

type RepoService service

func (*RepoService) Get

func (s *RepoService) Get(ctx context.Context, namespace, name string) (*ent.Repo, error)

Get returns the repository.

func (*RepoService) List

func (s *RepoService) List(ctx context.Context, options *RepoListOptions) ([]*ent.Repo, error)

List returns repositories which are on the page.

func (*RepoService) ListAll

func (s *RepoService) ListAll(ctx context.Context) ([]*ent.Repo, error)

ListAll returns all repositories.

func (*RepoService) Update

func (s *RepoService) Update(ctx context.Context, namespace, name string, options *RepoUpdateRequest) (*ent.Repo, error)

type RepoUpdateRequest

type RepoUpdateRequest struct {
	ConfigPath *string `json:"config_path,omitempty"`
	Active     *bool   `json:"active,omitempty"`
}

type UserService

type UserService service

UserService communicates with the server for users.

func (*UserService) GetMe

func (s *UserService) GetMe(ctx context.Context) (*ent.User, error)

GetMe returns the user information.

Jump to

Keyboard shortcuts

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