dynamodb

package
v0.0.0-...-eca6f23 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package dynamodb is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewmockDynamodbClient

func NewmockDynamodbClient(ctrl *gomock.Controller) *mockDynamodbClient

NewmockDynamodbClient creates a new mock instance.

Types

type DynamodbClient

type DynamodbClient interface {
	GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
	PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
	UpdateItem(ctx context.Context, params *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)
	DeleteItem(ctx context.Context, params *dynamodb.DeleteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error)
}

type ItemRepo

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

func NewItemRepo

func NewItemRepo(cfg *config.Config, driver DynamodbClient) *ItemRepo

func (*ItemRepo) Create

func (r *ItemRepo) Create(ctx context.Context, it domain.Item) (domain.Item, error)

Create creates a new item with the properties of the given item model.

func (*ItemRepo) Delete

func (r *ItemRepo) Delete(ctx context.Context, id string) error

Delete removes the item identified by the specified id.

func (*ItemRepo) Get

func (r *ItemRepo) Get(ctx context.Context, id string) (domain.Item, error)

Get retrieves the item identified by the specified id.

func (*ItemRepo) Update

func (r *ItemRepo) Update(ctx context.Context, id string, updates domain.Item) (domain.Item, error)

Create updates the fields of the item identified by id to match the fields of the given item model.

Jump to

Keyboard shortcuts

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