Documentation ¶
Index ¶
- Variables
- func GenDocItemOutput(doc entity.Document) *dynamodb.GetItemOutput
- type AttachCommand
- type CreateCommand
- type DynamoDBAPI
- type DynamoDBGetter
- type DynamoDBPutter
- type Loader
- type MockDynamo
- type MockS3
- type MockS3PreSign
- type PreSigner
- type S3PreSigner
- type S3Putter
- type Saver
- type Uploader
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAttDecode = errors.New("document attachment can not be decoded")
View Source
var ErrAttPreSign = errors.New("preSigned url cannot be created")
View Source
var ErrAttUpload = errors.New("document attachment cannot be saved in storage")
View Source
var ErrDocCreate = errors.New("technical issue while the document was created")
View Source
var ErrDocLoader = errors.New("document cannot be retrieved from the database")
View Source
var ErrDocMarshal = errors.New("document can not be marshaled")
View Source
var ErrDocNotFound = errors.New("document cannot be found in the database")
View Source
var ErrDocSave = errors.New("document cannot be saved in the database")
View Source
var ErrDocUnMarshal = errors.New("document can not be marshaled")
Functions ¶
func GenDocItemOutput ¶
func GenDocItemOutput(doc entity.Document) *dynamodb.GetItemOutput
Types ¶
type AttachCommand ¶
type AttachCommand struct {
// contains filtered or unexported fields
}
func NewAttachCommand ¶
func NewAttachCommand(s3s S3Putter, s3p S3PreSigner, ddb DynamoDBGetter, log *zap.SugaredLogger) AttachCommand
func (AttachCommand) Execute ¶
func (a AttachCommand) Execute(ctx context.Context, attachment domain.Attachment) (domain.PreSignedUrl, error)
type CreateCommand ¶
type CreateCommand struct {
// contains filtered or unexported fields
}
func NewCreateCommand ¶
func NewCreateCommand(ddb DynamoDBAPI, log *zap.SugaredLogger) CreateCommand
type DynamoDBAPI ¶
type DynamoDBAPI interface { DynamoDBPutter }
type DynamoDBGetter ¶
type DynamoDBGetter interface { GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error) }
type DynamoDBPutter ¶
type DynamoDBPutter interface { PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error) }
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
func NewLoader ¶
func NewLoader(ddb DynamoDBGetter, log *zap.SugaredLogger) Loader
type MockDynamo ¶
type MockDynamo struct { GetItemOut *dynamodb.GetItemOutput GetItemIn *dynamodb.GetItemInput ErrGetItem error PutItemOut *dynamodb.PutItemOutput PutItemIn *dynamodb.PutItemInput ErrPutItem error }
func (*MockDynamo) GetItem ¶
func (m *MockDynamo) GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
func (*MockDynamo) PutItem ¶
func (m *MockDynamo) PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
type MockS3 ¶
type MockS3 struct { PutObjOut *s3.PutObjectOutput PutObjIn *s3.PutObjectInput ErrPutObj error }
type MockS3PreSign ¶
type MockS3PreSign struct { PutObjOut *v4.PresignedHTTPRequest ErrGetObj error }
func (*MockS3PreSign) PresignGetObject ¶
func (m *MockS3PreSign) PresignGetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(options *s3.PresignOptions)) (*v4.PresignedHTTPRequest, error)
type PreSigner ¶
type PreSigner struct {
// contains filtered or unexported fields
}
func NewPreSigner ¶
func NewPreSigner(s3s S3PreSigner, log *zap.SugaredLogger) PreSigner
func (PreSigner) PreSign ¶
func (p PreSigner) PreSign(ctx context.Context, attachment domain.Attachment) (domain.PreSignedUrl, error)
type S3PreSigner ¶
type S3PreSigner interface { PresignGetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(options *s3.PresignOptions)) (*v4.PresignedHTTPRequest, error) }
type S3Putter ¶
type S3Putter interface { PutObject(ctx context.Context, params *s3.PutObjectInput, optFns ...func(*s3.Options)) (*s3.PutObjectOutput, error) }
type Saver ¶
type Saver struct {
// contains filtered or unexported fields
}
func NewSaver ¶
func NewSaver(ddb DynamoDBPutter, log *zap.SugaredLogger) *Saver
Source Files ¶
Click to show internal directories.
Click to hide internal directories.