Documentation ¶
Index ¶
- Constants
- Variables
- type DAOFactoryOptions
- type DAOTypeNotFoundError
- type FailToBuildDAOError
- type ITaskDAO
- type InvalidContextError
- type NoDataFoundError
- type TaskInMemoryDAO
- func (dao *TaskInMemoryDAO) Create(ctx context.Context) (*model.Task, error)
- func (dao *TaskInMemoryDAO) Delete(ctx context.Context) error
- func (dao *TaskInMemoryDAO) ReadAll(ctx context.Context) ([]*model.Task, error)
- func (dao *TaskInMemoryDAO) ReadByUUID(ctx context.Context) (*model.Task, error)
- func (dao *TaskInMemoryDAO) Update(ctx context.Context) error
- type TaskPostgresDAO
- func (dao *TaskPostgresDAO) Create(ctx context.Context) (*model.Task, error)
- func (dao *TaskPostgresDAO) Delete(ctx context.Context) error
- func (dao *TaskPostgresDAO) ReadAll(ctx context.Context) ([]*model.Task, error)
- func (dao *TaskPostgresDAO) ReadByUUID(ctx context.Context) (*model.Task, error)
- func (dao *TaskPostgresDAO) Update(ctx context.Context) error
- type TaskVoidDAO
- func (dao *TaskVoidDAO) Create(ctx context.Context) (*model.Task, error)
- func (dao *TaskVoidDAO) Delete(ctx context.Context) error
- func (dao *TaskVoidDAO) ReadAll(ctx context.Context) ([]*model.Task, error)
- func (dao *TaskVoidDAO) ReadByUUID(ctx context.Context) (*model.Task, error)
- func (dao *TaskVoidDAO) Update(ctx context.Context) error
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 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) ReadByUUID ¶
type TaskPostgresDAO ¶
type TaskPostgresDAO struct {
// contains filtered or unexported fields
}
TaskPostgresDAO is a TaskDAO with not implemented features.
func (*TaskPostgresDAO) ReadByUUID ¶
type TaskVoidDAO ¶
type TaskVoidDAO struct {
// contains filtered or unexported fields
}
TaskVoidDAO is a TaskDAO with not implemented features.
func (*TaskVoidDAO) ReadByUUID ¶
Click to show internal directories.
Click to hide internal directories.