Documentation ¶
Overview ¶
Package s3 provides implementation of the storage layer under AWS S3 service.
Index ¶
- type Store
- func (s *Store) Close() (err error)
- func (s *Store) Delete(name string) error
- func (s *Store) Get(name string) (config transaction.Config, err error)
- func (s *Store) Has(name string) (exists bool, err error)
- func (s *Store) Iter(callback func(name string, config transaction.Config) (proceed bool)) (err error)
- func (s *Store) Set(name string, config transaction.Config) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a S3 transaction config store
func New ¶
New function creates a new storage object with a subtype of s3. receives uri which should be in the form of s3://<access>:<secret>/<bucket>/<prefix>. returns a store with subtype s3.
func (*Store) Delete ¶
Delete function deletes the object from the s3 bucket. receives a string with the path of the object to be deleted. returns an error in case of failing to delete the object.
func (*Store) Get ¶
func (s *Store) Get(name string) (config transaction.Config, err error)
Get function gets a transaction object from the s3 bucket. receives a string with the path to the object. returns a transaction configuration and an error in case the object is not found (or any unexpected behaviour).
func (*Store) Has ¶
Has function return true or false for either the object exists or not in the s3 bucket. receives a string with the path to the object. returns a boolean (true if object exists, false otherwise) and an error in case of unexpected behaviour.
func (*Store) Iter ¶
func (s *Store) Iter(callback func(name string, config transaction.Config) (proceed bool)) (err error)
Iter function iterates through the list of objects in the S3 bucket. receives a callback function to operate on the data and decide if continues. returns error in case of unexpected behaviour
func (*Store) Set ¶
func (s *Store) Set(name string, config transaction.Config) (err error)
Set function puts a new object or replaces an existing one from the s3 bucket. receives a string as the path to identify the object to be put and a transaction configuration which will be the effective object to be written. returns an error in case of unexpected behaviour.