loki

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DerivedField

type DerivedField struct {
	Name string `json:"name"`
	URL  string `json:"url"`
	// Used to parse and capture some part of the log message. You can use the captured groups in the template.
	Regex string `json:"matcherRegex"`
	// Used to override the button label when this derived field is found in a log.
	// Optional.
	URLDisplayLabel string `json:"urlDisplayLabel,omitempty"`
	// For internal links
	// Optional.
	DatasourceUID string `json:"datasourceUid,omitempty"`
}

type Loki

type Loki struct {
	// contains filtered or unexported fields
}

func New

func New(name string, url string, options ...Option) Loki

func (Loki) MarshalJSON

func (datasource Loki) MarshalJSON() ([]byte, error)

func (Loki) Name

func (datasource Loki) Name() string

type Option

type Option func(datasource *Loki)

func BasicAuth

func BasicAuth(username string, password string) Option

BasicAuth configures basic authentication for this datasource.

func Default

func Default() Option

Default configures this datasource to be the default one.

func DerivedFields

func DerivedFields(fields ...DerivedField) Option

DerivedFields defines fields can be used to extract new fields from a log message and create a link from its value.

func ForwardCookies

func ForwardCookies(cookies ...string) Option

ForwardCookies configures a list of cookies that should be forwarded to the datasource.

func ForwardOauthIdentity

func ForwardOauthIdentity() Option

ForwardOauthIdentity forward the user's upstream OAuth identity to the data source (Their access token gets passed along).

func MaximumLines

func MaximumLines(max int) Option

MaximumLines sets the maximum number of lines returned by Loki (default: 1000). Increase this value to have a bigger result set for ad-hoc analysis. Decrease this limit if your browser becomes sluggish when displaying the log results.

func SkipTLSVerify

func SkipTLSVerify() Option

SkipTLSVerify disables verification of SSL certificates.

func Timeout

func Timeout(timeout time.Duration) Option

Timeout sets the timeout for HTTP requests.

func WithCertificate

func WithCertificate(certificate string) Option

WithCertificate sets a self-signed certificate that can be verified against.

func WithCredentials

func WithCredentials() Option

WithCredentials joins credentials such as cookies or auth headers to cross-site requests.

Jump to

Keyboard shortcuts

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