Documentation ¶
Index ¶
- type BackendConfig
- type Client
- func (c *Client) BackendName() string
- func (c *Client) Bucket() string
- func (c *Client) BucketExists(ctx context.Context, name string) (bool, error)
- func (c *Client) Connect(ctx context.Context) error
- func (c *Client) Disconnect(ctx context.Context) error
- func (c *Client) Name() string
- func (c *Client) ObjectExists(ctx context.Context, name string) (bool, error)
- func (c *Client) UploadFile(ctx context.Context, name string, file *[]byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendConfig ¶
type BackendConfig struct { BackendName string `yaml:"name"` Username string `yaml:"username"` APIKey string `yaml:"apikey"` AuthURL string `yaml:"authurl"` Region string `yaml:"region"` Container string `yaml:"container"` ExpireSeconds int `yaml:"expireseconds"` }
BackendConfig is the data structure containing all information required to connect to a single OpenStack Swift server
func (*BackendConfig) Name ¶
func (conf *BackendConfig) Name() string
Name returns the name configured for this OpenStack Swift Backend
func (*BackendConfig) Validate ¶
func (conf *BackendConfig) Validate() error
Validate validates the OpenStack Swift Backend and returns the first error that occured during validation.
type Client ¶
type Client struct { Conn swift.Connection Config BackendConfig }
Client is an OpenStack Swift Client Object
func New ¶
func New(ctx context.Context, conf BackendConfig) *Client
New creates a new OpenStack Swift client
func (*Client) BackendName ¶
BackendName returns 'OpenStack Swift'
func (*Client) BucketExists ¶
BucketExists returns if a particular bucket exists and is reachable by the OpenStack Swift client
func (*Client) Connect ¶
Connect connects the OpenStack Swift client to the backend service and authenticates
func (*Client) Disconnect ¶
Disconnect terminates the connection of the OpenStack Swift client with the backend server
func (*Client) ObjectExists ¶
ObjectExists returns if a particular object exists and is reachable by the OpenStack Swift client