http

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyAutoReleasePolicyRequest

type ApplyAutoReleasePolicyRequest struct {
	Service        string `json:"service,omitempty"`
	Branch         string `json:"branch,omitempty"`
	Environment    string `json:"environment,omitempty"`
	CommitterName  string `json:"committerName,omitempty"`
	CommitterEmail string `json:"committerEmail,omitempty"`
}

type ApplyPolicyResponse

type ApplyPolicyResponse struct {
	ID          string `json:"id,omitempty"`
	Service     string `json:"service,omitempty"`
	Branch      string `json:"branch,omitempty"`
	Environment string `json:"environment,omitempty"`
}

type AutoReleasePolicy

type AutoReleasePolicy struct {
	ID          string `json:"id,omitempty"`
	Branch      string `json:"branch,omitempty"`
	Environment string `json:"environment,omitempty"`
}

type Client

type Client struct {
	BaseURL  string
	Timeout  time.Duration
	Metadata Metadata
}

func (*Client) Do

func (c *Client) Do(method string, path string, requestBody, responseBody interface{}) error

Do sends an HTTP request defined by the provided method and path. The base URL is prefixed on the provided path.

Request and response bodies are marshalled and unmarshalled as JSON and if the server returns a status code above 399 the response is parsed as an ErrorResponse object and returned as the error.

func (*Client) URL

func (c *Client) URL(path string) (string, error)

URL returns a URL with provided path added to the client's base URL.

func (*Client) URLWithQuery

func (c *Client) URLWithQuery(path string, queryParams url.Values) (string, error)

URLWithQuery returns a URL with provided path and query params added to the client's base URL. All query param values are escaped.

type Container

type Container struct {
	Name         string `json:"name"`
	State        string `json:"state"`
	Reason       string `json:"reason"`
	Message      string `json:"message"`
	Ready        bool   `json:"ready"`
	RestartCount int32  `json:"restartCount"`
}

type DeletePolicyRequest

type DeletePolicyRequest struct {
	Service        string   `json:"service,omitempty"`
	PolicyIDs      []string `json:"policyIds,omitempty"`
	CommitterName  string   `json:"committerName,omitempty"`
	CommitterEmail string   `json:"committerEmail,omitempty"`
}

type DeletePolicyResponse

type DeletePolicyResponse struct {
	Service string `json:"service,omitempty"`
	Count   int    `json:"count,omitempty"`
}

type DescribeArtifactResponse added in v0.0.33

type DescribeArtifactResponse struct {
	Service   string          `json:"service,omitempty"`
	Artifacts []artifact.Spec `json:"artifacts,omitempty"`
}

type DescribeReleaseResponse added in v0.0.33

type DescribeReleaseResponse struct {
	Service         string        `json:"service,omitempty"`
	Environment     string        `json:"environment,omitempty"`
	Artifact        artifact.Spec `json:"artifact,omitempty"`
	ReleasedAt      time.Time     `json:"releasedAt,omitempty"`
	ReleasedByEmail string        `json:"releasedByEmail,omitempty"`
	ReleasedByName  string        `json:"releasedByName,omitempty"`
}

type Environment

type Environment struct {
	Tag                   string `json:"tag,omitempty"`
	Committer             string `json:"committer,omitempty"`
	Author                string `json:"author,omitempty"`
	Message               string `json:"message,omitempty"`
	Date                  int64  `json:"date,omitempty"`
	BuildUrl              string `json:"buildUrl,omitempty"`
	HighVulnerabilities   int64  `json:"highVulnerabilities,omitempty"`
	MediumVulnerabilities int64  `json:"mediumVulnerabilities,omitempty"`
	LowVulnerabilities    int64  `json:"lowVulnerabilities,omitempty"`
}

type ErrorResponse

type ErrorResponse struct {
	Status  int    `json:"status,omitempty"`
	Message string `json:"message,omitempty"`
}

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type ListPoliciesResponse

type ListPoliciesResponse struct {
	Service      string              `json:"service,omitempty"`
	AutoReleases []AutoReleasePolicy `json:"autoReleases,omitempty"`
}

type Metadata added in v0.0.15

type Metadata struct {
	AuthToken   string
	CLIVersion  string
	CallerEmail string
}

type PodNotifyRequest

type PodNotifyRequest struct {
	Namespace   string      `json:"namespace"`
	Name        string      `json:"name"`
	State       string      `json:"state"`
	Reason      string      `json:"reason"`
	Message     string      `json:"message"`
	Containers  []Container `json:"containers"`
	ArtifactID  string      `json:"artifactId"`
	Logs        string      `json:"logs"`
	Environment string      `json:"environment"`
}

type PromoteRequest

type PromoteRequest struct {
	Service        string `json:"service,omitempty"`
	Namespace      string `json:"namespace,omitempty"`
	Environment    string `json:"environment,omitempty"`
	CommitterName  string `json:"committerName,omitempty"`
	CommitterEmail string `json:"committerEmail,omitempty"`
}

type PromoteResponse

type PromoteResponse struct {
	Service         string `json:"service,omitempty"`
	FromEnvironment string `json:"fromEnvironment,omitempty"`
	Status          string `json:"status,omitempty"`
	ToEnvironment   string `json:"toEnvironment,omitempty"`
	Tag             string `json:"tag,omitempty"`
}

type ReleaseRequest

type ReleaseRequest struct {
	Service        string `json:"service,omitempty"`
	Environment    string `json:"environment,omitempty"`
	Branch         string `json:"branch,omitempty"`
	ArtifactID     string `json:"artifactId,omitempty"`
	CommitterName  string `json:"committerName,omitempty"`
	CommitterEmail string `json:"committerEmail,omitempty"`
}

type ReleaseResponse

type ReleaseResponse struct {
	Service       string `json:"service,omitempty"`
	ReleaseID     string `json:"releaseId,omitempty"`
	Status        string `json:"status,omitempty"`
	ToEnvironment string `json:"toEnvironment,omitempty"`
	Tag           string `json:"tag,omitempty"`
}

type RollbackRequest added in v0.0.10

type RollbackRequest struct {
	Service        string `json:"service,omitempty"`
	Namespace      string `json:"namespace,omitempty"`
	Environment    string `json:"environment,omitempty"`
	CommitterName  string `json:"committerName,omitempty"`
	CommitterEmail string `json:"committerEmail,omitempty"`
}

type RollbackResponse added in v0.0.10

type RollbackResponse struct {
	Service            string `json:"service,omitempty"`
	Status             string `json:"status,omitempty"`
	Environment        string `json:"environment,omitempty"`
	PreviousArtifactID string `json:"previousArtifactId,omitempty"`
	NewArtifactID      string `json:"newArtifactId,omitempty"`
}

type StatusRequest

type StatusRequest struct {
	Service string `json:"service,omitempty"`
}

type StatusResponse

type StatusResponse struct {
	DefaultNamespaces bool         `json:"defaultNamespaces,omitempty"`
	Dev               *Environment `json:"dev,omitempty"`
	Staging           *Environment `json:"staging,omitempty"`
	Prod              *Environment `json:"prod,omitempty"`
}

Jump to

Keyboard shortcuts

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