Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrS3ClientNil is returned when s3 client is nil ErrS3ClientNil = errors.New("s3: AWS S3 Client is nil") // ErrOptionWithBucketNil is returned when WitBucket option is nil ErrOptionWithBucketNil = errors.New("s3: option WithBucket is nil") // ErrOptionWithKeyNil is returned when WithKey option is nil ErrOptionWithKeyNil = errors.New("s3: option WithKey is nil") // ErrStateNil is returned when state is nil ErrStateNil = errors.New("s3: state is nil") )
Functions ¶
This section is empty.
Types ¶
type DiskRepository ¶
type DiskRepository struct {
// contains filtered or unexported fields
}
DiskRepository represents a disk based state repository and implement core.StateRepository interface
func NewDiskRepository ¶
func NewDiskRepository(stateFile io.ReadWriter) (*DiskRepository, error)
NewDiskRepository creates a new disk based state repository
type ErrReadingStateFile ¶ added in v0.0.14
type ErrReadingStateFile struct {
Message string
}
ErrReadingStateFile, the state file is empty.
func (*ErrReadingStateFile) Error ¶ added in v0.0.14
func (e *ErrReadingStateFile) Error() string
func (*ErrReadingStateFile) ErrorCode ¶ added in v0.0.14
func (e *ErrReadingStateFile) ErrorCode() string
func (*ErrReadingStateFile) ErrorMessage ¶ added in v0.0.14
func (e *ErrReadingStateFile) ErrorMessage() string
type ErrStateFileEmpty ¶ added in v0.0.14
type ErrStateFileEmpty struct {
Message string
}
ErrStateFileEmpty, the state file is empty.
func (*ErrStateFileEmpty) Error ¶ added in v0.0.14
func (e *ErrStateFileEmpty) Error() string
func (*ErrStateFileEmpty) ErrorCode ¶ added in v0.0.14
func (e *ErrStateFileEmpty) ErrorCode() string
func (*ErrStateFileEmpty) ErrorMessage ¶ added in v0.0.14
func (e *ErrStateFileEmpty) ErrorMessage() string
type ErrStateFileNil ¶
type ErrStateFileNil struct {
Message string
}
ErrStateFileNil, the state file is empty.
func (*ErrStateFileNil) Error ¶ added in v0.0.14
func (e *ErrStateFileNil) Error() string
func (*ErrStateFileNil) ErrorCode ¶ added in v0.0.14
func (e *ErrStateFileNil) ErrorCode() string
func (*ErrStateFileNil) ErrorMessage ¶ added in v0.0.14
func (e *ErrStateFileNil) ErrorMessage() string
type S3ClientAPI ¶
type S3ClientAPI interface { GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error) PutObject(ctx context.Context, params *s3.PutObjectInput, optFns ...func(*s3.Options)) (*s3.PutObjectOutput, error) }
S3ClientAPI is an interface to consume S3 client methods
type S3Repository ¶
type S3Repository struct {
// contains filtered or unexported fields
}
S3Repository represent a repository that stores state in S3 and implements model.Repository interface
func NewS3Repository ¶
func NewS3Repository(client S3ClientAPI, opts ...S3RepositoryOption) (*S3Repository, error)
NewS3Repository returns a new S3Repository
type S3RepositoryOption ¶
type S3RepositoryOption func(*S3Repository)
S3RepositoryOption is a function that can be used to configure a S3Repository using the functional options pattern.
func WithBucket ¶
func WithBucket(bucket string) S3RepositoryOption
WithBucket sets the name for the S3 Bucket.