Documentation ¶
Index ¶
- type AlertClient
- type Client
- type IncidentClient
- type IncidentSummary
- type IncidentSummaryQuery
- func (isq *IncidentSummaryQuery) All(ctx context.Context) ([]*IncidentSummary, error)
- func (isq *IncidentSummaryQuery) First(ctx context.Context) (*IncidentSummary, error)
- func (isq *IncidentSummaryQuery) Query() *IncidentSummaryQuery
- func (isq *IncidentSummaryQuery) Where(s ...predicate.Incident) *IncidentSummaryQuery
- type MinMaxTime
- func (mmt MinMaxTime) After(t MinMaxTime) bool
- func (mmt MinMaxTime) Before(t MinMaxTime) bool
- func (mmt MinMaxTime) IsZero() bool
- func (mmt *MinMaxTime) Scan(value interface{}) error
- func (mmt MinMaxTime) Since(t MinMaxTime) time.Duration
- func (mmt MinMaxTime) String() string
- func (mmt MinMaxTime) Time() time.Time
- func (mmt MinMaxTime) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertClient ¶
type AlertClient struct { *ent.AlertClient // contains filtered or unexported fields }
AlertClient is a wrapper enhaning the ent client
type Client ¶
type Client struct { *ent.Client // IncidentSummary is the query for incident summaries IncidentSummary *IncidentSummaryQuery // Incident wraps and enhances the ent IncidentClient Incident *IncidentClient // Alert wraps and enhances the ent AlertClient Alert *AlertClient // contains filtered or unexported fields }
Client gives access to the DB and wraps ent
type IncidentClient ¶
type IncidentClient struct { *ent.IncidentClient // contains filtered or unexported fields }
IncidentClient is a wrapper enhaning the ent client
func (*IncidentClient) Save ¶
func (ic *IncidentClient) Save(ctx context.Context, msg *msg.IncidentMsg) error
Save save an incident msg to ent
type IncidentSummary ¶
type IncidentSummary struct { IncidentID uuid.UUID `json:"incident_id"` Name string `json:"name"` Total int `json:"total"` IntLevel int `json:"level"` Start MinMaxTime `json:"start"` End MinMaxTime `json:"end"` Error string `json:"error"` }
IncidentSummary is the summary of different incidents entries
func (IncidentSummary) Level ¶
func (is IncidentSummary) Level() status.Level
Level convinience method that calls status Level
type IncidentSummaryQuery ¶
type IncidentSummaryQuery struct { *ent.IncidentQuery // contains filtered or unexported fields }
IncidentSummaryQuery allows quering incidents
func (*IncidentSummaryQuery) All ¶
func (isq *IncidentSummaryQuery) All(ctx context.Context) ([]*IncidentSummary, error)
All returns all incudent summaries
func (*IncidentSummaryQuery) First ¶ added in v0.10.0
func (isq *IncidentSummaryQuery) First(ctx context.Context) (*IncidentSummary, error)
func (*IncidentSummaryQuery) Query ¶
func (isq *IncidentSummaryQuery) Query() *IncidentSummaryQuery
Query returns a list of incidents
func (*IncidentSummaryQuery) Where ¶ added in v0.10.0
func (isq *IncidentSummaryQuery) Where(s ...predicate.Incident) *IncidentSummaryQuery
type MinMaxTime ¶
type MinMaxTime struct {
// contains filtered or unexported fields
}
MinMaxTime is a wrapper around time to support SQL max and min
func (MinMaxTime) After ¶
func (mmt MinMaxTime) After(t MinMaxTime) bool
After is wraps time.Time.After
func (MinMaxTime) Before ¶
func (mmt MinMaxTime) Before(t MinMaxTime) bool
Before is wraps time.Time.Before
func (*MinMaxTime) Scan ¶
func (mmt *MinMaxTime) Scan(value interface{}) error
Scan scan value the time, implements sql.Scanner interface
func (MinMaxTime) Since ¶ added in v0.10.3
func (mmt MinMaxTime) Since(t MinMaxTime) time.Duration
Time returns the underlying time
Source Files ¶
Click to show internal directories.
Click to hide internal directories.