s3

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package s3 provides implementation of the storage layer under AWS S3 service.

Index

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

func New(uri string) (*Store, error)

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) Close

func (s *Store) Close() (err error)

Close function does nothing as the connection is not persistent.

func (*Store) Delete

func (s *Store) Delete(name string) error

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

func (s *Store) Has(name string) (exists bool, err error)

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.

Jump to

Keyboard shortcuts

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