Documentation
¶
Index ¶
- Constants
- type Container
- type CreateContainerInput
- type DeleteContainerInput
- type GetContainerInput
- type StorageClient
- func (c *StorageClient) CreateContainer(input *CreateContainerInput) (*Container, error)
- func (c *StorageClient) DeleteContainer(input *DeleteContainerInput) error
- func (c *StorageClient) GetContainer(input *GetContainerInput) (*Container, error)
- func (c *StorageClient) UpdateContainer(input *UpdateContainerInput) (*Container, error)
- type UpdateContainerInput
Constants ¶
View Source
const AUTH_HEADER = "X-Auth-Token"
View Source
const CONTAINER_VERSION = "v1"
View Source
const STR_ACCOUNT = "/Storage-%s"
View Source
const STR_QUALIFIED_NAME = "%s%s/%s"
View Source
const STR_USERNAME = "/Storage-%s:%s"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// The name of the Container
Name string
// A container access control list (ACL) that grants read access.
ReadACLs []string
// A container access control list (ACL) that grants write access
WriteACLs []string
// The secret key value for temporary URLs.
PrimaryKey string
// The second secret key value for temporary URLs.
SecondaryKey string
// List of origins to be allowed to make cross-origin Requests.
AllowedOrigins []string
// Maximum age in seconds for the origin to hold the preflight results.
MaxAge int
}
Container describes an existing Container.
type CreateContainerInput ¶
type CreateContainerInput struct {
// The unique name for the container. The container name must be from 1 to 256 characters long and can
// start with any character and contain any pattern. Character set must be UTF-8. The container name
// cannot contain a slash (/) character because this character delimits the container and object name.
// For example, /account/container/object.
// Required
Name string `json:"name"`
// Sets a container access control list (ACL) that grants read access.
// Optional
ReadACLs []string
// Sets a container access control list (ACL) that grants read access.
// Optional
WriteACLs []string
// Sets a secret key value for temporary URLs.
// Optional
PrimaryKey string
// Sets a second secret key value for temporary URLs.
// Optional
SecondaryKey string
// Sets the list of origins allowed to make cross-origin requests.
// Optional
AllowedOrigins []string
// Sets the maximum age in seconds for the origin to hold the preflight results.
// Optional
MaxAge int
}
CreateContainerInput defines an Container to be created.
type DeleteContainerInput ¶
type DeleteContainerInput struct {
// The name of the Container
// Required
Name string `json:name`
}
DeleteKeyInput describes the container to delete
type GetContainerInput ¶
type GetContainerInput struct {
// The name of the Container
// Required
Name string `json:name`
}
GetContainerInput describes the container to get
type StorageClient ¶
type StorageClient struct {
// contains filtered or unexported fields
}
Client represents an authenticated compute client, with compute credentials and an api client.
func NewStorageClient ¶
func NewStorageClient(c *opc.Config) (*StorageClient, error)
func (*StorageClient) CreateContainer ¶
func (c *StorageClient) CreateContainer(input *CreateContainerInput) (*Container, error)
CreateContainer creates a new Container with the given name, key and enabled flag.
func (*StorageClient) DeleteContainer ¶
func (c *StorageClient) DeleteContainer(input *DeleteContainerInput) error
DeleteContainer deletes the Container with the given name.
func (*StorageClient) GetContainer ¶
func (c *StorageClient) GetContainer(input *GetContainerInput) (*Container, error)
GetContainer retrieves the Container with the given name.
func (*StorageClient) UpdateContainer ¶
func (c *StorageClient) UpdateContainer(input *UpdateContainerInput) (*Container, error)
UpdateContainer updates the key and enabled flag of the Container with the given name.
type UpdateContainerInput ¶
type UpdateContainerInput struct {
// The name of the Container
// Required
Name string `json:"name"`
// Updates a container access control list (ACL) that grants read access.
// Optional
ReadACLs []string
// Updates a container access control list (ACL) that grants write access.
// Optional
WriteACLs []string
// Updates the secret key value for temporary URLs.
// Optional
PrimaryKey string
// Update the second secret key value for temporary URLs.
// Optional
SecondaryKey string
// Updates the list of origins allowed to make cross-origin requests.
// Optional
AllowedOrigins []string
// Updates the maximum age in seconds for the origin to hold the preflight results.
// Optional
MaxAge int
}
UpdateContainerInput defines an Container to be updated
Click to show internal directories.
Click to hide internal directories.