apiclient

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2018 License: MIT Imports: 6 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 string, httpClient HTTPClient) (*APIClient, error)

New creates a new APIClient

func (*APIClient) GetUploadDSCURL

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

GetUploadDSCURL returns the .dsc URL for a given upload

func (*APIClient) SetJobStatus added in v0.4.0

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

SetJobStatus will set the Job Status

func (*APIClient) SubmitJobLog added in v0.4.0

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