Documentation ¶
Index ¶
- func ClearView(db *gorm.DB, truncateView, sequenceTable string) error
- func CurrentSequenceToModel(sequence *CurrentSequence) *model.View
- func FailedEventToModel(failedEvent *FailedEvent) *view_model.FailedEvent
- func PrepareBulkSave(table string) func(db *gorm.DB, objects ...interface{}) error
- func PrepareDeleteByKey(table string, key ColumnKey, id interface{}) func(db *gorm.DB) error
- func PrepareDeleteByKeys(table string, keys ...Key) func(db *gorm.DB) error
- func PrepareDeleteByObject(table string, object interface{}) func(db *gorm.DB) error
- func PrepareGetByKey(table string, key ColumnKey, id string) func(db *gorm.DB, res interface{}) error
- func PrepareGetByQuery(table string, queries ...SearchQuery) func(db *gorm.DB, res interface{}) error
- func PrepareSave(table string) func(db *gorm.DB, object interface{}) error
- func PrepareSaveOnConflict(table string, conflictColumns, updateColumns []string) func(db *gorm.DB, object interface{}) error
- func PrepareSearchQuery(table string, request SearchRequest) func(db *gorm.DB, res interface{}) (uint64, error)
- func PrepareTruncate(table string) func(db *gorm.DB) error
- func RemoveFailedEvent(db *gorm.DB, table string, failedEvent *FailedEvent) error
- func SaveCurrentSequence(db *gorm.DB, table, viewName, instanceID string, sequence uint64, ...) error
- func SaveCurrentSequences(db *gorm.DB, table, viewName string, sequence uint64, eventTimestamp time.Time) error
- func SaveFailedEvent(db *gorm.DB, table string, failedEvent *FailedEvent) error
- func SetQuery(query *gorm.DB, key ColumnKey, value interface{}, method domain.SearchMethod) (*gorm.DB, error)
- func UpdateCurrentSequence(db *gorm.DB, table string, currentSequence *CurrentSequence) (err error)
- func UpdateCurrentSequences(db *gorm.DB, table string, currentSequences []*CurrentSequence) (err error)
- type ColumnKey
- type CurrentSequence
- type FailedEvent
- type FailedEventSearchKey
- type FailedEventSearchQuery
- type GeneralSearchKey
- type GeneralSearchQuery
- type GeneralSearchRequest
- type Key
- type SearchQuery
- type SearchRequest
- type SequenceSearchKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentSequenceToModel ¶
func CurrentSequenceToModel(sequence *CurrentSequence) *model.View
func FailedEventToModel ¶
func FailedEventToModel(failedEvent *FailedEvent) *view_model.FailedEvent
func PrepareBulkSave ¶
func PrepareDeleteByKey ¶
func PrepareDeleteByKeys ¶
func PrepareDeleteByObject ¶
func PrepareGetByKey ¶
func PrepareGetByQuery ¶
func PrepareGetByQuery(table string, queries ...SearchQuery) func(db *gorm.DB, res interface{}) error
func PrepareSaveOnConflict ¶
func PrepareSearchQuery ¶
func RemoveFailedEvent ¶
func RemoveFailedEvent(db *gorm.DB, table string, failedEvent *FailedEvent) error
func SaveCurrentSequence ¶
func SaveCurrentSequences ¶
func SaveFailedEvent ¶
func SaveFailedEvent(db *gorm.DB, table string, failedEvent *FailedEvent) error
func UpdateCurrentSequence ¶
func UpdateCurrentSequence(db *gorm.DB, table string, currentSequence *CurrentSequence) (err error)
func UpdateCurrentSequences ¶
func UpdateCurrentSequences(db *gorm.DB, table string, currentSequences []*CurrentSequence) (err error)
Types ¶
type CurrentSequence ¶
type CurrentSequence struct { ViewName string `gorm:"column:view_name;primary_key"` CurrentSequence uint64 `gorm:"column:current_sequence"` EventTimestamp time.Time `gorm:"column:event_timestamp"` LastSuccessfulSpoolerRun time.Time `gorm:"column:last_successful_spooler_run"` InstanceID string `gorm:"column:instance_id;primary_key"` }
func AllCurrentSequences ¶
func AllCurrentSequences(db *gorm.DB, table string) ([]*CurrentSequence, error)
func LatestSequence ¶
func LatestSequence(db *gorm.DB, table, viewName, instanceID string) (*CurrentSequence, error)
func LatestSequences ¶
type FailedEvent ¶
type FailedEvent struct { ViewName string `gorm:"column:view_name;primary_key"` FailedSequence uint64 `gorm:"column:failed_sequence;primary_key"` FailureCount uint64 `gorm:"column:failure_count"` ErrMsg string `gorm:"column:err_msg"` InstanceID string `gorm:"column:instance_id"` }
func AllFailedEvents ¶
func AllFailedEvents(db *gorm.DB, table string) ([]*FailedEvent, error)
func FailedEventFromModel ¶
func FailedEventFromModel(failedEvent *view_model.FailedEvent) *FailedEvent
func LatestFailedEvent ¶
type FailedEventSearchKey ¶
type FailedEventSearchKey int32
const ( FailedEventKeyUndefined FailedEventSearchKey = iota FailedEventKeyViewName FailedEventKeyFailedSequence FailedEventKeyInstanceID )
type FailedEventSearchQuery ¶
type FailedEventSearchQuery struct { Key FailedEventSearchKey Method domain.SearchMethod Value interface{} }
func (FailedEventSearchQuery) GetKey ¶
func (req FailedEventSearchQuery) GetKey() ColumnKey
func (FailedEventSearchQuery) GetMethod ¶
func (req FailedEventSearchQuery) GetMethod() domain.SearchMethod
func (FailedEventSearchQuery) GetValue ¶
func (req FailedEventSearchQuery) GetValue() interface{}
type GeneralSearchKey ¶
type GeneralSearchKey model.GeneralSearchKey
func (GeneralSearchKey) ToColumnName ¶
func (key GeneralSearchKey) ToColumnName() string
type GeneralSearchQuery ¶
type GeneralSearchQuery model.GeneralSearchQuery
func (GeneralSearchQuery) GetKey ¶
func (req GeneralSearchQuery) GetKey() ColumnKey
func (GeneralSearchQuery) GetMethod ¶
func (req GeneralSearchQuery) GetMethod() domain.SearchMethod
func (GeneralSearchQuery) GetValue ¶
func (req GeneralSearchQuery) GetValue() interface{}
type GeneralSearchRequest ¶
type GeneralSearchRequest model.GeneralSearchRequest
func (GeneralSearchRequest) GetAsc ¶
func (req GeneralSearchRequest) GetAsc() bool
func (GeneralSearchRequest) GetLimit ¶
func (req GeneralSearchRequest) GetLimit() uint64
func (GeneralSearchRequest) GetOffset ¶
func (req GeneralSearchRequest) GetOffset() uint64
func (GeneralSearchRequest) GetQueries ¶
func (req GeneralSearchRequest) GetQueries() []SearchQuery
func (GeneralSearchRequest) GetSortingColumn ¶
func (req GeneralSearchRequest) GetSortingColumn() ColumnKey
type SearchQuery ¶
type SearchQuery interface { GetKey() ColumnKey GetMethod() domain.SearchMethod GetValue() interface{} }
type SearchRequest ¶
type SearchRequest interface { GetLimit() uint64 GetOffset() uint64 GetSortingColumn() ColumnKey GetAsc() bool GetQueries() []SearchQuery }
type SequenceSearchKey ¶
type SequenceSearchKey int32
const ( SequenceSearchKeyUndefined SequenceSearchKey = iota SequenceSearchKeyViewName SequenceSearchKeyAggregateType SequenceSearchKeyInstanceID )
Click to show internal directories.
Click to hide internal directories.