client

package
v0.2.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// SetClient sets the http.Client.
	SetClient(*http.Client)

	// SetAddress sets the server address.
	SetAddress(string)

	// ArtifactPost creates a new artifact.
	ArtifactPost(artifact *dx.Artifact) (*dx.Artifact, error)

	// ArtifactsGet returns all artifacts in the database within the given constraints
	ArtifactsGet(
		repo, branch string,
		event *dx.GitEvent,
		sourceBranch string,
		sha string,
		limit, offset int,
		since, until *time.Time,
	) ([]*dx.Artifact, error)

	// ReleasesGet returns all releases from the gitops repo within the given constraints
	ReleasesGet(
		app string,
		env string,
		limit, offset int,
		gitRepo string,
		since, until *time.Time,
	) ([]*dx.Release, error)

	// ReleasesPost releases the given artifact to the given environment
	ReleasesPost(env string, artifactID string) (string, error)

	// RollbackPost rolls back to the given sha
	RollbackPost(env string, app string, targetSHA string) (string, error)

	// TrackGet returns the state of an event
	TrackGet(trackingID string) (string, string, error)
}

Client is used to communicate with a Drone server.

func New

func New(uri string) Client

New returns a client at the specified url.

func NewClient

func NewClient(uri string, cli *http.Client) Client

NewClient returns a client at the specified url.

Jump to

Keyboard shortcuts

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