Versions in this module Expand all Collapse all v0 v0.1.11 Oct 23, 2020 Changes in this version + const AURPackage + const DMHost + const DMNamespace + const DMToken + const DMUser + const EPCcache + const EPCcacheClear + const EPCcacheStats + const EPJob + const EPJobAdd + const EPJobCancel + const EPJobInfo + const EPJobLogs + const EPJobPause + const EPJobResume + const EPJobState + const EPJobs + const EPLogin + const EPPing + const EPRegister + const EPUser + const HeaderContentLength + const HeaderContentType + const HeaderRequest + const HeaderStatus + const HeaderStatusMessage + var ErrInvalidResponseHeaders = errors.New("Invalid response headers") + var ErrResponseError = errors.New("response returned an error") + type AURBuild struct + DisableCcache bool + UploadType UploadType + func (aurBuild *AURBuild) CreateJob() (*AddJobResponse, error) + func (aurBuild *AURBuild) WithDmanager(username, token, host, namespace string) + func (aurBuild *AURBuild) WithoutCcache() *AURBuild + type AddJobRequest struct + Args map[string]string + DisableCcache bool + Type JobType + UploadType UploadType + type AddJobResponse struct + ID uint + Position int + type Authorization struct + Palyoad string + Type AuthorizationType + type AuthorizationType string + const Basic + const Bearer + type ContentType string + const JSONContentType + type CredentialsRequest struct + MachineID string + Password string + Username string + type Endpoint string + type JobInfo struct + BuildType JobType + Duration time.Duration + ID uint + Info string + Position uint + RunningSince time.Time + Status JobState + UploadType UploadType + type JobLogsRequest struct + JobID uint + Since time.Time + type JobRequest struct + JobID uint + type JobState uint8 + const JobCancelled + const JobDone + const JobFailed + const JobPaused + const JobRunning + const JobWaiting + func (js JobState) String() string + type JobType uint8 + const JobAUR + const JobNoBuild + func ParseJobType(inp string) JobType + func (jt JobType) String() string + type LibRB struct + Config *RequestConfig + func NewLibRB(config *RequestConfig) *LibRB + func (Librb LibRB) NewAURBuild(packageName string) *AURBuild + func (libdm LibRB) Request(ep Endpoint, payload, response interface{}, authorized bool) (*RestRequestResponse, error) + func (librb LibRB) AddJob(jobType JobType, uploadType UploadType, args map[string]string, ...) (*AddJobResponse, error) + func (librb LibRB) CancelJob(jobID uint) error + func (librb LibRB) ClearCcache() (string, error) + func (librb LibRB) JobInfo(jobID uint) (*JobInfo, error) + func (librb LibRB) ListJobs(limit int) (*ListJobsResponse, error) + func (librb LibRB) Login(username, password string) (*LoginResponse, error) + func (librb LibRB) Logs(jobID uint, since time.Time) (*RestRequestResponse, error) + func (librb LibRB) Ping() (*StringResponse, error) + func (librb LibRB) QueryCcache() (StringResponse, error) + func (librb LibRB) Register(username, password string) (*RestRequestResponse, error) + func (librb LibRB) SetJobState(jobID uint, state JobState) error + func (limdm *LibRB) NewRequest(endpoint Endpoint, payload interface{}) *Request + type ListJobsRequest struct + Limit int + type ListJobsResponse struct + Jobs []JobInfo + type LoginResponse struct + Token string + type Method string + const DELETE + const GET + const POST + const PUT + type PingRequest struct + Payload string + type Request struct + Authorization *Authorization + BenchChan chan time.Time + CloseBody bool + Config *RequestConfig + ContentType ContentType + Endpoint Endpoint + Headers map[string]string + Method Method + Payload interface{} + RequestType RequestType + func (request *Request) BuildClient() *http.Client + func (request *Request) DoHTTPRequest() (*http.Response, error) + func (request *Request) WithAuth(a Authorization) *Request + func (request *Request) WithAuthFromConfig() *Request + func (request *Request) WithBenchCallback(c chan time.Time) *Request + func (request *Request) WithContentType(ct ContentType) *Request + func (request *Request) WithHeader(name string, value string) *Request + func (request *Request) WithMethod(m Method) *Request + func (request *Request) WithNoBodyClose() *Request + func (request *Request) WithRequestType(rType RequestType) *Request + func (request Request) Do(retVar interface{}) (*RestRequestResponse, error) + type RequestConfig struct + IgnoreCert bool + MachineID string + SessionToken string + URL string + Username string + func (rc RequestConfig) GetBearerAuth() Authorization + type RequestType uint8 + const JSONRequestType + const RawRequestType + type ResponseErr struct + Err error + Response *RestRequestResponse + func NewErrorFromResponse(r *RestRequestResponse, err ...error) *ResponseErr + func (reserr *ResponseErr) Error() string + type ResponseStatus uint8 + const ResponseError + const ResponseSuccess + type RestRequestResponse struct + HTTPCode int + Headers *http.Header + Message string + Response *http.Response + Status ResponseStatus + type SortByJob []JobInfo + func (a SortByJob) Len() int + func (a SortByJob) Less(i, j int) bool + func (a SortByJob) Swap(i, j int) + type StringResponse struct + String string + type StringSliceResponse struct + Slice []string + type UploadType uint8 + const DataManagerUploadType + const LocalStorage + const NoUploadType + func ParseUploadType(s string) UploadType + func (ut UploadType) String() string