kibana

package module
v0.0.0-...-b704b59 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

README

go-kibana

Go client library for kibana

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Discover

	Config *Config
	// contains filtered or unexported fields
}

Client represents the kibana client

func NewClient

func NewClient(conf *Config, httpClient *http.Client) *Client

NewClient returns a new Kibana API client. If a nil httpClient is provided, a new http.Client will be used. To use API methods which require authentication, provide an http.Client that will perform the authentication for you (such as that provided by the golang.org/x/oauth2 library).

type Config

type Config struct {
	// base address of kibana
	Address string
}

Config represents the client configuration.

type Discover

type Discover interface {
	GenerateURL(search *SearchSource) (string, error)
	ShortURL(url string) (string, error)
}

func NewDiscover

func NewDiscover(conf *Config, httpClient *http.Client) Discover

type Filter

type Filter struct {
	State State           `json:"$state"`
	Meta  FilterMeta      `json:"meta"`
	Query FilterQueryMeta `json:"query"`
}

type FilterMeta

type FilterMeta struct {
	Alias   string       `json:"alias"`
	Disable bool         `json:"disable"`
	Index   string       `json:"index"`
	Key     string       `json:"key"`
	Negate  bool         `json:"negate"`
	Params  FilterParams `json:"params"`
	Type    string       `json:"type"`
	Value   string       `json:"value"`
}

type FilterParams

type FilterParams struct {
	Query string `json:"query"`
	Type  string `json:"type"`
}

type FilterQueryMeta

type FilterQueryMeta struct {
	Match map[string]FilterParams `json:"match"`
}

type QueryMeta

type QueryMeta struct {
	Language string `json:"language"`
	Query    string `json:"query"`
}

type RefreshInterval

type RefreshInterval struct {
	Pause bool `json:"pause"`
	// contains filtered or unexported fields
}

type SearchFields

type SearchFields struct {
	Columns  []string  `json:"columns"`
	Filters  []Filter  `json:"filters"`
	Sort     []string  `json:"sort"`
	Query    QueryMeta `json:"json"`
	Index    string    `json:"index"`
	Interval string    `json:"interval"`
}

type SearchSource

type SearchSource struct {
	Time   *TimeFields
	Search SearchFields
}

type State

type State struct {
	Store string `json:"store"`
}

type TimeFields

type TimeFields struct {
	Refresh RefreshInterval `json:"refreshInterval"`
	Time    TimeRange       `json:"time"`
}

type TimeRange

type TimeRange struct {
	From string `json:"from"`
	Mode string `json:"mode"`
	To   string `json:"to"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL