repository

package
v0.0.0-...-26b21cb Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InmemoryRepository

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

InmemoryRepository in memory implementation of UserRepository

func NewInmemoryRepository

func NewInmemoryRepository(db map[primitive.ObjectID]*domain.User) *InmemoryRepository

NewInmemoryRepository function will initialize InmemoryRepository

func (*InmemoryRepository) Count

func (r *InmemoryRepository) Count(ctx context.Context, where *domain.User) shared.Result

Count function, function will count user data from InmemoryRepository with what filter

func (*InmemoryRepository) Find

func (r *InmemoryRepository) Find(ctx context.Context, where *domain.User) shared.Result

Find function, function will find user data from InmemoryRepository with where filter

func (*InmemoryRepository) Save

Save function, function will store user data into InmemoryRepository

type UserRepository

type UserRepository interface {
	Save(ctx context.Context, user *domain.User) shared.Result
	Find(ctx context.Context, where *domain.User) shared.Result
	Count(ctx context.Context, where *domain.User) shared.Result
}

UserRepository repository

Jump to

Keyboard shortcuts

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