Documentation ¶
Index ¶
- Variables
- type Client
- type Command
- type ParseError
- type Query
- func (q *Query) And(n int) *Query
- func (q *Query) Columns(names ...string) *Query
- func (q *Query) Filter(rule string) *Query
- func (q *Query) KeepAlive() *Query
- func (q *Query) Limit(n int) *Query
- func (q *Query) Negate() *Query
- func (q *Query) Or(n int) *Query
- func (q *Query) ReadTimeout(timeout time.Duration) *Query
- func (q Query) String() string
- func (q *Query) WaitCondition(rule string) *Query
- func (q *Query) WaitConditionAnd(n int) *Query
- func (q *Query) WaitConditionNegate() *Query
- func (q *Query) WaitConditionOr(n int) *Query
- func (q *Query) WaitObject(name string) *Query
- func (q *Query) WaitTimeout(d time.Duration) *Query
- func (q *Query) WaitTrigger(event string) *Query
- func (q *Query) WriteTimeout(timeout time.Duration) *Query
- type Record
- func (r Record) Columns() []string
- func (r Record) Get(column string) (interface{}, error)
- func (r Record) GetBool(column string) (bool, error)
- func (r Record) GetFloat(column string) (float64, error)
- func (r Record) GetInt(column string) (int64, error)
- func (r Record) GetSlice(column string) ([]interface{}, error)
- func (r Record) GetString(column string) (string, error)
- func (r Record) GetTime(column string) (time.Time, error)
- func (r Record) Len() int
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidQuery represents an invalid query error. ErrInvalidQuery = errors.New("invalid query") // ErrInvalidType represents an invalid type error. ErrInvalidType = errors.New("invalid type") // ErrUnknownColumn represents an unknown column error. ErrUnknownColumn = errors.New("unknown column") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a Livestatus client instance.
func NewClientWithDialer ¶
NewClientWithDialer creates a new Livestatus client instance using a provided network dialer.
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command represents a Livestatus command instance.
func NewCommand ¶
NewCommand creates a new Livestatus command instance.
type ParseError ¶
ParseError embeded an error with some states to help debugging
func (ParseError) Error ¶
func (pe ParseError) Error() string
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query represents a Livestatus query instance.
func (*Query) ReadTimeout ¶
ReadTimeout sets the connection timeout for read operations. Be careful when using a read timeout in conjunction with wait conditions. A value of 0 disables the timeout.
func (*Query) WaitCondition ¶
WaitCondition appends a new wait condition to the query.
func (*Query) WaitConditionAnd ¶
WaitConditionAnd combines the n last wait conditions into a new wait condition using a `And` operation.
func (*Query) WaitConditionNegate ¶
WaitConditionNegate negates the most recent wait condition.
func (*Query) WaitConditionOr ¶
WaitConditionOr combines the n last wait conditions into a new wait condition using a `Or` operation.
func (*Query) WaitObject ¶
WaitObject specifies an object from the table to wait on.
For `hosts`, `hostgroups`, `servicegroups`, `contacts` and `contactgroups` tables this is simply the name of the object. For the `services` table it is the `hostname` and the service `description` separated by a space.
func (*Query) WaitTimeout ¶
WaitTimeout sets the upper limit on the time to wait before executing the query.
func (*Query) WaitTrigger ¶
WaitTrigger appends a new wait trigger to the query, waiting for a specific event broker message to recheck condition.
type Record ¶
type Record map[string]interface{}
Record represents a Livestatus response entry.