Documentation ¶
Index ¶
- func Stop()
- type Swift
- func (s *Swift) AddContainer(name string) error
- func (s *Swift) AddObject(container, name string, data []byte) error
- func (s *Swift) Endpoints() []identityservice.Endpoint
- func (s *Swift) GetObject(container, name string) ([]byte, error)
- func (s *Swift) GetURL(container, object string) (string, error)
- func (s *Swift) HasContainer(name string) bool
- func (s *Swift) ListContainer(name string, params map[string]string) ([]swift.ContainerContents, error)
- func (s *Swift) RemoveContainer(name string) error
- func (s *Swift) RemoveObject(container, name string) error
- func (s *Swift) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Swift) SetupHTTP(mux *http.ServeMux)
- func (s *Swift) Stop()
- func (s *Swift) V3Endpoints() []identityservice.V3Endpoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Swift ¶
type Swift struct { testservices.ServiceInstance // contains filtered or unexported fields }
func New ¶
func New(hostURL, versionPath, tenantId, region string, identityService, fallbackIdentity identityservice.IdentityService) *Swift
New creates an instance of the Swift object, given the parameters.
func (*Swift) AddContainer ¶
AddContainer creates a new container with the given name, if it does not exist. Otherwise an error is returned.
func (*Swift) AddObject ¶
AddObject creates a new object with the given name in the specified container, setting the object's data. It's an error if the object already exists. If the container does not exist, it will be created.
func (*Swift) Endpoints ¶
func (s *Swift) Endpoints() []identityservice.Endpoint
func (*Swift) GetObject ¶
GetObject retrieves a given object from its container, returning the object data or an error.
func (*Swift) GetURL ¶
GetURL returns the full URL, which can be used to GET the object. An error occurs if the object does not exist.
func (*Swift) HasContainer ¶
HasContainer verifies the given container exists or not.
func (*Swift) ListContainer ¶
func (s *Swift) ListContainer(name string, params map[string]string) ([]swift.ContainerContents, error)
ListContainer lists the objects in the given container. params contains filtering attributes: prefix, delimiter, marker. Only prefix is currently supported.
func (*Swift) RemoveContainer ¶
RemoveContainer deletes an existing container with the given name.
func (*Swift) RemoveObject ¶
RemoveObject deletes an existing object in a given container.
func (*Swift) ServeHTTP ¶
func (s *Swift) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP is the main entry point in the HTTP request processing.
func (*Swift) V3Endpoints ¶
func (s *Swift) V3Endpoints() []identityservice.V3Endpoint