dba

package
v0.0.0-...-0944201 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReadProfileNotFound   = "4AC6E407-1D8E-4339-BA1C-862ACC58AC5E"
	ReadProfileFound      = "20032259-738B-40A7-AAD7-306B69AF88D4"
	UpdateProfileNotFound = "E6096F2D-C706-42B6-B0E5-D7DD644ED079"
	UpdateProfile         = "AC032259-738B-40A7-AAD7-306B69AAB909"
)

Functions

func NewDBA

func NewDBA(r *DynamoRepository)

NewDBA sets the repository for the handlers

func NewTestDBA

func NewTestDBA(r *MockRepository)

Types

type Database

type Database interface {
	GetItem(ctx context.Context, getItemInput *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
	PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
}

type DynamoRepository

type DynamoRepository struct {
	App *config.AppConfig
	Svc Database
}

Repository is the repository type

var Repo *DynamoRepository

Repo the repository used by dynamo

func NewRepo

NewRepo creates a new repository

func (*DynamoRepository) ReadProfile

func (m *DynamoRepository) ReadProfile(id string) (model.ProfileResponse, error)

func (*DynamoRepository) UpdateProfile

func (m *DynamoRepository) UpdateProfile(id string, updateBody model.UpdateProfileRequest) (model.ProfileResponse, error)

type MockRepository

type MockRepository struct {
	App *config.AppConfig
	Svc *dynamodb.Client
}
var TestRepo *MockRepository

func (*MockRepository) ReadProfile

func (m *MockRepository) ReadProfile(id string) (model.ProfileResponse, error)

func (*MockRepository) UpdateProfile

func (m *MockRepository) UpdateProfile(id string, updateBody model.UpdateProfileRequest) (model.ProfileResponse, error)

type Repository

type Repository interface {
	ReadProfile(id string) (model.ProfileResponse, error)
	UpdateProfile(id string, updateBody model.UpdateProfileRequest) (model.ProfileResponse, error)
}

Jump to

Keyboard shortcuts

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