Documentation
¶
Index ¶
- type DataSource
- type EventTimestampManager
- func (mgr *EventTimestampManager) Add(event proto.Message)
- func (mgr *EventTimestampManager) AddWithSuffix(event proto.Message, tyoeSuffix string)
- func (mgr *EventTimestampManager) IsLatest(event proto.Message) bool
- func (mgr *EventTimestampManager) IsLatestWithSuffix(event proto.Message, tyoeSuffix string) bool
- type FileTemplate
- type Point
- type Renderer
- type Size
- type Spacing
- type Template
- type TimestampManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataSource ¶
type DataSource interface { // Latest willreturn latest element for given datasource. Latest(core.DataSource) (proto.Message, error) // All returns a list of available events for passed datasource. All(core.DataSource) ([]proto.Message, error) // Observe returns a channels to listen for new events. // You can pass a filter to listen for events from specific datasource, only. // Datasource will not block if channel capacity is reached. Events will be skipped! Observe(*[]core.DataSource) <-chan proto.Message }
DataSource is used to get data for templates.
type EventTimestampManager ¶ added in v1.1.5
type EventTimestampManager struct {
// contains filtered or unexported fields
}
EventTimestampManager manages timestamp for latest events.
func (*EventTimestampManager) Add ¶ added in v1.1.5
func (mgr *EventTimestampManager) Add(event proto.Message)
Add timestamp of passed event to local storage for later checks.
func (*EventTimestampManager) AddWithSuffix ¶ added in v1.1.6
func (mgr *EventTimestampManager) AddWithSuffix(event proto.Message, tyoeSuffix string)
AddWithSuffix works like Add with an additional type name suffix.
func (*EventTimestampManager) IsLatest ¶ added in v1.1.5
func (mgr *EventTimestampManager) IsLatest(event proto.Message) bool
IsLatest will returns true if there's no similar event in local storage or if local timestamp is older than in passed event.
func (*EventTimestampManager) IsLatestWithSuffix ¶ added in v1.1.6
func (mgr *EventTimestampManager) IsLatestWithSuffix(event proto.Message, tyoeSuffix string) bool
IsLatestWithSuffix acts in the same way as IsLatest with an optional identifier suffix.
type FileTemplate ¶
type FileTemplate struct {
// contains filtered or unexported fields
}
FileTemplate used to generate content based on file templates.
func (*FileTemplate) RenderWith ¶
func (fileTemplate *FileTemplate) RenderWith(data interface{}) (string, error)
RenderWith will execute assigned template with passed data.
type Point ¶
type Point struct {
X, Y int
}
Point is used to define a position based on y/> coordinates.
type Spacing ¶ added in v1.0.3
type Spacing struct {
Top, Right, Bottom, Left int
}
Spacing defines top, left right and bottom distance to other elements.
type Template ¶
type Template interface { // Render generated content based on a template with given values. RenderWith(interface{}) (string, error) }
Template renders content.
func NewFileTemplate ¶
NewFileTemplate returns a new template for given file.
type TimestampManager ¶ added in v1.1.5
type TimestampManager interface { // IsLatest will returns true if there's no similar event in local storage // or if local timestamp is older than in passed event. IsLatest(proto.Message) bool // IsLatestWithSuffix acts in the same way as IsLatest with an optional // identifier suffix. IsLatestWithSuffix(proto.Message, string) bool // Add timestamp of passed event to local storage for later checks. // Identifier suffix is optional. Add(proto.Message) // AddWithSuffix works like Add with an additional type name suffix. AddWithSuffix(proto.Message, string) }
TimestampManager checks timestamp of events.
func NewTimestampManager ¶ added in v1.1.5
func NewTimestampManager() TimestampManager
NewTimestampManager returns an empty timestamp manager.