provider

package
v0.0.0-...-c544f1c Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PathStyle        = 0
	VirtualHostStyle = 1
)

Variables

View Source
var AllProviders = []string{
	"aws", "custom", "digitalocean", "dreamhost", "gcp", "linode", "scaleway",
}
View Source
var ProviderRegions = map[string][]string{
	"digitalocean": {"ams3", "blr1", "fra1", "nyc3", "sfo2", "sfo3", "sgp1", "syd1"},
	"dreamhost":    {"us-east-1"},
	"linode":       {"ap-south-1", "eu-central-1", "fr-par-1", "se-sto-1", "us-east-1", "us-iad-1", "us-ord-1", "us-southeast-1"},
	"scaleway":     {"fr-par", "nl-ams", "pl-waw"},
}

Functions

func NewProviderAWS

func NewProviderAWS() (*providerAWS, error)

func NewProviderDO

func NewProviderDO() (*providerDO, error)

func NewProviderLinode

func NewProviderLinode() (*providerLinode, error)

func NewProviderScaleway

func NewProviderScaleway() (*providerScaleway, error)

Types

type CustomProvider

type CustomProvider struct {
	// contains filtered or unexported fields
}

func NewCustomProvider

func NewCustomProvider(addressStyle string, insecure bool, regions []string, endpointFormat string) (*CustomProvider, error)

NewCustomProvider is a constructor which makes a new custom provider with the given options. addressStyle should either be "path" or "vhost"

func (CustomProvider) AddressStyle

func (cp CustomProvider) AddressStyle() int

func (CustomProvider) BucketExists

func (cp CustomProvider) BucketExists(b *bucket.Bucket) (*bucket.Bucket, error)

func (CustomProvider) Enumerate

func (cp CustomProvider) Enumerate(b *bucket.Bucket) error

func (CustomProvider) Insecure

func (cp CustomProvider) Insecure() bool

func (CustomProvider) Name

func (CustomProvider) Name() string

func (CustomProvider) Scan

func (cp CustomProvider) Scan(b *bucket.Bucket, doDestructiveChecks bool) error

type GCP

type GCP struct {
	// contains filtered or unexported fields
}

GCP like AWS, has a "universal" endpoint, but unlike AWS GCP does not require you to follow a redirect to the "proper" region. We can simply use storage.googleapis.com as the endpoint for all requests.

func NewProviderGCP

func NewProviderGCP() (*GCP, error)

func (GCP) AddressStyle

func (g GCP) AddressStyle() int

AddressStyle will return PathStyle, but GCP also supports VirtualHostStyle

func (GCP) BucketExists

func (g GCP) BucketExists(b *bucket.Bucket) (*bucket.Bucket, error)

func (GCP) Enumerate

func (g GCP) Enumerate(bucket *bucket.Bucket) error

func (GCP) Insecure

func (g GCP) Insecure() bool

func (GCP) Name

func (GCP) Name() string

func (GCP) Scan

func (g GCP) Scan(bucket *bucket.Bucket, doDestructiveChecks bool) error

type ProviderDreamhost

type ProviderDreamhost struct {
	// contains filtered or unexported fields
}

func NewProviderDreamhost

func NewProviderDreamhost() (*ProviderDreamhost, error)

func (ProviderDreamhost) AddressStyle

func (p ProviderDreamhost) AddressStyle() int

func (ProviderDreamhost) BucketExists

func (p ProviderDreamhost) BucketExists(b *bucket.Bucket) (*bucket.Bucket, error)

func (ProviderDreamhost) Enumerate

func (p ProviderDreamhost) Enumerate(b *bucket.Bucket) error

func (ProviderDreamhost) Insecure

func (p ProviderDreamhost) Insecure() bool

func (ProviderDreamhost) Name

func (ProviderDreamhost) Name() string

func (ProviderDreamhost) Scan

func (p ProviderDreamhost) Scan(bucket *bucket.Bucket, doDestructiveChecks bool) error

type StorageProvider

type StorageProvider interface {
	Insecure() bool
	AddressStyle() int
	BucketExists(*bucket.Bucket) (*bucket.Bucket, error)
	Scan(*bucket.Bucket, bool) error
	Enumerate(*bucket.Bucket) error
	Name() string
}

func NewProvider

func NewProvider(name string) (StorageProvider, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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