Documentation ¶
Index ¶
- Variables
- func HandleCreate(unmarshal func([]byte) (interface{}, error)) func(CrudRef) func(r route.Request) route.Response
- func HandleDelete(ref CrudRef) func(r route.Request) route.Response
- func HandlePostQuery(ref CrudRef) func(r route.Request) route.Response
- func HandleQuery(ref CrudRef) func(r route.Request) route.Response
- func HandleRead(ref CrudRef) func(r route.Request) route.Response
- func HandleUnmarshal(b []byte) (interface{}, error)
- func HandleUpdate(unmarshal func([]byte) (interface{}, error)) func(CrudRef) func(r route.Request) route.Response
- type Client
- type CreateCommand
- type CreateFunc
- type CreateHandler
- type CreateRouteHandler
- type CreatedEvent
- type Crud
- type CrudEncoding
- type CrudHandler
- func (a *CrudHandler) AsyncActor() bool
- func (a *CrudHandler) Create(ctx leikari.ActorContext, cmd CreateCommand) (*CreatedEvent, error)
- func (a *CrudHandler) Delete(ctx leikari.ActorContext, cmd DeleteCommand) (*DeletedEvent, error)
- func (a *CrudHandler) HandleUnmarshal(data []byte) (interface{}, error)
- func (a *CrudHandler) PostStop(ctx leikari.ActorContext) error
- func (a *CrudHandler) PreStart(ctx leikari.ActorContext) error
- func (a *CrudHandler) Query(ctx leikari.ActorContext, qry query.Query) (*query.QueryResult, error)
- func (a *CrudHandler) Read(ctx leikari.ActorContext, cmd ReadCommand) (*ReadEvent, error)
- func (a *CrudHandler) Receive(ctx leikari.ActorContext, msg leikari.Message)
- func (a *CrudHandler) Update(ctx leikari.ActorContext, cmd UpdateCommand) (*UpdatedEvent, error)
- type CrudRef
- type DeleteCommand
- type DeleteFunc
- type DeleteHandler
- type DeleteRouteHandler
- type DeletedEvent
- type PostQueryRouteHandler
- type QueryFunc
- type QueryRouteHandler
- type ReadCommand
- type ReadEvent
- type ReadFunc
- type ReadHandler
- type ReadRouteHandler
- type UnmarshalHandler
- type UpdateCommand
- type UpdateFunc
- type UpdateHandler
- type UpdateRouteHandler
- type UpdatedEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotCreated = leikari.Errorln("", "entity not created") ErrNotFound = repository.ErrNotFound ErrNotUpdated = leikari.Errorln("", "entity not updated") ErrNotDeleted = leikari.Errorln("", "entity not deleted") )
Functions ¶
func HandleCreate ¶
func HandleUnmarshal ¶
Types ¶
type Client ¶
type Client interface { Create(interface{}) (interface{}, error) CreateContext(context.Context, interface{}) (interface{}, error) Read(string) (interface{}, error) ReadContext(context.Context, string) (interface{}, error) Update(string, interface{}) (interface{}, error) UpdateContext(context.Context, string, interface{}) (interface{}, error) Delete(string) (interface{}, error) DeleteContext(context.Context, string) (interface{}, error) List(query.Query) (*query.QueryResult, error) ListContext(context.Context, query.Query) (*query.QueryResult, error) }
func CrudClient ¶
type CreateCommand ¶
type CreateCommand struct {
Entity interface{}
}
type CreateFunc ¶
type CreateFunc func(leikari.ActorContext, interface{}) (string, interface{}, error)
type CreateHandler ¶
type CreateHandler interface {
Create(leikari.ActorContext, CreateCommand) (*CreatedEvent, error)
}
type CreateRouteHandler ¶
type CreatedEvent ¶
type Crud ¶
type Crud interface { CreateHandler ReadHandler UpdateHandler DeleteHandler repository.QueryHandler }
type CrudEncoding ¶
type CrudEncoding interface { }
type CrudHandler ¶
type CrudHandler struct { OnCreate CreateFunc OnRead ReadFunc OnUpdate UpdateFunc OnDelete DeleteFunc OnQuery QueryFunc OnReceive func(leikari.ActorContext, leikari.Message) OnStart func(leikari.ActorContext) error OnStop func(leikari.ActorContext) error OnUnmarshal func([]byte) (interface{}, error) Sync bool }
func (*CrudHandler) AsyncActor ¶
func (a *CrudHandler) AsyncActor() bool
func (*CrudHandler) Create ¶
func (a *CrudHandler) Create(ctx leikari.ActorContext, cmd CreateCommand) (*CreatedEvent, error)
func (*CrudHandler) Delete ¶
func (a *CrudHandler) Delete(ctx leikari.ActorContext, cmd DeleteCommand) (*DeletedEvent, error)
func (*CrudHandler) HandleUnmarshal ¶
func (a *CrudHandler) HandleUnmarshal(data []byte) (interface{}, error)
func (*CrudHandler) PostStop ¶
func (a *CrudHandler) PostStop(ctx leikari.ActorContext) error
func (*CrudHandler) PreStart ¶
func (a *CrudHandler) PreStart(ctx leikari.ActorContext) error
func (*CrudHandler) Query ¶
func (a *CrudHandler) Query(ctx leikari.ActorContext, qry query.Query) (*query.QueryResult, error)
func (*CrudHandler) Read ¶
func (a *CrudHandler) Read(ctx leikari.ActorContext, cmd ReadCommand) (*ReadEvent, error)
func (*CrudHandler) Receive ¶
func (a *CrudHandler) Receive(ctx leikari.ActorContext, msg leikari.Message)
func (*CrudHandler) Update ¶
func (a *CrudHandler) Update(ctx leikari.ActorContext, cmd UpdateCommand) (*UpdatedEvent, error)
type CrudRef ¶
type CrudRef interface { leikari.Ref Create(interface{}) (*CreatedEvent, error) CreateContext(context.Context, interface{}) (*CreatedEvent, error) Read(string) (*ReadEvent, error) ReadContext(context.Context, string) (*ReadEvent, error) Update(string, interface{}) (*UpdatedEvent, error) UpdateContext(context.Context, string, interface{}) (*UpdatedEvent, error) Delete(string) (*DeletedEvent, error) DeleteContext(context.Context, string) (*DeletedEvent, error) List(query.Query) (*query.QueryResult, error) ListContext(context.Context, query.Query) (*query.QueryResult, error) }
type DeleteCommand ¶
type DeleteCommand struct {
Id string
}
type DeleteFunc ¶
type DeleteFunc func(leikari.ActorContext, string) (interface{}, error)
type DeleteHandler ¶
type DeleteHandler interface {
Delete(leikari.ActorContext, DeleteCommand) (*DeletedEvent, error)
}
type DeleteRouteHandler ¶
type DeletedEvent ¶
type PostQueryRouteHandler ¶
type QueryFunc ¶
type QueryFunc func(leikari.ActorContext, query.Query) (*query.QueryResult, error)
type QueryRouteHandler ¶
type ReadCommand ¶
type ReadCommand struct {
Id string
}
type ReadHandler ¶
type ReadHandler interface {
Read(leikari.ActorContext, ReadCommand) (*ReadEvent, error)
}
type ReadRouteHandler ¶
type UnmarshalHandler ¶
type UpdateCommand ¶
type UpdateCommand struct { Id string Entity interface{} }
type UpdateFunc ¶
type UpdateFunc func(leikari.ActorContext, string, interface{}) error
type UpdateHandler ¶
type UpdateHandler interface {
Update(leikari.ActorContext, UpdateCommand) (*UpdatedEvent, error)
}
type UpdateRouteHandler ¶
Click to show internal directories.
Click to hide internal directories.