client

package
v0.0.0-...-d938d8c Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSObjectClient

type AWSObjectClient struct {
	ObjectClient
	// contains filtered or unexported fields
}

func (*AWSObjectClient) Auth

func (aws *AWSObjectClient) Auth(opts *ObjectOpts) error

func (*AWSObjectClient) CreateBucket

func (aws *AWSObjectClient) CreateBucket(bucketName string) error

func (*AWSObjectClient) Credentials

func (aws *AWSObjectClient) Credentials(userName, bucketName string) (string, string, error)

func (*AWSObjectClient) DeleteBucket

func (aws *AWSObjectClient) DeleteBucket(bucketName string) error

func (*AWSObjectClient) DeleteUser

func (aws *AWSObjectClient) DeleteUser(userName string) error

func (*AWSObjectClient) ListBuckets

func (aws *AWSObjectClient) ListBuckets() ([]string, error)

func (*AWSObjectClient) Provider

func (aws *AWSObjectClient) Provider() string

type Client

type Client struct {
	*gitea.Client
	Instance *hyperv1.Gitea

	CA []byte
	// contains filtered or unexported fields
}

func Build

func Build(ctx context.Context, r rclient.Client, instance *hyperv1.InstanceType, ns string) (*Client, *hyperv1.Gitea, error)

func BuildFromOrg

func BuildFromOrg(ctx context.Context, r rclient.Client, instance *hyperv1.OrgRef, ns string) (*Client, *hyperv1.Gitea, error)

func BuildFromSecret

func BuildFromSecret(ctx context.Context, r rclient.Client, secretName, namespace string) (*Client, error)

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

func (*Client) Get

func (c *Client) Get(url string) (resp *http.Response, err error)

func (*Client) GetJSON

func (c *Client) GetJSON(url string) (resp *http.Response, err error)

func (*Client) Post

func (c *Client) Post(url, contentType string, body io.Reader) (resp *http.Response, err error)

type GCPObjectClient

type GCPObjectClient struct {
	ObjectClient
	// contains filtered or unexported fields
}

func (*GCPObjectClient) Auth

func (gcp *GCPObjectClient) Auth(opts *ObjectOpts) error

func (*GCPObjectClient) CreateBucket

func (gcp *GCPObjectClient) CreateBucket(bucketName string) error

func (*GCPObjectClient) Credentials

func (gcp *GCPObjectClient) Credentials(userName, bucketName string) (string, string, error)

func (*GCPObjectClient) DeleteBucket

func (gcp *GCPObjectClient) DeleteBucket(bucketName string) error

func (*GCPObjectClient) DeleteUser

func (gcp *GCPObjectClient) DeleteUser(userName string) error

func (*GCPObjectClient) ListBuckets

func (gcp *GCPObjectClient) ListBuckets() ([]string, error)

func (*GCPObjectClient) Provider

func (gcp *GCPObjectClient) Provider() string

type MinioObjectClient

type MinioObjectClient struct {
	ObjectClient
	// contains filtered or unexported fields
}

func (*MinioObjectClient) Auth

func (mc *MinioObjectClient) Auth(opts *ObjectOpts) error

func (*MinioObjectClient) CreateBucket

func (mc *MinioObjectClient) CreateBucket(bucketName string) error

func (*MinioObjectClient) Credentials

func (mc *MinioObjectClient) Credentials(userName, bucketName string) (string, string, error)

func (*MinioObjectClient) DeleteBucket

func (mc *MinioObjectClient) DeleteBucket(bucketName string) error

func (*MinioObjectClient) DeleteUser

func (mc *MinioObjectClient) DeleteUser(userName string) error

func (*MinioObjectClient) ListBuckets

func (mc *MinioObjectClient) ListBuckets() ([]string, error)

func (*MinioObjectClient) Provider

func (mc *MinioObjectClient) Provider() string

type ObjectClient

type ObjectClient interface {
	// Authenticate with the Cloud Provider.
	Auth(opts *ObjectOpts) error
	// ListBuckets lists all buckets.
	ListBuckets() ([]string, error)
	// CreateBucket creates a new bucket.
	CreateBucket(bucketName string) error
	// DeleteBucket deletes a bucket.
	DeleteBucket(bucketName string) error
	// Create Cloud Provider specific credentials.
	Credentials(userName, bucketName string) (string, string, error)
	// Delete a user
	DeleteUser(userName string) error
	// Get the Cloud Provider
	Provider() string
}

func NewObjectClient

func NewObjectClient(ctx context.Context, opts *ObjectOpts) (ObjectClient, error)

type ObjectOpts

type ObjectOpts struct {
	CloudProvider string
	Endpoint      string
	Region        string
	AccessKey     string
	SecretKey     string
	TLS           bool
}

Jump to

Keyboard shortcuts

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