s3

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: MIT Imports: 9 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client() (*s3.Client, error)

Client returns an S3 client

func GetObject

func GetObject(bucket, key string) ([]byte, error)

GetObject returns an object from a bucket

func PutObject added in v0.3.0

func PutObject(bucket, key, body string) error

PutObject writes an object to a bucket

Types

type ConfigFile

type ConfigFile struct {
	Bucket      string
	Key         string
	Config      interface{}
	LastUpdated int64
	OnSuccess   func(*ConfigFile)
	OnError     func(*ConfigFile, error)
}

ConfigFile wraps a config from an S4 object

func GetConfig

func GetConfig(bucket, key string, config interface{}) (*ConfigFile, error)

GetConfig loads a config struct from an S3 object

func GetConfigFromEnv

func GetConfigFromEnv(config interface{}) (*ConfigFile, error)

GetConfigFromEnv loads a config struct using bucket/object names from the environment

func (*ConfigFile) Autoreload

func (c *ConfigFile) Autoreload(delay int)

Autoreload enables reloading every $interval seconds

func (*ConfigFile) Load

func (c *ConfigFile) Load() error

Load downloads and parses the S3 config object

Jump to

Keyboard shortcuts

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