Documentation ¶
Index ¶
- func Samples() error
- func SamplesChkHits() error
- func SetDB(database database.Database)
- type Checkin
- func (c *Checkin) Close()
- func (c *Checkin) Create() error
- func (c *Checkin) CreateFailure(f *failures.Failure) error
- func (c *Checkin) Delete() error
- func (c *Checkin) Expected() time.Duration
- func (c *Checkin) Failures() failures.Failurer
- func (c *Checkin) FailuresColumnID() (string, int64)
- func (c *Checkin) FailuresSince(t time.Time) failures.Failurer
- func (c *Checkin) Grace() time.Duration
- func (c *Checkin) Hits() []*CheckinHit
- func (c *Checkin) IsRunning() bool
- func (c *Checkin) LastHit() *CheckinHit
- func (c *Checkin) Link() string
- func (c *Checkin) Period() time.Duration
- func (c *Checkin) RecheckCheckinFailure(guard chan struct{})
- func (c *Checkin) Start()
- func (c *Checkin) String() string
- func (c *Checkin) Update() error
- type CheckinHit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SamplesChkHits ¶
func SamplesChkHits() error
Types ¶
type Checkin ¶
type Checkin struct { Id int64 `gorm:"primary_key;column:id" json:"id"` ServiceId int64 `gorm:"index;column:service" json:"service_id"` Name string `gorm:"column:name" json:"name"` Interval int64 `gorm:"column:check_interval" json:"interval"` GracePeriod int64 `gorm:"column:grace_period" json:"grace"` ApiKey string `gorm:"column:api_key" json:"api_key"` CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` Running chan bool `gorm:"-" json:"-"` Failing bool `gorm:"-" json:"failing"` LastHitTime time.Time `gorm:"-" json:"last_hit"` AllHits []*CheckinHit `gorm:"-" json:"hits"` AllFailures []*failures.Failure `gorm:"-" json:"failures"` }
Checkin struct will allow an application to send a recurring HTTP GET to confirm a service is online
func (*Checkin) FailuresColumnID ¶
func (*Checkin) Grace ¶
Grace will return the duration of the Checkin Grace Period (after service hasn't responded, wait a bit for a response)
func (*Checkin) Hits ¶
func (c *Checkin) Hits() []*CheckinHit
func (*Checkin) LastHit ¶
func (c *Checkin) LastHit() *CheckinHit
func (*Checkin) RecheckCheckinFailure ¶
func (c *Checkin) RecheckCheckinFailure(guard chan struct{})
RecheckCheckinFailure will check if a Service Checkin has been reported yet
type CheckinHit ¶
type CheckinHit struct { Id int64 `gorm:"primary_key;column:id" json:"id"` Checkin int64 `gorm:"index;column:checkin" json:"-"` From string `gorm:"column:from_location" json:"from"` CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` }
CheckinHit is a successful response from a Checkin
func (*CheckinHit) Create ¶
func (c *CheckinHit) Create() error
func (*CheckinHit) Delete ¶
func (c *CheckinHit) Delete() error
func (*CheckinHit) Update ¶
func (c *CheckinHit) Update() error
Click to show internal directories.
Click to hide internal directories.