dynamodb

package
v0.0.0-...-9ade0de Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadRange  = errors.New("invalid range")
	ErrNotExist  = errors.New("item does not exist")
	ErrBadFilter = errors.New("filter not valid")
)

Functions

func NewRepository

func NewRepository(config aws.Config, resources DynamoDBResources) services.Repository

Types

type DynamoDBRepository

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

func (*DynamoDBRepository) CreateClass

func (repo *DynamoDBRepository) CreateClass(ctx context.Context, class *models.Class) (err error)

func (*DynamoDBRepository) CreateDocument

func (repo *DynamoDBRepository) CreateDocument(ctx context.Context, doc *models.Document) (err error)

func (*DynamoDBRepository) CreateFile

func (repo *DynamoDBRepository) CreateFile(ctx context.Context, f *models.File) (location string, err error)

func (*DynamoDBRepository) CreateForm

func (repo *DynamoDBRepository) CreateForm(ctx context.Context, form *models.Form) (err error)

func (*DynamoDBRepository) CreateTemplate

func (repo *DynamoDBRepository) CreateTemplate(ctx context.Context, template *models.Template) (err error)

func (*DynamoDBRepository) CreateUploadUrl

func (repo *DynamoDBRepository) CreateUploadUrl(ctx context.Context, request models.FileUploadRequest) (response models.FileUploadResponse, err error)

func (*DynamoDBRepository) DeleteClass

func (repo *DynamoDBRepository) DeleteClass(ctx context.Context, id string) (err error)

func (*DynamoDBRepository) DeleteDocument

func (repo *DynamoDBRepository) DeleteDocument(ctx context.Context, id string) (err error)

func (*DynamoDBRepository) DeleteForm

func (repo *DynamoDBRepository) DeleteForm(ctx context.Context, id string) (err error)

func (*DynamoDBRepository) DeleteTemplate

func (repo *DynamoDBRepository) DeleteTemplate(ctx context.Context, id string) (err error)

func (*DynamoDBRepository) GetClassById

func (repo *DynamoDBRepository) GetClassById(ctx context.Context, id string) (class models.Class, err error)

func (*DynamoDBRepository) GetClassList

func (repo *DynamoDBRepository) GetClassList(ctx context.Context, filter models.ClassFilter) (list []models.Class, r models.Range, err error)

func (*DynamoDBRepository) GetDocumentById

func (repo *DynamoDBRepository) GetDocumentById(ctx context.Context, id string) (doc models.Document, err error)

Always fetches the latest version (v0)

func (*DynamoDBRepository) GetDocumentByPath

func (repo *DynamoDBRepository) GetDocumentByPath(ctx context.Context, path string) (doc models.Document, err error)

func (*DynamoDBRepository) GetDocumentList

func (repo *DynamoDBRepository) GetDocumentList(ctx context.Context, filter models.DocumentFilter) (list []models.Document, r models.Range, err error)

func (*DynamoDBRepository) GetFormById

func (repo *DynamoDBRepository) GetFormById(ctx context.Context, id string) (form models.Form, err error)

func (*DynamoDBRepository) GetFormList

func (repo *DynamoDBRepository) GetFormList(ctx context.Context, filter models.FormFilter) (list []models.Form, r models.Range, err error)

func (*DynamoDBRepository) GetTemplateById

func (repo *DynamoDBRepository) GetTemplateById(ctx context.Context, id string) (template models.Template, err error)

func (*DynamoDBRepository) GetTemplateList

func (repo *DynamoDBRepository) GetTemplateList(ctx context.Context, filter models.TemplateFilter) (list []models.Template, r models.Range, err error)

func (*DynamoDBRepository) UpdateClass

func (repo *DynamoDBRepository) UpdateClass(ctx context.Context, class *models.Class) (err error)

func (*DynamoDBRepository) UpdateDocument

func (repo *DynamoDBRepository) UpdateDocument(ctx context.Context, doc *models.Document) (err error)

func (*DynamoDBRepository) UpdateForm

func (repo *DynamoDBRepository) UpdateForm(ctx context.Context, form *models.Form) (err error)

func (*DynamoDBRepository) UpdateTemplate

func (repo *DynamoDBRepository) UpdateTemplate(ctx context.Context, template *models.Template) (err error)

type DynamoDBResources

type DynamoDBResources struct {
	Bucket       string
	StaticBucket string
	StaticDomain string
	Table        string
}

func (*DynamoDBResources) FromEnv

func (res *DynamoDBResources) FromEnv()

Jump to

Keyboard shortcuts

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