swift

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright 2025 Clyso GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Client

type Client interface {
	For(ctx context.Context, storage, account string) (*gophercloud.ServiceClient, error)
}

type Credentials

type Credentials struct {
	// Username - [REQUIRED] user name. Equal to openstack OS_USERNAME.
	Username string `yaml:"username"`
	// Password - [REQUIRED] user password. Equal to openstack OS_PASSWORD.
	Password string `yaml:"password"`
	// DomainName - [REQUIRED] user domain name. Equal to openstack OS_DOMAIN_NAME.
	DomainName string `yaml:"domainName"`
	// TenantName - [REQUIRED] tenant/project name. Equal to openstack OS_TENANT_NAME.
	TenantName string `yaml:"tenantName"`
}

func (Credentials) Validate

func (c Credentials) Validate() error

type DownloadOpts

type DownloadOpts struct {
	*objects.DownloadOpts
	Raw bool
}

Extends the gophercloud DownloadOpts to support swift "format=raw" query parameter.

func (*DownloadOpts) ToObjectDownloadParams

func (d *DownloadOpts) ToObjectDownloadParams() (map[string]string, string, error)

type Method

type Method uint8
const (
	UndefinedMethod Method = iota
	GetInfo
	GetAccount
	PostAccount
	HeadAccount
	DeleteAccount

	GetContainer
	PutContainer
	PostContainer
	HeadContainer
	DeleteContainer

	GetObject
	PutObject
	CopyObject
	DeleteObject
	HeadObject
	PostObject

	GetEndpoints
)

func ParseReq

func ParseReq(r *http.Request) (account string, container string, object string, method Method)

func (Method) String

func (i Method) String() string

type ProxyStorage

type ProxyStorage struct {
	StorageURL  string        `yaml:"storageURL"`
	HttpTimeout time.Duration `yaml:"httpTimeout"`
}

func (*ProxyStorage) Validate

func (s *ProxyStorage) Validate() error

type Storage

type Storage struct {
	// ProjectUsers - [OPTIONAL] user credentials per **projectID** (ex: 26720c5080bd4fd9af5b1e4a7dc565f8). If set, will be used to sync data within project.
	Credentials    map[string]Credentials `yaml:"credentials"`
	StorageAddress `yaml:",inline" mapstructure:",squash"`
}

func (*Storage) HasUser

func (s *Storage) HasUser(user string) bool

func (*Storage) UserList

func (s *Storage) UserList() []string

func (*Storage) Validate

func (s *Storage) Validate() error

type StorageAddress

type StorageAddress struct {
	// StorageEndpointName - [REQUIRED] name of the object storage endpoint in openstack keystone.
	StorageEndpointName string `yaml:"storageEndpointName"`
	// Keystone Endpoint service type. Default is "object-storage"
	StorageEndpointType string `yaml:"storageEndpointType"`
	// Region - [OPTIONAL] openstack region name.
	Region string `yaml:"region"`
	// AuthURL - [REQUIRED] keystone auth URL.
	AuthURL string `yaml:"authURL"`
}

Jump to

Keyboard shortcuts

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