Documentation ¶
Index ¶
Constants ¶
View Source
const ( HeartbeatSourceDefault = "" HeartbeatSourceMongo = "mongo" )
View Source
const (
HeartbeatCollectionName = "heartbeat"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultCollection ¶
func DefaultCollection(session *mgo.Session) mongo.Collection
Types ¶
type Adapter ¶
func NewAdapter ¶
func NewAdapter(collection mongo.Collection) Adapter
type Heartbeat ¶
type Heartbeat struct { Pattern map[string]string `bson:"pattern"` ExpectedInterval string `bson:"expected_interval"` }
func (*Heartbeat) ToHeartBeatItem ¶
type Item ¶
type Item struct { Mappings map[string]string `toml:"mappings"` MaxDuration time.Duration `toml:"maxduration"` Source string }
Item contains the required informations for the HeartBeat engine to work.
func (*Item) AddMapping ¶
AddMapping simplifies your life to declare a useful HeartBeatItem. You can safely ignore the error, it only says that the mapping you try to insert already exists.
type SafeHeartbeatItems ¶
type SafeHeartbeatItems struct {
// contains filtered or unexported fields
}
func NewSafeHeartbeatItems ¶
func NewSafeHeartbeatItems() SafeHeartbeatItems
func (*SafeHeartbeatItems) AddItem ¶
func (i *SafeHeartbeatItems) AddItem(hi Item)
func (*SafeHeartbeatItems) Clear ¶
func (i *SafeHeartbeatItems) Clear()
func (*SafeHeartbeatItems) Len ¶
func (i *SafeHeartbeatItems) Len() int
func (*SafeHeartbeatItems) Value ¶
func (i *SafeHeartbeatItems) Value() []Item
Click to show internal directories.
Click to hide internal directories.