store

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

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

Go to latest
Published: Feb 6, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRecordNotFound = errors.New("record not found")
)

Functions

func NewDB

func NewDB(config *Config) (*sql.DB, error)

Types

type AppStore

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

func NewAppStore

func NewAppStore(ur UserRepository, lr ListRepository) *AppStore

func (*AppStore) List

func (s *AppStore) List() ListRepository

func (*AppStore) User

func (s *AppStore) User() UserRepository

type Config

type Config struct {
	DatabaseURL string
}

func NewConfig

func NewConfig() *Config

type ListRepository

type ListRepository interface {
	Create(*entity.List) error
	FindByID(int, int) (*entity.List, error)
	Edit(*entity.List) (*entity.List, error)
	Delete(*entity.List) error
	FindByUser(int) ([]*entity.List, error)
}

type Store

type Store interface {
	User() UserRepository
	List() ListRepository
}

type UserRepository

type UserRepository interface {
	Create(*entity.User) error
	FindByID(int) (*entity.User, error)
	FindByEmail(string) (*entity.User, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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