storage

package
v0.0.0-...-82468b1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// e.g. "2006-01-02T15:04:05Z"
	TimeFormat = time.RFC3339

	DeprecationWarning = "" /* 177-byte string literal not displayed */
)
View Source
const (
	S3Driver = "s3"
)

Variables

This section is empty.

Functions

func Setv2Handlers

func Setv2Handlers(svc *awss3.S3)

func Sign

func Sign(req *request.Request)

Sign requests with signature version 2.

Will sign the requests with the service config's Credentials object Signing is skipped if the credentials is the credentials.AnonymousCredentials object.

Types

type ByLastModified

type ByLastModified []*awss3.Object

func (ByLastModified) Len

func (a ByLastModified) Len() int

func (ByLastModified) Less

func (a ByLastModified) Less(i, j int) bool

func (ByLastModified) Swap

func (a ByLastModified) Swap(i, j int)

type Model

type Model struct {
	Driver string `json:"driver"`

	// S3 driver
	Bucket               string `json:"bucket"`
	BucketPath           string `json:"bucket_path"`
	AccessKeyID          string `json:"access_key_id"`
	SecretAccessKey      string `json:"secret_access_key"`
	RegionName           string `json:"region_name,omitempty"`            // optional
	Endpoint             string `json:"endpoint,omitempty"`               // optional
	UseSigningV2         bool   `json:"use_signing_v2,omitempty"`         // optional
	UseSigningV4         bool   `json:"use_signing_v4,omitempty"`         // optional
	ServerSideEncryption string `json:"server_side_encryption,omitempty"` //optional
	SSEKMSKeyId          string `json:"sse_kms_key_id,omitempty"`         //optional
}

func (Model) ShouldUseSigningV2

func (m Model) ShouldUseSigningV2() bool

func (Model) Validate

func (m Model) Validate() error

type PlanFile

type PlanFile struct {
	LocalPath     string
	RemotePath    string
	StorageDriver Storage
}

func (PlanFile) Delete

func (p PlanFile) Delete() (Version, error)

func (PlanFile) Download

func (p PlanFile) Download() (Version, error)

func (PlanFile) Exists

func (p PlanFile) Exists() (bool, error)

func (PlanFile) LatestVersion

func (p PlanFile) LatestVersion() (Version, error)

func (PlanFile) Upload

func (p PlanFile) Upload() (Version, error)

type StateFile

type StateFile struct {
	LocalPath     string
	RemotePath    string
	StorageDriver Storage
	// contains filtered or unexported fields
}

func (StateFile) ConvertFromTainted

func (s StateFile) ConvertFromTainted() StateFile

func (StateFile) ConvertToMigrated

func (s StateFile) ConvertToMigrated() StateFile

func (StateFile) ConvertToTainted

func (s StateFile) ConvertToTainted() StateFile

func (StateFile) Delete

func (s StateFile) Delete() (Version, error)

func (StateFile) Download

func (s StateFile) Download() (Version, error)

func (StateFile) Exists

func (s StateFile) Exists() (bool, error)

func (StateFile) ExistsAsTainted

func (s StateFile) ExistsAsTainted() (bool, error)

func (StateFile) IsTainted

func (s StateFile) IsTainted() bool

func (StateFile) LatestVersion

func (s StateFile) LatestVersion() (Version, error)

func (StateFile) Upload

func (s StateFile) Upload() (Version, error)

func (StateFile) UploadTainted

func (s StateFile) UploadTainted() error

type Storage

type Storage interface {
	Download(string, io.Writer) (Version, error)
	Upload(string, io.Reader) (Version, error)
	Delete(string) error
	Version(string) (Version, error)
	LatestVersion(string) (Version, error)
}

func BuildDriver

func BuildDriver(m Model) Storage

func NewS3

func NewS3(m Model) Storage

type Version

type Version struct {
	LastModified time.Time
	StateFile    string
	PlanFile     string
}

func (Version) IsZero

func (r Version) IsZero() bool

Jump to

Keyboard shortcuts

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