Documentation ¶
Index ¶
- func CreateBucketURL(name string, kind string, settings *jenkinsv1.TeamSettings) (string, error)
- func KubeProviderToBucketScheme(provider string) string
- func ReadBucketURL(u *url.URL, timeout time.Duration) ([]byte, error)
- func ReadHTTPURL(u string, headerFunc func(*http.Request), timeout time.Duration) ([]byte, error)
- func ReadURL(urlText string, timeout time.Duration, ...) ([]byte, error)
- func SplitBucketURL(u *url.URL) (string, string)
- func WriteBucket(bucketURL string, key string, data []byte, timeout time.Duration) error
- func WriteBucketURL(u *url.URL, data []byte, timeout time.Duration) error
- type LegacyBucketProvider
- func (LegacyBucketProvider) CreateNewBucketForCluster(clusterName string, bucketKind string) (string, error)
- func (LegacyBucketProvider) DownloadFileFromBucket(bucketURL string) (*bufio.Scanner, error)
- func (LegacyBucketProvider) EnsureBucketIsCreated(bucketURL string) error
- func (p *LegacyBucketProvider) Initialize(bucketURL string, classifier string) error
- func (p LegacyBucketProvider) UploadFileToBucket(reader io.Reader, outputName string, bucketURL string) (string, error)
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBucketURL ¶
CreateBucketURL creates a go-cloud URL to a bucket
func KubeProviderToBucketScheme ¶
KubeProviderToBucketScheme returns the bucket scheme for the cloud provider
func ReadBucketURL ¶
ReadBucketURL reads the content of a bucket URL of the for 's3://bucketName/foo/bar/whatnot.txt?param=123' where any of the query arguments are applied to the underlying Bucket URL and the path is extracted and resolved within the bucket
func ReadHTTPURL ¶
ReadHTTPURL reads the HTTP based URL, modifying the headers as needed, and returns the data or returning an error if a 2xx status is not returned
func ReadURL ¶
func ReadURL(urlText string, timeout time.Duration, httpFn func(urlString string) (string, func(*http.Request), error)) ([]byte, error)
ReadURL reads the given URL from either a http/https endpoint or a bucket URL path. if specified the httpFn is a function which can append the user/password or token and/or add a header with the token if using a git provider
func SplitBucketURL ¶
SplitBucketURL splits the full bucket URL into the URL to open the bucket and the file name to refer to within the bucket
func WriteBucket ¶
WriteBucket writes the data to a bucket URL and key of the for 's3://bucketName' and key 'foo/bar/whatnot.txt' with the given timeout
Types ¶
type LegacyBucketProvider ¶
type LegacyBucketProvider struct {
// contains filtered or unexported fields
}
LegacyBucketProvider is the default provider for non boot clusters
func (LegacyBucketProvider) CreateNewBucketForCluster ¶
func (LegacyBucketProvider) CreateNewBucketForCluster(clusterName string, bucketKind string) (string, error)
CreateNewBucketForCluster is not supported for LegacyBucketProvider
func (LegacyBucketProvider) DownloadFileFromBucket ¶
func (LegacyBucketProvider) DownloadFileFromBucket(bucketURL string) (*bufio.Scanner, error)
DownloadFileFromBucket is not supported for LegacyBucketProvider
func (LegacyBucketProvider) EnsureBucketIsCreated ¶
func (LegacyBucketProvider) EnsureBucketIsCreated(bucketURL string) error
EnsureBucketIsCreated is not supported for LegacyBucketProvider
func (*LegacyBucketProvider) Initialize ¶
func (p *LegacyBucketProvider) Initialize(bucketURL string, classifier string) error
Initialize initializes and opens a bucket object for the given bucketURL and classifier
func (LegacyBucketProvider) UploadFileToBucket ¶
func (p LegacyBucketProvider) UploadFileToBucket(reader io.Reader, outputName string, bucketURL string) (string, error)
UploadFileToBucket uploads a file to the provider specific bucket with the given outputName using the gocloud library
type Provider ¶
type Provider interface { // CreateNewBucketForCluster creates a new dynamically named bucket CreateNewBucketForCluster(clusterName string, bucketKind string) (string, error) EnsureBucketIsCreated(bucketURL string) error UploadFileToBucket(r io.Reader, outputName string, bucketURL string) (string, error) DownloadFileFromBucket(bucketURL string) (*bufio.Scanner, error) }
Provider represents a bucket provider
func NewLegacyBucketProvider ¶
func NewLegacyBucketProvider() Provider
NewLegacyBucketProvider create a new provider for non supported providers or non boot clusters