Documentation ¶
Index ¶
- Constants
- func CreatePrefix(prefix string) (string, string)
- type DigitalOceanSpacesConfig
- func (c *DigitalOceanSpacesConfig) CreateClient() (*s3.Client, error)
- func (c *DigitalOceanSpacesConfig) Endpoint() string
- func (c *DigitalOceanSpacesConfig) GetClient() (s3.Client, error)
- func (c *DigitalOceanSpacesConfig) Merge(other *DigitalOceanSpacesConfig) error
- func (c *DigitalOceanSpacesConfig) RegisterFlags(f *flag.FlagSet, prefix string)
- func (c *DigitalOceanSpacesConfig) Validate() error
- func (c *DigitalOceanSpacesConfig) WithClient(client *s3.Client)
Constants ¶
const (
DEFAULT_ENDPOINT_SUFFIX = "digitaloceanspaces.com"
)
Variables ¶
This section is empty.
Functions ¶
func CreatePrefix ¶
create a (flag comptable, environment variable compatible), respectively, prefix. Useful for derived configurations that want to register their own flags for custom buckets. DO NOT use when running the 'RegisterFlags' function as it will be done on your behalf for the default flags.
Types ¶
type DigitalOceanSpacesConfig ¶
type DigitalOceanSpacesConfig struct { sync.RWMutex /// WARNING: use `.Endpoint()` instead for better default conditions InternalEndpoint string `toml:"endpoint"` AccessKeyID string `toml:"access_key_id"` SecretAccessKey string `toml:"secret_access_key"` Region string `toml:"region"` UsePathStyle bool `toml:"use_path_style"` UseHTTPS bool `toml:"use_https"` TLSSkipVerify bool `toml:"tls_skip_verify"` // contains filtered or unexported fields }
func (*DigitalOceanSpacesConfig) CreateClient ¶
func (c *DigitalOceanSpacesConfig) CreateClient() (*s3.Client, error)
func (*DigitalOceanSpacesConfig) Endpoint ¶
func (c *DigitalOceanSpacesConfig) Endpoint() string
func (*DigitalOceanSpacesConfig) GetClient ¶
func (c *DigitalOceanSpacesConfig) GetClient() (s3.Client, error)
Initialize Metrics + Tracing for the app. NOTE: you must call defer t.Stop() to propely cleanup
func (*DigitalOceanSpacesConfig) Merge ¶
func (c *DigitalOceanSpacesConfig) Merge(other *DigitalOceanSpacesConfig) error
func (*DigitalOceanSpacesConfig) RegisterFlags ¶
func (c *DigitalOceanSpacesConfig) RegisterFlags(f *flag.FlagSet, prefix string)
Register DigitalOceanSpacesConfig flags with the provided flag.FlagSet. The prefix must only container alphanumeric characters or periods for instance - `spaces`, `spaces.sfo3`, etc.
func (*DigitalOceanSpacesConfig) Validate ¶
func (c *DigitalOceanSpacesConfig) Validate() error
func (*DigitalOceanSpacesConfig) WithClient ¶
func (c *DigitalOceanSpacesConfig) WithClient(client *s3.Client)
set the s3 client manually. useful when writing tests with an already initialized client.
WARNING: if you use this parameter, be careful to not use CreateClient() as it will overwrite the manually set client. I don't currently have a good solution to get around this.