api

package
v0.0.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPClient

func NewHTTPClient(opts ...ClientOption) *http.Client

NewHTTPClient initializes an http.Client

Types

type AppClient

type AppClient struct {
}

type Client

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

func NewClient

func NewClient(opts ...ClientOption) *Client

NewClient initializes a Client

func NewClientFromHTTP

func NewClientFromHTTP(httpClient *http.Client) *Client

NewClientFromHTTP takes in an http.Client instance

func (Client) FullUrl

func (c Client) FullUrl(p string) string

func (Client) FullWebsocketUrl

func (c Client) FullWebsocketUrl(p string) string

func (Client) REST

func (c Client) REST(method string, p string, body io.Reader, data interface{}) error

REST performs a REST request and parses the response.

type ClientOption

type ClientOption = func(http.RoundTripper) http.RoundTripper

ClientOption represents an argument to NewClient

type HTTPError

type HTTPError struct {
	StatusCode int
	RequestURL *url.URL
	Message    string
}

HTTPError is an error returned by a failed API call

func (HTTPError) Error

func (err HTTPError) Error() string

type Job

type Job struct {
	Id       int64  `json:"id"`
	Name     string `orm:"unique" json:"name"`
	SpecText string `json:"spec_text"`
	Comment  string `json:"comment"`
}

type JobClient

type JobClient struct {
	Client
}

func NewJobClient

func NewJobClient(baseUrl string, accessTok string) *JobClient

func (*JobClient) Create

func (c *JobClient) Create(args *spec.CreateJobArgs) (*Job, error)

func (*JobClient) Delete

func (c *JobClient) Delete(name string) error

func (*JobClient) Get

func (c *JobClient) Get(name string) (*Job, error)

func (*JobClient) List

func (c *JobClient) List() ([]*Job, error)

func (*JobClient) Logs

func (c *JobClient) Logs(name string, podname string, cluster string, follow bool) (chan interface{}, error)

func (*JobClient) Upload

func (c *JobClient) Upload(jobname string, values map[string]io.Reader, respBody interface{}) (err error)

func (*JobClient) UploadArtifact

func (c *JobClient) UploadArtifact(jobname string, filename string, objKey string) (objUrl string, err error)

Jump to

Keyboard shortcuts

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