Documentation ¶
Index ¶
- Variables
- type Entity
- type Mgr
- func (m *Mgr) Create(ctx context.Context, e interface{}, pl io.Reader) (interface{}, error)
- func (m *Mgr) Delete(ctx context.Context, id xid.ID) error
- func (m *Mgr) Get(ctx context.Context, id xid.ID) (interface{}, error)
- func (m *Mgr) GetList(context.Context, crud.ListModifiers) (interface{}, error)
- func (m *Mgr) MapErrorToHTTPError(e error) *gohttperror.ErrResponse
- func (m *Mgr) NewEmptyEntity() interface{}
- func (m *Mgr) PartialUpdate(ctx context.Context, id xid.ID, pud crud.PartialUpdateData, pl io.Reader) error
- func (m *Mgr) Update(ctx context.Context, id xid.ID, newE interface{}, pl io.Reader) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is used for Get and GetList when no entity is found ErrNotFound = errors.New("entity not found") // ErrBadRequest is used when the request is malformed or wrong ErrBadRequest = errors.New("bad request") // ErrForbidden is used when the request is malformed or wrong ErrForbidden = errors.New("forbidden") )
Functions ¶
This section is empty.
Types ¶
type Mgr ¶
type Mgr struct { WantCreateError bool WantDeleteError bool WantGetError bool WantGetListError bool WantUpdateError bool WantPartialUpdateError bool EntityList map[xid.ID]*Entity }
Mgr is a mock for the mgr interface
func (*Mgr) MapErrorToHTTPError ¶
func (m *Mgr) MapErrorToHTTPError(e error) *gohttperror.ErrResponse
func (*Mgr) NewEmptyEntity ¶
func (m *Mgr) NewEmptyEntity() interface{}
func (*Mgr) PartialUpdate ¶
Click to show internal directories.
Click to hide internal directories.