swiftservice

package
v5.0.0-...-abaee90 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stop

func Stop()

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

func (s *Swift) AddContainer(name string) error

AddContainer creates a new container with the given name, if it does not exist. Otherwise an error is returned.

func (*Swift) AddObject

func (s *Swift) AddObject(container, name string, data []byte) error

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

func (s *Swift) GetObject(container, name string) ([]byte, error)

GetObject retrieves a given object from its container, returning the object data or an error.

func (*Swift) GetURL

func (s *Swift) GetURL(container, object string) (string, error)

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

func (s *Swift) HasContainer(name string) bool

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

func (s *Swift) RemoveContainer(name string) error

RemoveContainer deletes an existing container with the given name.

func (*Swift) RemoveObject

func (s *Swift) RemoveObject(container, name string) error

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) SetupHTTP

func (s *Swift) SetupHTTP(mux *http.ServeMux)

setupHTTP attaches all the needed handlers to provide the HTTP API.

func (*Swift) Stop

func (s *Swift) Stop()

func (*Swift) V3Endpoints

func (s *Swift) V3Endpoints() []identityservice.V3Endpoint

Jump to

Keyboard shortcuts

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