provider

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2025 License: MIT Imports: 20 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", "atl1", "blr1", "fra1", "lon1", "nyc3", "sfo2", "sfo3", "sgp1", "syd1", "tor1"},
	"dreamhost":    {"us-east-1"},
	"linode": {"us-east-1", "us-ord-1", "us-lax-1", "us-sea-1", "us-southeast-1", "us-mia-1", "us-sea-9",
		"us-iad-1", "us-iad-10", "id-cgk-1", "in-maa-1", "in-bom-1", "jp-osa-1", "jp-tyo-1", "ap-south-1", "sg-sin-1",
		"eu-central-1", "de-fra-1", "es-mad-1", "fr-par-1", "gb-lon-1", "it-mil-1", "nl-ams-1", "se-sto-1",
		"au-mel-1", "br-gru-1", "us-lax-4", "us-ord-10"},
	"scaleway": {"fr-par", "nl-ams", "pl-waw"},
	"wasabi": {"us-west-1", "us-east-1", "us-east-2", "us-central-1", "ca-central-1", "eu-west-1", "eu-west-2",
		"eu-west-3", "eu-central-1", "eu-central-2", "eu-south-1", "ap-northeast-1", "ap-northeast-2", "ap-southeast-2",
		"ap-southeast-1"},
}

Functions

func ClientHasCredentials

func ClientHasCredentials(client *s3.Client) bool

func HasCredentials

func HasCredentials(cfg aws.Config) (bool, string)

TODO: If user explicitly set profile name and we don't find creds, probably blow up returns:

  • bool - if there are credentials configured
  • string - AccessKeyID if credentials loaded

Types

type AWS

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

func NewProviderAWS

func NewProviderAWS() (*AWS, error)

func (*AWS) AddressStyle

func (a *AWS) AddressStyle() int

func (*AWS) BucketExists

func (a *AWS) BucketExists(b *bucket.Bucket) (*bucket.Bucket, error)

func (*AWS) Enumerate

func (a *AWS) Enumerate(b *bucket.Bucket) error

func (*AWS) Insecure

func (*AWS) Insecure() bool

func (*AWS) Name

func (*AWS) Name() string

func (*AWS) Scan

func (a *AWS) Scan(b *bucket.Bucket, doDestructiveChecks bool) error

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 DigitalOcean

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

func NewDigitalOcean

func NewDigitalOcean() (*DigitalOcean, error)

func (DigitalOcean) AddressStyle

func (pdo DigitalOcean) AddressStyle() int

func (DigitalOcean) BucketExists

func (pdo DigitalOcean) BucketExists(b *bucket.Bucket) (*bucket.Bucket, error)

func (DigitalOcean) Enumerate

func (pdo DigitalOcean) Enumerate(b *bucket.Bucket) error

func (DigitalOcean) Insecure

func (pdo DigitalOcean) Insecure() bool

func (DigitalOcean) Name

func (pdo DigitalOcean) Name() string

func (DigitalOcean) Scan

func (pdo DigitalOcean) Scan(bucket *bucket.Bucket, doDestructiveChecks bool) error

type Dreamhost

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

func NewProviderDreamhost

func NewProviderDreamhost() (*Dreamhost, error)

func (Dreamhost) AddressStyle

func (p Dreamhost) AddressStyle() int

func (Dreamhost) BucketExists

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

func (Dreamhost) Enumerate

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

func (Dreamhost) Insecure

func (p Dreamhost) Insecure() bool

func (Dreamhost) Name

func (Dreamhost) Name() string

func (Dreamhost) Scan

func (p Dreamhost) Scan(bucket *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 Linode

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

func NewProviderLinode

func NewProviderLinode() (*Linode, error)

func (*Linode) AddressStyle

func (*Linode) AddressStyle() int

func (*Linode) BucketExists

func (pl *Linode) BucketExists(b *bucket.Bucket) (*bucket.Bucket, error)

func (*Linode) Enumerate

func (pl *Linode) Enumerate(b *bucket.Bucket) error

func (*Linode) Insecure

func (*Linode) Insecure() bool

func (*Linode) Name

func (*Linode) Name() string

func (*Linode) Scan

func (pl *Linode) Scan(b *bucket.Bucket, doDestructiveChecks bool) error

type Scaleway

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

func NewProviderScaleway

func NewProviderScaleway() (*Scaleway, error)

func (*Scaleway) AddressStyle

func (*Scaleway) AddressStyle() int

func (*Scaleway) BucketExists

func (sc *Scaleway) BucketExists(b *bucket.Bucket) (*bucket.Bucket, error)

func (*Scaleway) Enumerate

func (sc *Scaleway) Enumerate(b *bucket.Bucket) error

func (*Scaleway) Insecure

func (*Scaleway) Insecure() bool

func (*Scaleway) Name

func (*Scaleway) Name() string

func (*Scaleway) Scan

func (sc *Scaleway) Scan(b *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)

type Wasabi

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

func NewProviderWasabi

func NewProviderWasabi() (*Wasabi, error)

func (*Wasabi) AddressStyle

func (w *Wasabi) AddressStyle() int

func (*Wasabi) BucketExists

func (w *Wasabi) BucketExists(b *bucket.Bucket) (*bucket.Bucket, error)

func (*Wasabi) Enumerate

func (w *Wasabi) Enumerate(b *bucket.Bucket) error

func (*Wasabi) Insecure

func (w *Wasabi) Insecure() bool

func (*Wasabi) Name

func (w *Wasabi) Name() string

func (*Wasabi) Scan

func (w *Wasabi) Scan(bucket *bucket.Bucket, doDestructiveChecks bool) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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