Documentation
¶
Index ¶
- type BagEngine
- type Entry
- type EventRoot
- type EventRootUpdate
- type EventType
- type EventTypeUpdate
- type InfluxBag
- func (bag *InfluxBag) Close() error
- func (bag *InfluxBag) RegisterNewEntry(c context.Context, entry *Entry) error
- func (bag *InfluxBag) RegisterNewEventRoot(c context.Context, eventRoot *EventRoot) error
- func (bag *InfluxBag) RegisterNewEventType(c context.Context, eventType *EventType) error
- func (bag *InfluxBag) UpdateEventRoot(c context.Context, eventRootID string, update *EventRootUpdate) error
- func (bag *InfluxBag) UpdateEventType(c context.Context, eventTypeID string, update *EventTypeUpdate) error
- func (bag *InfluxBag) VerifyIfEventRootExist(c context.Context, eventRootID string) error
- func (bag *InfluxBag) VerifyIfEventTypeExist(c context.Context, eventTypeID string) error
- type InfluxBagConfig
- type Variable
- type VariableType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BagEngine ¶
type BagEngine interface {
RegisterNewEventRoot(c context.Context, eventRoot *EventRoot) error
UpdateEventRoot(c context.Context, eventRootID string, update *EventRootUpdate) error
RegisterNewEventType(c context.Context, eventType *EventType) error
UpdateEventType(c context.Context, eventTypeID string, update *EventTypeUpdate) error
RegisterNewEntry(c context.Context, entry *Entry) error
VerifyIfEventRootExist(c context.Context, eventRootID string) error
VerifyIfEventTypeExist(c context.Context, eventTypeID string) error
Close() error
}
BagEngine represents a way to store persistently your events and logs
type Entry ¶
type Entry struct {
ID string
At time.Time
TypeID string
Modifiers map[string]interface{}
Value int64
}
Entry define a simple entry of your event
type EventRootUpdate ¶
type EventRootUpdate struct {
Name *string
}
EventRootUpdate is a payload to update your event root
type EventType ¶
type EventType struct {
ID string
Name string
RootID string
Identifier string
CreatedAt time.Time
Occurrences int64
}
EventType represents a type of event, it has a parent
type EventTypeUpdate ¶
type EventTypeUpdate struct {
Name *string
RootID *string
Identifier *string
CreatedAt *time.Time
Occurrences *int64
}
EventTypeUpdate is a payload to update your event root type
type InfluxBag ¶
type InfluxBag struct {
// contains filtered or unexported fields
}
InfluxBag is an influx bag implementation
func NewInfluxBag ¶
func NewInfluxBag(config *InfluxBagConfig) (*InfluxBag, error)
NewInfluxBag generates a new bag instance
func (*InfluxBag) RegisterNewEntry ¶
RegisterNewEntry implements the bag interface
func (*InfluxBag) RegisterNewEventRoot ¶
RegisterNewEventRoot implements the bag interface
func (*InfluxBag) RegisterNewEventType ¶
RegisterNewEventType implements the bag interface
func (*InfluxBag) UpdateEventRoot ¶
func (bag *InfluxBag) UpdateEventRoot(c context.Context, eventRootID string, update *EventRootUpdate) error
UpdateEventRoot implements the bag interface
func (*InfluxBag) UpdateEventType ¶
func (bag *InfluxBag) UpdateEventType(c context.Context, eventTypeID string, update *EventTypeUpdate) error
UpdateEventType implements the bag interface
func (*InfluxBag) VerifyIfEventRootExist ¶
VerifyIfEventRootExist implements the bag interface
type InfluxBagConfig ¶
InfluxBagConfig is a wrapper for your bag configurations TODO: Improve the config of badger dictionary, accept more options
func DefaultInfluxBagConfig ¶
func DefaultInfluxBagConfig(influxConn, influxToken string) *InfluxBagConfig
DefaultInfluxBagConfig creates a new default configuration for your influx bag
type Variable ¶
type Variable struct {
ID string
Name string
Type VariableType
}
Variable is a simple variable struct, with this you can create a simple fuzzy algorithm