fetch

package
v0.0.84 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobDescription

type JobDescription struct {
	// The base name of the meta file (without the .json extension)
	MetaFile string
	// The pipeline ID for this job
	PipelineID int64
	// The name of the job
	JobName string
}

JobDescription describes a screwdriver job.

func ParseJobDescription

func ParseJobDescription(defaultPipelineID int64, external string) (*JobDescription, error)

ParseJobDescription parses the string of the form sd@123:jobName or jobName to create a new JobDescription object

func (*JobDescription) External

func (jd *JobDescription) External() string

External returns a representation of the JobDescription appropriate for use in meta get's --external flag

func (*JobDescription) MetaKey

func (jd *JobDescription) MetaKey() string

MetaKey returns a valid meta key unique to this job-description, which may be used for storing metadata

type LastSuccessfulMetaRequest

type LastSuccessfulMetaRequest struct {
	// SdToken is the screwdriver OAuth2 token
	SdToken string
	// SdAPIURL is the base url to the screwdriver rest API.
	SdAPIURL string

	// DefaultSdPipelineID is the default pipeline id to handle external names with just the jobName (no sd@pipelineId)
	DefaultSdPipelineID int64

	// Is the transport to use in calling the screwdriver REST apis (when nil, uses http.DefaultTransport)
	Transport http.RoundTripper
}

LastSuccessfulMetaRequest describes a request for the SD lastSuccessfulMeta API call.

func (*LastSuccessfulMetaRequest) FetchJobID

func (r *LastSuccessfulMetaRequest) FetchJobID(jobDescription *JobDescription) (int64, error)

FetchJobID fetches the job information from the given jobDescription, parses and returns the job id

func (*LastSuccessfulMetaRequest) FetchLastSuccessfulMeta

func (r *LastSuccessfulMetaRequest) FetchLastSuccessfulMeta(jobDescription *JobDescription) ([]byte, error)

FetchLastSuccessfulMeta fetches the last successful meta from the given jobDescription and returns raw data

func (*LastSuccessfulMetaRequest) GetTransport

func (r *LastSuccessfulMetaRequest) GetTransport() http.RoundTripper

GetTransport returns a non-nil transport, assigning the default when nil

func (*LastSuccessfulMetaRequest) JobForPipelineURL

func (r *LastSuccessfulMetaRequest) JobForPipelineURL(piplineID int64, jobName string) string

JobForPipelineURL returns the URL for using the screwdriver jobs REST API for a given pipelineID and jobName

func (*LastSuccessfulMetaRequest) JobIDFromJSONByName

func (r *LastSuccessfulMetaRequest) JobIDFromJSONByName(json, jobName string) (int64, error)

JobIDFromJSONByName extracts the ID of the given jobName from the json string

func (*LastSuccessfulMetaRequest) JobsForPipelineURL

func (r *LastSuccessfulMetaRequest) JobsForPipelineURL(piplineID int64) string

JobsForPipelineURL returns the URL for using the screwdriver jobs REST API for a given pipelineID

func (*LastSuccessfulMetaRequest) LastSuccessfulMetaURL

func (r *LastSuccessfulMetaRequest) LastSuccessfulMetaURL(jobID int64) string

LastSuccessfulMetaURL returns the URL for using the screwdriver lastSuccessfulMeta REST API

Jump to

Keyboard shortcuts

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