client

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAuthenticationKey

func CreateAuthenticationKey(client *SplunkClient) (string, error)

create an authentication key depending on the method provided

three methods are available:
	1.  HTTP Authorization tokens : a seesion key
	2.  Splunk Authentication tokens
	3.  Basic Authentication

func HandleHttpError

func HandleHttpError(body []byte) (string, error)

return the message of the error when got http error

func MakeHttpRequest

func MakeHttpRequest(client *SplunkClient, method string, spRequestHeaders map[string]string, params url.Values) (*http.Response, error)

MakeHttpRequest creates a new http request - depending on the method (GET, POST, DELETE,...) - and returns the response

Types

type SplunkClient

type SplunkClient struct {
	Client     *http.Client
	Host       string
	Port       string
	Endpoint   string
	Token      string
	Username   string
	Password   string
	SessionKey string
	// if true, ssl verification is skipped
	SkipSSL bool
}

func NewBasicAuthenticatedClient

func NewBasicAuthenticatedClient(client *http.Client, host string, port string, username string, password string, skipSSL bool) *SplunkClient

create a new client with basic authentication method

func NewClient

func NewClient(client *http.Client, host string, port string, token string, username string, password string, sessionKey string, skipSSL bool) *SplunkClient

create a new Client

func NewClientAuthenticatedBySessionKey

func NewClientAuthenticatedBySessionKey(client *http.Client, host string, port string, sessionKey string, skipSSL bool) *SplunkClient

create a new client that could connect with authentication sessionKey

func NewClientAuthenticatedByToken

func NewClientAuthenticatedByToken(client *http.Client, host string, port string, token string, skipSSL bool) *SplunkClient

create a new client that could connect with authentication tokens

Jump to

Keyboard shortcuts

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