spaces

package module
v0.0.0-...-2be5f50 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePrefix

func CreatePrefix(prefix string) (string, string)

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

	Endpoint        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"`
	TLSSkipVerify   bool   `toml:"tls_skip_verify"`
	// contains filtered or unexported fields
}

func (*DigitalOceanSpacesConfig) CreateClient

func (c *DigitalOceanSpacesConfig) CreateClient() (*s3.Client, error)

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 (*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.

Jump to

Keyboard shortcuts

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