Documentation ¶
Index ¶
- Constants
- type FinishedFile
- type StartedFile
- type Utils
- func (u *Utils) CheckFinishedStatus(job string, buildNumber int) (bool, error)
- func (u *Utils) CheckStartedStatus(job string, buildNumber int) (*StartedFile, error)
- func (u *Utils) GetFileFromJenkinsGoogleBucket(job string, buildNumber int, path string) (*http.Response, error)
- func (u *Utils) GetGCSDirectoryURL() string
- func (u *Utils) GetGCSListURL() string
- func (u *Utils) GetLastestBuildNumberFromJenkinsGoogleBucket(job string) (int, error)
- func (u *Utils) GetPathToJenkinsGoogleBucket(job string, buildNumber int) string
- func (u *Utils) ListFilesInBuild(job string, buildNumber int, prefix string) ([]string, error)
- func (u *Utils) ListFilesWithPrefix(prefix string) ([]string, error)
Constants ¶
const ( // GCSListAPIURLTemplate is the template of GCS list api for a bucket GCSListAPIURLTemplate = "https://www.googleapis.com/storage/v1/b/%s/o" // GCSBucketURLTemplate is the tempalate for a GCS bucket directory GCSBucketURLTemplate = "https://storage.googleapis.com/%s/%s" // KubekinsBucket is the name of the kubekins bucket KubekinsBucket = "kubernetes-jenkins" // LogDir is the directory of kubekins LogDir = "logs" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FinishedFile ¶
FinishedFile is a type in which we store test result in GCS as finished.json
type StartedFile ¶
type StartedFile struct { Version string `json:"version"` Timestamp uint64 `json:"timestamp"` JenkinsNode string `json:"jenkins-node"` }
StartedFile is a type in which we store test starting informatio in GCS as started.json
type Utils ¶
type Utils struct {
// contains filtered or unexported fields
}
Utils is a struct handling all communication with a given bucket
func NewTestUtils ¶
NewTestUtils returnes new Utils struct for a given url pointing to a file server
func (*Utils) CheckFinishedStatus ¶
CheckFinishedStatus reads the finished.json file for a given job and build number. It returns true if the result stored there is success, and false otherwise.
func (*Utils) CheckStartedStatus ¶
func (u *Utils) CheckStartedStatus(job string, buildNumber int) (*StartedFile, error)
CheckStartedStatus reads the started.json file for a given job and build number. It returns true if the result stored there is success, and false otherwise.
func (*Utils) GetFileFromJenkinsGoogleBucket ¶
func (u *Utils) GetFileFromJenkinsGoogleBucket(job string, buildNumber int, path string) (*http.Response, error)
GetFileFromJenkinsGoogleBucket reads data from Google project's GCS bucket for the given job and buildNumber. Returns a response with file stored under a given (relative) path or an error.
func (*Utils) GetGCSDirectoryURL ¶
GetGCSDirectoryURL returns the url of the bucket directory
func (*Utils) GetGCSListURL ¶
GetGCSListURL returns the url to the list api
func (*Utils) GetLastestBuildNumberFromJenkinsGoogleBucket ¶
GetLastestBuildNumberFromJenkinsGoogleBucket reads a the number of last completed build of the given job from the Google project's GCS bucket .
func (*Utils) GetPathToJenkinsGoogleBucket ¶
GetPathToJenkinsGoogleBucket returns a GCS path containing the artifacts for a given job and buildNumber. This only formats the path. It doesn't include a host or protocol necessary for a full URI.
func (*Utils) ListFilesInBuild ¶
ListFilesInBuild takes build info and list all file names with matching prefix The returned file name included the complete path from bucket root