Documentation ¶
Index ¶
- Constants
- func BookCommandTypes() *bookCommandTypes
- func BookEventTypes() *bookEventTypes
- type Book
- type BookAggregateInitializer
- type BookCli
- type BookClient
- type BookCommandHandler
- func (o *BookCommandHandler) AddCreatePreparer(preparer func(*CreateBook, *Book) (err error))
- func (o *BookCommandHandler) AddDeletePreparer(preparer func(*DeleteBook, *Book) (err error))
- func (o *BookCommandHandler) AddUpdatePreparer(preparer func(*UpdateBook, *Book) (err error))
- func (o *BookCommandHandler) Execute(cmd eventhorizon.Command, entity eventhorizon.Entity, ...) (err error)
- func (o *BookCommandHandler) SetupCommandHandler() (err error)
- type BookCommandType
- func (o BookCommandType) GetBSON() (ret interface{}, err error)
- func (o *BookCommandType) IsCreateBook() bool
- func (o *BookCommandType) IsDeleteBook() bool
- func (o *BookCommandType) IsUpdateBook() bool
- func (o BookCommandType) MarshalJSON() (ret []byte, err error)
- func (o *BookCommandType) Name() string
- func (o *BookCommandType) Ordinal() int
- func (o *BookCommandType) SetBSON(raw bson.Raw) (err error)
- func (o *BookCommandType) UnmarshalJSON(data []byte) (err error)
- type BookCreated
- type BookDeleted
- type BookEventHandler
- type BookEventType
- func (o BookEventType) GetBSON() (ret interface{}, err error)
- func (o *BookEventType) IsBookCreated() bool
- func (o *BookEventType) IsBookDeleted() bool
- func (o *BookEventType) IsBookUpdated() bool
- func (o BookEventType) MarshalJSON() (ret []byte, err error)
- func (o *BookEventType) Name() string
- func (o *BookEventType) Ordinal() int
- func (o *BookEventType) SetBSON(raw bson.Raw) (err error)
- func (o *BookEventType) UnmarshalJSON(data []byte) (err error)
- type BookExecutors
- type BookHandlers
- type BookHttpCommandHandler
- type BookHttpQueryHandler
- func (o *BookHttpQueryHandler) CountAll(w http.ResponseWriter, r *http.Request)
- func (o *BookHttpQueryHandler) CountById(w http.ResponseWriter, r *http.Request)
- func (o *BookHttpQueryHandler) ExistAll(w http.ResponseWriter, r *http.Request)
- func (o *BookHttpQueryHandler) ExistById(w http.ResponseWriter, r *http.Request)
- func (o *BookHttpQueryHandler) FindAll(w http.ResponseWriter, r *http.Request)
- func (o *BookHttpQueryHandler) FindById(w http.ResponseWriter, r *http.Request)
- func (o *BookHttpQueryHandler) FindByPattern(w http.ResponseWriter, r *http.Request)
- func (o *BookHttpQueryHandler) FindByTitle(w http.ResponseWriter, r *http.Request)
- type BookInitialExecutor
- type BookInitialHandler
- type BookQueryRepository
- func (o *BookQueryRepository) CountAll() (ret int, err error)
- func (o *BookQueryRepository) CountById(id uuid.UUID) (ret int, err error)
- func (o *BookQueryRepository) ExistAll() (ret bool, err error)
- func (o *BookQueryRepository) ExistById(id uuid.UUID) (ret bool, err error)
- func (o *BookQueryRepository) FindAll() (ret []*Book, err error)
- func (o *BookQueryRepository) FindById(id uuid.UUID) (ret *Book, err error)
- func (o *BookQueryRepository) FindByPattern(pattern string) (ret *Book, err error)
- func (o *BookQueryRepository) FindByTitle(title string) (ret *Book, err error)
- type BookRouter
- type BookUpdated
- type CreateBook
- type DeleteBook
- type LibraryCli
- type LibraryClient
- type LibraryEventhorizonInitializer
- type LibraryRouter
- type Location
- type UpdateBook
Constants ¶
View Source
const ( CreateBookCommand eventhorizon.CommandType = "CreateBook" DeleteBookCommand eventhorizon.CommandType = "DeleteBook" UpdateBookCommand eventhorizon.CommandType = "UpdateBook" )
View Source
const ( BookCreatedEvent eventhorizon.EventType = "BookCreated" BookDeletedEvent eventhorizon.EventType = "BookDeleted" BookUpdatedEvent eventhorizon.EventType = "BookUpdated" )
View Source
const BookAggregateType eventhorizon.AggregateType = "Book"
Variables ¶
This section is empty.
Functions ¶
func BookCommandTypes ¶
func BookCommandTypes() *bookCommandTypes
func BookEventTypes ¶
func BookEventTypes() *bookEventTypes
Types ¶
type Book ¶
type Book struct { Title string `json:"title" eh:"optional"` Description string `json:"description" eh:"optional"` Language string `json:"language" eh:"optional"` ReleaseDate *time.Time `json:"releaseDate" eh:"optional"` Edition string `json:"edition" eh:"optional"` Category string `json:"category" eh:"optional"` Author *person.PersonName `json:"author" eh:"optional"` Location *Location `json:"location" eh:"optional"` Id uuid.UUID `json:"id" eh:"optional"` }
func NewBookByPropNames ¶
func NewBooksByPropNames ¶
type BookAggregateInitializer ¶
type BookAggregateInitializer struct { *eh.AggregateInitializer *BookCommandHandler *BookEventHandler ProjectorHandler *BookEventHandler `json:"projectorHandler" eh:"optional"` }
func NewBookAggregateInitializer ¶
func NewBookAggregateInitializer(eventStore eventhorizon.EventStore, eventBus eventhorizon.EventBus, commandBus *bus.CommandHandler, readRepos func(string, func() (ret eventhorizon.Entity)) (ret eventhorizon.ReadWriteRepo)) (ret *BookAggregateInitializer)
type BookClient ¶
type BookClient struct { Url string `json:"url" eh:"optional"` Client *http.Client `json:"client" eh:"optional"` }
func NewBookClient ¶
func NewBookClient(url string, client *http.Client) (ret *BookClient)
func (*BookClient) Create ¶
func (o *BookClient) Create(items []*Book) (err error)
func (*BookClient) ImportJSON ¶
func (o *BookClient) ImportJSON(fileJSON string) (err error)
func (*BookClient) ReadFileJSON ¶
func (o *BookClient) ReadFileJSON(fileJSON string) (ret []*Book, err error)
type BookCommandHandler ¶
type BookCommandHandler struct { CreateHandler func(*CreateBook, *Book, eh.AggregateStoreEvent) (err error) `json:"createHandler" eh:"optional"` DeleteHandler func(*DeleteBook, *Book, eh.AggregateStoreEvent) (err error) `json:"deleteHandler" eh:"optional"` UpdateHandler func(*UpdateBook, *Book, eh.AggregateStoreEvent) (err error) `json:"updateHandler" eh:"optional"` }
func (*BookCommandHandler) AddCreatePreparer ¶
func (o *BookCommandHandler) AddCreatePreparer(preparer func(*CreateBook, *Book) (err error))
func (*BookCommandHandler) AddDeletePreparer ¶
func (o *BookCommandHandler) AddDeletePreparer(preparer func(*DeleteBook, *Book) (err error))
func (*BookCommandHandler) AddUpdatePreparer ¶
func (o *BookCommandHandler) AddUpdatePreparer(preparer func(*UpdateBook, *Book) (err error))
func (*BookCommandHandler) Execute ¶
func (o *BookCommandHandler) Execute(cmd eventhorizon.Command, entity eventhorizon.Entity, store eh.AggregateStoreEvent) (err error)
func (*BookCommandHandler) SetupCommandHandler ¶
func (o *BookCommandHandler) SetupCommandHandler() (err error)
type BookCommandType ¶
type BookCommandType struct {
// contains filtered or unexported fields
}
func (BookCommandType) GetBSON ¶
func (o BookCommandType) GetBSON() (ret interface{}, err error)
func (*BookCommandType) IsCreateBook ¶
func (o *BookCommandType) IsCreateBook() bool
func (*BookCommandType) IsDeleteBook ¶
func (o *BookCommandType) IsDeleteBook() bool
func (*BookCommandType) IsUpdateBook ¶
func (o *BookCommandType) IsUpdateBook() bool
func (BookCommandType) MarshalJSON ¶
func (o BookCommandType) MarshalJSON() (ret []byte, err error)
func (*BookCommandType) Name ¶
func (o *BookCommandType) Name() string
func (*BookCommandType) Ordinal ¶
func (o *BookCommandType) Ordinal() int
func (*BookCommandType) UnmarshalJSON ¶
func (o *BookCommandType) UnmarshalJSON(data []byte) (err error)
type BookCreated ¶
type BookCreated struct { Title string `json:"title" eh:"optional"` Description string `json:"description" eh:"optional"` Language string `json:"language" eh:"optional"` ReleaseDate *time.Time `json:"releaseDate" eh:"optional"` Edition string `json:"edition" eh:"optional"` Category string `json:"category" eh:"optional"` Author *person.PersonName `json:"author" eh:"optional"` Location *Location `json:"location" eh:"optional"` Id uuid.UUID `json:"id" eh:"optional"` }
type BookDeleted ¶
type BookEventHandler ¶
type BookEventHandler struct { CreatedHandler func(*BookCreated, *Book) (err error) `json:"createdHandler" eh:"optional"` DeletedHandler func(*BookDeleted, *Book) (err error) `json:"deletedHandler" eh:"optional"` UpdatedHandler func(*BookUpdated, *Book) (err error) `json:"updatedHandler" eh:"optional"` }
func (*BookEventHandler) Apply ¶
func (o *BookEventHandler) Apply(event eventhorizon.Event, entity eventhorizon.Entity) (err error)
func (*BookEventHandler) SetupEventHandler ¶
func (o *BookEventHandler) SetupEventHandler() (err error)
type BookEventType ¶
type BookEventType struct {
// contains filtered or unexported fields
}
func (BookEventType) GetBSON ¶
func (o BookEventType) GetBSON() (ret interface{}, err error)
func (*BookEventType) IsBookCreated ¶
func (o *BookEventType) IsBookCreated() bool
func (*BookEventType) IsBookDeleted ¶
func (o *BookEventType) IsBookDeleted() bool
func (*BookEventType) IsBookUpdated ¶
func (o *BookEventType) IsBookUpdated() bool
func (BookEventType) MarshalJSON ¶
func (o BookEventType) MarshalJSON() (ret []byte, err error)
func (*BookEventType) Name ¶
func (o *BookEventType) Name() string
func (*BookEventType) Ordinal ¶
func (o *BookEventType) Ordinal() int
func (*BookEventType) UnmarshalJSON ¶
func (o *BookEventType) UnmarshalJSON(data []byte) (err error)
type BookExecutors ¶
type BookExecutors struct {
Initial *BookInitialExecutor `json:"initial" eh:"optional"`
}
func NewBookExecutors ¶
func NewBookExecutors() (ret *BookExecutors)
type BookHandlers ¶
type BookHandlers struct {
Initial *BookInitialHandler `json:"initial" eh:"optional"`
}
func NewBookHandlers ¶
func NewBookHandlers() (ret *BookHandlers)
type BookHttpCommandHandler ¶
type BookHttpCommandHandler struct {
*eh.HttpCommandHandler
}
func NewBookHttpCommandHandler ¶
func NewBookHttpCommandHandler(context context.Context, commandBus eventhorizon.CommandHandler) (ret *BookHttpCommandHandler)
func (*BookHttpCommandHandler) Create ¶
func (o *BookHttpCommandHandler) Create(w http.ResponseWriter, r *http.Request)
func (*BookHttpCommandHandler) Delete ¶
func (o *BookHttpCommandHandler) Delete(w http.ResponseWriter, r *http.Request)
func (*BookHttpCommandHandler) Update ¶
func (o *BookHttpCommandHandler) Update(w http.ResponseWriter, r *http.Request)
type BookHttpQueryHandler ¶
type BookHttpQueryHandler struct { *eh.HttpQueryHandler QueryRepository *BookQueryRepository `json:"queryRepository" eh:"optional"` }
func NewBookHttpQueryHandler ¶
func NewBookHttpQueryHandler(queryRepository *BookQueryRepository) (ret *BookHttpQueryHandler)
func (*BookHttpQueryHandler) CountAll ¶
func (o *BookHttpQueryHandler) CountAll(w http.ResponseWriter, r *http.Request)
func (*BookHttpQueryHandler) CountById ¶
func (o *BookHttpQueryHandler) CountById(w http.ResponseWriter, r *http.Request)
func (*BookHttpQueryHandler) ExistAll ¶
func (o *BookHttpQueryHandler) ExistAll(w http.ResponseWriter, r *http.Request)
func (*BookHttpQueryHandler) ExistById ¶
func (o *BookHttpQueryHandler) ExistById(w http.ResponseWriter, r *http.Request)
func (*BookHttpQueryHandler) FindAll ¶
func (o *BookHttpQueryHandler) FindAll(w http.ResponseWriter, r *http.Request)
func (*BookHttpQueryHandler) FindById ¶
func (o *BookHttpQueryHandler) FindById(w http.ResponseWriter, r *http.Request)
func (*BookHttpQueryHandler) FindByPattern ¶
func (o *BookHttpQueryHandler) FindByPattern(w http.ResponseWriter, r *http.Request)
func (*BookHttpQueryHandler) FindByTitle ¶
func (o *BookHttpQueryHandler) FindByTitle(w http.ResponseWriter, r *http.Request)
type BookInitialExecutor ¶
type BookInitialExecutor struct { }
func NewBookInitialExecutor ¶
func NewBookInitialExecutor() (ret *BookInitialExecutor)
type BookInitialHandler ¶
type BookInitialHandler struct { }
func NewBookInitialHandler ¶
func NewBookInitialHandler() (ret *BookInitialHandler)
func (*BookInitialHandler) Apply ¶
func (o *BookInitialHandler) Apply(event eventhorizon.Event, entity eventhorizon.Entity) (err error)
func (*BookInitialHandler) SetupEventHandler ¶
func (o *BookInitialHandler) SetupEventHandler() (err error)
type BookQueryRepository ¶
type BookQueryRepository struct {
// contains filtered or unexported fields
}
func NewBookQueryRepository ¶
func NewBookQueryRepository(repo eventhorizon.ReadRepo, context context.Context) (ret *BookQueryRepository)
func (*BookQueryRepository) CountAll ¶
func (o *BookQueryRepository) CountAll() (ret int, err error)
func (*BookQueryRepository) CountById ¶
func (o *BookQueryRepository) CountById(id uuid.UUID) (ret int, err error)
func (*BookQueryRepository) ExistAll ¶
func (o *BookQueryRepository) ExistAll() (ret bool, err error)
func (*BookQueryRepository) ExistById ¶
func (o *BookQueryRepository) ExistById(id uuid.UUID) (ret bool, err error)
func (*BookQueryRepository) FindAll ¶
func (o *BookQueryRepository) FindAll() (ret []*Book, err error)
func (*BookQueryRepository) FindById ¶
func (o *BookQueryRepository) FindById(id uuid.UUID) (ret *Book, err error)
func (*BookQueryRepository) FindByPattern ¶
func (o *BookQueryRepository) FindByPattern(pattern string) (ret *Book, err error)
func (*BookQueryRepository) FindByTitle ¶
func (o *BookQueryRepository) FindByTitle(title string) (ret *Book, err error)
type BookRouter ¶
type BookRouter struct { PathPrefix string `json:"pathPrefix" eh:"optional"` QueryHandler *BookHttpQueryHandler `json:"queryHandler" eh:"optional"` CommandHandler *BookHttpCommandHandler `json:"commandHandler" eh:"optional"` Router *mux.Router `json:"router" eh:"optional"` }
func NewBookRouter ¶
func NewBookRouter(pathPrefix string, context context.Context, commandBus eventhorizon.CommandHandler, readRepos func(string, func() (ret eventhorizon.Entity)) (ret eventhorizon.ReadWriteRepo)) (ret *BookRouter)
type BookUpdated ¶
type BookUpdated struct { Title string `json:"title" eh:"optional"` Description string `json:"description" eh:"optional"` Language string `json:"language" eh:"optional"` ReleaseDate *time.Time `json:"releaseDate" eh:"optional"` Edition string `json:"edition" eh:"optional"` Category string `json:"category" eh:"optional"` Author *person.PersonName `json:"author" eh:"optional"` Location *Location `json:"location" eh:"optional"` Id uuid.UUID `json:"id" eh:"optional"` }
type CreateBook ¶
type CreateBook struct { Title string `json:"title" eh:"optional"` Description string `json:"description" eh:"optional"` Language string `json:"language" eh:"optional"` ReleaseDate *time.Time `json:"releaseDate" eh:"optional"` Edition string `json:"edition" eh:"optional"` Category string `json:"category" eh:"optional"` Author *person.PersonName `json:"author" eh:"optional"` Location *Location `json:"location" eh:"optional"` Id uuid.UUID `json:"id" eh:"optional"` }
func (*CreateBook) AggregateID ¶
func (o *CreateBook) AggregateID() uuid.UUID
func (*CreateBook) AggregateType ¶
func (o *CreateBook) AggregateType() eventhorizon.AggregateType
func (*CreateBook) CommandType ¶
func (o *CreateBook) CommandType() eventhorizon.CommandType
type DeleteBook ¶
func (*DeleteBook) AggregateID ¶
func (o *DeleteBook) AggregateID() uuid.UUID
func (*DeleteBook) AggregateType ¶
func (o *DeleteBook) AggregateType() eventhorizon.AggregateType
func (*DeleteBook) CommandType ¶
func (o *DeleteBook) CommandType() eventhorizon.CommandType
type LibraryCli ¶
type LibraryCli struct {
BookCli *BookCli `json:"bookCli" eh:"optional"`
}
func NewLibraryCli ¶
func NewLibraryCli() (ret *LibraryCli)
type LibraryClient ¶
type LibraryClient struct { Url string `json:"url" eh:"optional"` Client *http.Client `json:"client" eh:"optional"` BookClient *BookClient `json:"bookClient" eh:"optional"` }
func NewLibraryClient ¶
func NewLibraryClient(url string, client *http.Client) (ret *LibraryClient)
type LibraryEventhorizonInitializer ¶
type LibraryEventhorizonInitializer struct { BookAggregateInitializer *BookAggregateInitializer `json:"bookAggregateInitializer" eh:"optional"` // contains filtered or unexported fields }
func NewLibraryEventhorizonInitializer ¶
func NewLibraryEventhorizonInitializer(eventStore eventhorizon.EventStore, eventBus eventhorizon.EventBus, commandBus *bus.CommandHandler, readRepos func(string, func() (ret eventhorizon.Entity)) (ret eventhorizon.ReadWriteRepo)) (ret *LibraryEventhorizonInitializer)
func (*LibraryEventhorizonInitializer) Setup ¶
func (o *LibraryEventhorizonInitializer) Setup() (err error)
type LibraryRouter ¶
type LibraryRouter struct { PathPrefix string `json:"pathPrefix" eh:"optional"` BookRouter *BookRouter `json:"bookRouter" eh:"optional"` Router *mux.Router `json:"router" eh:"optional"` }
func NewLibraryRouter ¶
func NewLibraryRouter(pathPrefix string, context context.Context, commandBus *bus.CommandHandler, readRepos func(string, func() (ret eventhorizon.Entity)) (ret eventhorizon.ReadWriteRepo)) (ret *LibraryRouter)
type Location ¶
type Location struct { Shelf string `json:"shelf" eh:"optional"` Fold string `json:"fold" eh:"optional"` }
func NewLocation ¶
func NewLocation() (ret *Location)
func NewLocationByPropNames ¶
func NewLocationsByPropNames ¶
type UpdateBook ¶
type UpdateBook struct { Title string `json:"title" eh:"optional"` Description string `json:"description" eh:"optional"` Language string `json:"language" eh:"optional"` ReleaseDate *time.Time `json:"releaseDate" eh:"optional"` Edition string `json:"edition" eh:"optional"` Category string `json:"category" eh:"optional"` Author *person.PersonName `json:"author" eh:"optional"` Location *Location `json:"location" eh:"optional"` Id uuid.UUID `json:"id" eh:"optional"` }
func (*UpdateBook) AggregateID ¶
func (o *UpdateBook) AggregateID() uuid.UUID
func (*UpdateBook) AggregateType ¶
func (o *UpdateBook) AggregateType() eventhorizon.AggregateType
func (*UpdateBook) CommandType ¶
func (o *UpdateBook) CommandType() eventhorizon.CommandType
Click to show internal directories.
Click to hide internal directories.