Documentation ¶
Index ¶
- Constants
- func FindBaseProfileFromQiniu(qc *Client, prowJobName, covProfileName string) ([]byte, error)
- func MockRouterAPI(router *httprouter.Router, profile string)
- type Artifacts
- type Client
- func (q *Client) GetAccessURL(key string, timeout time.Duration) string
- func (q *Client) GetArtifactDetails(key string) (*LogHistoryTemplate, error)
- func (q *Client) ListAll(ctx context.Context, prefix string, delimiter string) ([]string, error)
- func (q *Client) ListSubDirs(prefix string) ([]string, error)
- func (q *Client) QiniuObjectHandle(key string) *ObjectHandle
- func (q *Client) ReadObject(key string) ([]byte, error)
- type Config
- type LogHistoryTemplate
- type ObjectHandle
Constants ¶
const ( // ArtifactsDirName is the name of directory defined in prow to store test artifacts ArtifactsDirName = "artifacts" //default prow coverage file PostSubmitCoverProfile = "filtered.cov" //default to save changed file related coverage profile ChangedProfileName = "changed-file-profile.cov" )
Variables ¶
This section is empty.
Functions ¶
func FindBaseProfileFromQiniu ¶
FindBaseProfileFromQiniu finds the coverage profile file from the latest healthy build stored in given gcs directory
func MockRouterAPI ¶
func MockRouterAPI(router *httprouter.Router, profile string)
Types ¶
type Artifacts ¶
type Artifacts struct { Directory string ProfileName string ChangedProfileName string // create temporary to save changed file related coverage profile }
func (*Artifacts) CreateChangedProfile ¶
func (*Artifacts) ProfilePath ¶
type Client ¶
type Client struct { BucketManager *storage.BucketManager // contains filtered or unexported fields }
Client for the operation with qiniu cloud
func MockQiniuServer ¶
func MockQiniuServer(config *Config) (client *Client, router *httprouter.Router, serverURL string, teardown func())
func (*Client) GetAccessURL ¶
GetAccessURL return a url which can access artifact directly in qiniu
func (*Client) GetArtifactDetails ¶
func (q *Client) GetArtifactDetails(key string) (*LogHistoryTemplate, error)
Artifacts lists all artifacts available for the given job source
func (*Client) QiniuObjectHandle ¶
func (q *Client) QiniuObjectHandle(key string) *ObjectHandle
QiniuObjectHandle construct a object hanle to access file in qiniu
type Config ¶
type Config struct { Bucket string `json:"bucket"` AccessKey string `json:"accessKey"` SecretKey string `json:"secretKey"` // domain used to download files from qiniu cloud Domain string `json:"domain"` }
Config store the credentials to connect with qiniu cloud
type LogHistoryTemplate ¶
type ObjectHandle ¶
type ObjectHandle struct {
// contains filtered or unexported fields
}
ObjectHandle provides operations on an object in a qiniu cloud bucket
func (*ObjectHandle) NewRangeReader ¶
func (o *ObjectHandle) NewRangeReader(ctx context.Context, offset, length int64) (io.ReadCloser, error)
NewRangeReader reads parts of an object, reading at most length bytes starting from the given offset. If length is negative, the object is read until the end.
func (*ObjectHandle) NewReader ¶
func (o *ObjectHandle) NewReader(ctx context.Context) (io.ReadCloser, error)
NewReader creates a reader to read the contents of the object. ErrObjectNotExist will be returned if the object is not found. The caller must call Close on the returned Reader when done reading.