Documentation ¶
Index ¶
- func Create(bctx bahamut.Context, m manipulate.Manipulator, obj elemental.Identifiable, ...) error
- func Delete(bctx bahamut.Context, m manipulate.Manipulator, obj elemental.Identifiable, ...) error
- func Info(bctx bahamut.Context, m manipulate.Manipulator, identity elemental.Identity) error
- func Retrieve(bctx bahamut.Context, m manipulate.Manipulator, obj elemental.Identifiable) error
- func RetrieveMany(bctx bahamut.Context, m manipulate.Manipulator, objs elemental.Identifiables, ...) error
- func Update(bctx bahamut.Context, m manipulate.Manipulator, obj elemental.Identifiable, ...) error
- type ErrPreWriteHook
- type Option
- type PostWriteHook
- type PreWriteHook
- type Timeable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(bctx bahamut.Context, m manipulate.Manipulator, obj elemental.Identifiable, opts ...Option) error
Create performs the basic create operation.
func Delete ¶
func Delete(bctx bahamut.Context, m manipulate.Manipulator, obj elemental.Identifiable, opts ...Option) error
Delete performs the basic delete operation.
func Info ¶
func Info(bctx bahamut.Context, m manipulate.Manipulator, identity elemental.Identity) error
Info performs the basic info operation.
func Retrieve ¶
func Retrieve(bctx bahamut.Context, m manipulate.Manipulator, obj elemental.Identifiable) error
Retrieve performs the basic retrieve operation.
func RetrieveMany ¶
func RetrieveMany(bctx bahamut.Context, m manipulate.Manipulator, objs elemental.Identifiables, opts ...Option) error
RetrieveMany performs the basic retrieve many operation.
func Update ¶
func Update(bctx bahamut.Context, m manipulate.Manipulator, obj elemental.Identifiable, opts ...Option) error
Update performs the basic update operation.
Types ¶
type ErrPreWriteHook ¶
type ErrPreWriteHook struct {
Err error
}
A ErrPreWriteHook is the kind of error returned when execution of a pre write hook fails.
func (ErrPreWriteHook) Error ¶
func (e ErrPreWriteHook) Error() string
func (ErrPreWriteHook) Unwrap ¶
func (e ErrPreWriteHook) Unwrap() error
Unwrap returns the warped error.
type Option ¶
type Option func(*cfg)
An Option defines optional behaviors for the crud functions.
func OptionPostWriteHook ¶
func OptionPostWriteHook(hook PostWriteHook) Option
OptionPostWriteHook defines the function to call just after the final write operation runs. It will be given the object that was written.
func OptionPreWriteHook ¶
func OptionPreWriteHook(hook PreWriteHook) Option
OptionPreWriteHook defines the function to call just before the final write operation runs. It will be given the object that is about to be written and eventually the original object that got pulled from the database. If this function returns an error, the operation stops and the error will be returned wrapped into a PreWriteHookError.
type PostWriteHook ¶
type PostWriteHook func(obj elemental.Identifiable)
PostWriteHook is the type of function yiou can pass as a post write hook.
type PreWriteHook ¶
type PreWriteHook func(obj elemental.Identifiable, orig elemental.Identifiable) error
PreWriteHook is the type of function you can pass as a pre write hook.