Documentation
¶
Index ¶
- func EncodeURLParams(url string, params url.Values) string
- func MakeURL(defaultScheme string, defaultPath string, rawURL string, defaultPort int) (string, error)
- func ParseURL(raw string, hints ...ParseHint) (*url.URL, error)
- type Client
- func NewClientWithConfig(config *ClientConfig, binaryName, version, commit, buildtime string) (*Client, error)
- func NewClientWithConfigDefault(config *ClientConfig, defaultPort int, ...) (*Client, error)
- func NewKibanaClient(cfg *config.C, binaryName, version, commit, buildtime string) (*Client, error)
- type ClientConfig
- type Connection
- func (conn *Connection) Request(method, extraPath string, params url.Values, headers http.Header, ...) (int, []byte, error)
- func (conn *Connection) RoundTrip(r *http.Request) (*http.Response, error)
- func (conn *Connection) Send(method, extraPath string, params url.Values, headers http.Header, ...) (*http.Response, error)
- func (conn *Connection) SendWithContext(ctx context.Context, method, extraPath string, params url.Values, ...) (*http.Response, error)
- type ParseHint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
Connection
// contains filtered or unexported fields
}
func NewClientWithConfig ¶
func NewClientWithConfig(config *ClientConfig, binaryName, version, commit, buildtime string) (*Client, error)
NewClientWithConfig creates and returns a kibana client using the given config
func NewClientWithConfigDefault ¶
func NewClientWithConfigDefault(config *ClientConfig, defaultPort int, binaryName, version, commit, buildtime string) (*Client, error)
NewClientWithConfig creates and returns a kibana client using the given config
func NewKibanaClient ¶
NewKibanaClient builds and returns a new Kibana client
func (*Client) GetVersion ¶
GetVersion returns the version read from kibana. The version is not set if IgnoreVersion was set when creating the client.
type ClientConfig ¶
type ClientConfig struct {
Protocol string `config:"protocol" yaml:"protocol,omitempty"`
Host string `config:"host" yaml:"host,omitempty"`
Path string `config:"path" yaml:"path,omitempty"`
SpaceID string `config:"space.id" yaml:"space.id,omitempty"`
Username string `config:"username" yaml:"username,omitempty"`
Password string `config:"password" yaml:"password,omitempty"`
APIKey string `config:"api_key" yaml:"api_key,omitempty"`
ServiceToken string `config:"service_token" yaml:"service_token,omitempty"`
// Headers holds headers to include in every request sent to Kibana.
Headers map[string]string `config:"headers" yaml:"headers,omitempty"`
IgnoreVersion bool
Transport httpcommon.HTTPTransportSettings `config:",inline" yaml:",inline"`
}
ClientConfig to connect to Kibana
func DefaultClientConfig ¶
func DefaultClientConfig() ClientConfig
DefaultClientConfig connects to a locally running kibana over HTTP
func (*ClientConfig) Validate ¶
func (c *ClientConfig) Validate() error
type Connection ¶
type Connection struct {
URL string
Username string
Password string
APIKey string
ServiceToken string
Headers http.Header
HTTP *http.Client
Version version.V
}
func (*Connection) Send ¶
func (conn *Connection) Send(method, extraPath string, params url.Values, headers http.Header, body io.Reader) (*http.Response, error)
Sends an application/json request to Kibana with appropriate kbn headers
func (*Connection) SendWithContext ¶
func (conn *Connection) SendWithContext(ctx context.Context, method, extraPath string, params url.Values, headers http.Header, body io.Reader) (*http.Response, error)
SendWithContext sends an application/json request to Kibana with appropriate kbn headers and the given context.
Click to show internal directories.
Click to hide internal directories.