apiclient

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package apiclient implements a client for the autodeb-server REST API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

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

APIClient is a client for the autodeb-server REST API

func New

func New(serverURL, token string, httpClient HTTPClient) (*APIClient, error)

New creates a new APIClient

func (*APIClient) Aptly added in v0.13.0

func (c *APIClient) Aptly() *aptly.APIClient

Aptly returns a client to the aptly api

func (*APIClient) CreateJob added in v0.11.0

func (c *APIClient) CreateJob(job *models.Job) (*models.Job, error)

CreateJob will create a new job

func (*APIClient) GetArchiveBackport added in v0.20.0

func (c *APIClient) GetArchiveBackport(id uint) (*models.ArchiveBackport, error)

GetArchiveBackport will retrieve an ArchiveBackport by ID

func (*APIClient) GetArchiveUpgrade added in v0.11.0

func (c *APIClient) GetArchiveUpgrade(id uint) (*models.ArchiveUpgrade, error)

GetArchiveUpgrade will retrieve an archive upgrade by ID

func (*APIClient) GetArchiveUpgradeJobs added in v0.13.0

func (c *APIClient) GetArchiveUpgradeJobs(id uint) ([]*models.Job, error)

GetArchiveUpgradeJobs returns all jobs for an ArchiveUpgrade

func (*APIClient) GetArtifact added in v0.10.1

func (c *APIClient) GetArtifact(artifactID uint) (*models.Artifact, error)

GetArtifact will retrieve an artifact

func (*APIClient) GetArtifactContent added in v0.10.1

func (c *APIClient) GetArtifactContent(artifactID uint) (io.Reader, error)

GetArtifactContent will retrieve an artifact's content

func (*APIClient) GetCurrentUser added in v0.9.1

func (c *APIClient) GetCurrentUser() (*models.User, error)

GetCurrentUser will retrieve the current user

func (*APIClient) GetJob added in v0.9.1

func (c *APIClient) GetJob(jobID uint) (*models.Job, error)

GetJob will retrieve a job by ID

func (*APIClient) GetJobArtifactContent added in v0.10.1

func (c *APIClient) GetJobArtifactContent(jobID uint, filename string) (io.Reader, error)

GetJobArtifactContent will retrieve the content of a job's artifact

func (*APIClient) GetJobArtifacts added in v0.9.1

func (c *APIClient) GetJobArtifacts(jobID uint) ([]*models.Artifact, error)

GetJobArtifacts retrieves all artifacts associated with a job

func (*APIClient) GetJobLogContent added in v0.10.1

func (c *APIClient) GetJobLogContent(jobID uint) (io.Reader, error)

GetJobLogContent will retrieve the content of a job's log

func (*APIClient) GetUpload added in v0.10.1

func (c *APIClient) GetUpload(jobID uint) (*models.Upload, error)

GetUpload will retrieve an upload by its id

func (*APIClient) GetUploadChanges added in v0.10.1

func (c *APIClient) GetUploadChanges(uploadID uint) (io.Reader, error)

GetUploadChanges returns the .changes of an upload

func (*APIClient) GetUploadChangesURL added in v0.10.1

func (c *APIClient) GetUploadChangesURL(uploadID uint) *url.URL

GetUploadChangesURL returns the .changes URL for a given upload

func (*APIClient) GetUploadDSC added in v0.9.1

func (c *APIClient) GetUploadDSC(uploadID uint) (io.Reader, error)

GetUploadDSC returns the .dsc of an upload

func (*APIClient) GetUploadDSCURL

func (c *APIClient) GetUploadDSCURL(uploadID uint) *url.URL

GetUploadDSCURL returns the .dsc URL for a given upload

func (*APIClient) GetUploadFile added in v0.9.1

func (c *APIClient) GetUploadFile(uploadID uint, filename string) (io.Reader, error)

GetUploadFile returns an upload's file

func (*APIClient) GetUploadFiles added in v0.9.1

func (c *APIClient) GetUploadFiles(uploadID uint) ([]*models.FileUpload, error)

GetUploadFiles returns all files for an upload

func (*APIClient) SetJobStatus

func (c *APIClient) SetJobStatus(jobID uint, status models.JobStatus) error

SetJobStatus will set the Job Status

func (*APIClient) SetToken added in v0.9.1

func (c *APIClient) SetToken(token string)

SetToken will set the access token used by the client

func (*APIClient) SubmitJobArtifact added in v0.9.1

func (c *APIClient) SubmitJobArtifact(jobID uint, filename string, content io.Reader) (*models.Artifact, error)

SubmitJobArtifact will submit a job artifact

func (*APIClient) SubmitJobLog

func (c *APIClient) SubmitJobLog(jobID uint, jobLog io.Reader) error

SubmitJobLog will submit logs for a job

func (*APIClient) UnqueueNextJob

func (c *APIClient) UnqueueNextJob() (*models.Job, error)

UnqueueNextJob will return the next job on the queue

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

HTTPClient is needed for the APIClient to perform requests. Typically, it would be an &http.Client.

Jump to

Keyboard shortcuts

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