repositories

package
v0.0.0-...-3349ed0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeTaskInMemoryDAO is an identifier to build TaskInMemoryDAO.
	TypeTaskInMemoryDAO = "TaskInMemoryDAO"
)
View Source
const (
	// TypeTaskPostgresDAO is an identifier to build TaskPostgresDAO.
	TypeTaskPostgresDAO = "TaskPostgresDAO"
)
View Source
const (
	// TypeTaskVoidDAO is an identifier to build TaskVoidDAO.
	TypeTaskVoidDAO = "TaskVoidDAO"
)

Variables

View Source
var (
	ErrFeatureNotImplemented = fmt.Errorf("feature not implemented")
	ErrNoRowAffected         = fmt.Errorf("no row affected")

	ErrDAOTypeNotFound *DAOTypeNotFoundError
	ErrNoDataFound     *NoDataFoundError
)

Functions

This section is empty.

Types

type DAOFactoryOptions

type DAOFactoryOptions struct {
	Type      string `mapstructure:"type"`
	Connector string `mapstructure:"connector"`
}

DAOFactoryOptions is the generic struct used by all DAO factory method patterns to build specific DAO.

type DAOTypeNotFoundError

type DAOTypeNotFoundError struct {
	Type string
}

func (*DAOTypeNotFoundError) Error

func (e *DAOTypeNotFoundError) Error() string

type FailToBuildDAOError

type FailToBuildDAOError struct {
	Type string
	Err  error
}

type ITaskDAO

type ITaskDAO interface {
	Create(ctx context.Context) (*model.Task, error)
	ReadByUUID(ctx context.Context) (*model.Task, error)
	ReadAll(ctx context.Context) ([]*model.Task, error)
	Update(ctx context.Context) error
	Delete(ctx context.Context) error
}

ITaskDAO is a DAO interface to manage Task.

func FactoryTaskDAO

func FactoryTaskDAO(opt DAOFactoryOptions) (ITaskDAO, error)

FactoryTaskDAO builds a new TaskDAO according to the typename.

func ProxyFactoryTaskDAO

func ProxyFactoryTaskDAO(opt DAOFactoryOptions) (ITaskDAO, error)

ProxyFactoryTaskDAO uses FactoryTaskDAO if the TaskDAO don't exist, and returns TaskDAO.

type InvalidContextError

type InvalidContextError struct {
	Key string
}

func (*InvalidContextError) Error

func (e *InvalidContextError) Error() string

type NoDataFoundError

type NoDataFoundError struct{}

func (*NoDataFoundError) Error

func (e *NoDataFoundError) Error() string

type TaskInMemoryDAO

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

TaskInMemoryDAO is a TaskDAO with not implemented features.

func (*TaskInMemoryDAO) Create

func (dao *TaskInMemoryDAO) Create(ctx context.Context) (*model.Task, error)

func (*TaskInMemoryDAO) Delete

func (dao *TaskInMemoryDAO) Delete(ctx context.Context) error

func (*TaskInMemoryDAO) ReadAll

func (dao *TaskInMemoryDAO) ReadAll(ctx context.Context) ([]*model.Task, error)

func (*TaskInMemoryDAO) ReadByUUID

func (dao *TaskInMemoryDAO) ReadByUUID(ctx context.Context) (*model.Task, error)

func (*TaskInMemoryDAO) Update

func (dao *TaskInMemoryDAO) Update(ctx context.Context) error

type TaskPostgresDAO

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

TaskPostgresDAO is a TaskDAO with not implemented features.

func (*TaskPostgresDAO) Create

func (dao *TaskPostgresDAO) Create(ctx context.Context) (*model.Task, error)

func (*TaskPostgresDAO) Delete

func (dao *TaskPostgresDAO) Delete(ctx context.Context) error

func (*TaskPostgresDAO) ReadAll

func (dao *TaskPostgresDAO) ReadAll(ctx context.Context) ([]*model.Task, error)

func (*TaskPostgresDAO) ReadByUUID

func (dao *TaskPostgresDAO) ReadByUUID(ctx context.Context) (*model.Task, error)

func (*TaskPostgresDAO) Update

func (dao *TaskPostgresDAO) Update(ctx context.Context) error

type TaskVoidDAO

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

TaskVoidDAO is a TaskDAO with not implemented features.

func (*TaskVoidDAO) Create

func (dao *TaskVoidDAO) Create(ctx context.Context) (*model.Task, error)

func (*TaskVoidDAO) Delete

func (dao *TaskVoidDAO) Delete(ctx context.Context) error

func (*TaskVoidDAO) ReadAll

func (dao *TaskVoidDAO) ReadAll(ctx context.Context) ([]*model.Task, error)

func (*TaskVoidDAO) ReadByUUID

func (dao *TaskVoidDAO) ReadByUUID(ctx context.Context) (*model.Task, error)

func (*TaskVoidDAO) Update

func (dao *TaskVoidDAO) Update(ctx context.Context) error

Jump to

Keyboard shortcuts

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