s3

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigerNewer

type ConfigerNewer struct{}

ConfigerNewer implements the factory methods for the s3 provider.

func (*ConfigerNewer) Config

func (cn *ConfigerNewer) Config() error

Config takes input from the user to configure the s3 provider.

func (*ConfigerNewer) New

func (cn *ConfigerNewer) New() (storage.Provider, error)

New returns a usable instance of the s3 provider.

type IndexAlias

type IndexAlias struct {
	Alias          string       `json:"alias"`
	Domain         string       `json:"domain"`
	EmailAddresses []string     `json:"email_addresses"`
	Description    string       `json:"description"`
	Suspended      bool         `json:"suspended"`
	CreatedTS      metadataTime `json:"created_ts"`
	ModifiedTS     metadataTime `json:"modified_ts"`
	SuspendedTS    metadataTime `json:"suspended_ts"`
}

IndexAlias represents an alias as stored in the S3 index blob

func (*IndexAlias) FromAlias

func (ia *IndexAlias) FromAlias(a alias.Alias)

FromAlias converts an Alias to an internal S3 representation of an alias

func (*IndexAlias) ToAlias

func (ia *IndexAlias) ToAlias() alias.Alias

ToAlias converts the internal S3 representation of an alias to an Alias

type IndexAliases

type IndexAliases []IndexAlias

IndexAliases represent an array of aliases in the S3 index blob

type Storer

type Storer struct {
	// contains filtered or unexported fields
}

Storer implements the storage provder methods and state for the s3 provider.

func (*Storer) Close

func (s *Storer) Close() error

Close updates the index stored in S3 if the MD5 sum of the index JSON and key MD5 sum are different. An error is returned if there is a failure interacting with S3.

func (*Storer) Delete

func (s *Storer) Delete(alias, domain string) error

Delete removes the S3 key representing the alias. An error is returned if there is a failure interacting with S3.

func (*Storer) Description

func (s *Storer) Description() string

Description returns the description of the provider this package implements

func (*Storer) Get

func (s *Storer) Get(a, d string) (*alias.Alias, error)

Get HEADs a key in S3 and returns a pointer to an Alias. An error is returned if there is a failure interacting with S3.

func (*Storer) Open

func (s *Storer) Open(readOnly bool) error

Open prepares the s3 provider for use. The bucket will be listed and if the alias key is the newest key in the bucket listing, the index file is loaded. Otherwise, all alias keys are HEADed and their metadata is extracted and assembled into a slice of aliases. An error is returned if there is a failure interacting with S3.

func (*Storer) Put

func (s *Storer) Put(alias alias.Alias, updateModified bool) error

Put PUTs an Alias' content into an S3 key. The alias fields are stored in the key metadata. An error is returned if there is a failure interacting with S3.

func (*Storer) Search

func (s *Storer) Search(f alias.Filter, matchAnyRegexp bool) (alias.Aliases, error)

Search applies the filter to the internal map of aliases and returns a sorted list of aliases that match the filter criteria.

func (*Storer) Suspend

func (s *Storer) Suspend(alias, domain string) error

Suspend updates the S3 key representing the alias with the suspended flag and updates the suspended timestamp. An error is returned if there is a failure interacting with S3.

func (*Storer) Type

func (s *Storer) Type() string

Type returns the type of provider this package implements

func (*Storer) Unsuspend

func (s *Storer) Unsuspend(alias, domain string) error

Unsuspend updates the S3 key representing the alias with the suspended flag and updates the suspended timestamp. An error is returned if there is a failure interacting with S3.

func (*Storer) Update

func (s *Storer) Update(alias alias.Alias, updateModified bool) error

Update PUTs an Alias' content into an S3 key. The alias fields are stored in the key metadata. An error is returned if there is a failure interacting with S3.

Notes

Bugs

  • make configurable

  • pass the error back with the result...

Jump to

Keyboard shortcuts

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