logs

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MPL-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ResourceMappingOp_AND = "AND"
	ResourceMappingOp_OR  = "OR"
)

Variables

This section is empty.

Functions

func NewLogBatch added in v1.0.0

func NewLogBatch() *logsBatch

Types

type LMLogIngest

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

func NewLMLogIngest

func NewLMLogIngest(ctx context.Context, opts ...Option) (*LMLogIngest, error)

NewLMLogIngest initializes LMLogIngest

func (*LMLogIngest) SendLogs

func (logIngest *LMLogIngest) SendLogs(ctx context.Context, body []model.LogInput, o ...SendLogsOptionalParameters) (*SendLogResponse, error)

SendLogs is the entry point for receiving log data

type LMLogIngestResponse added in v1.0.0

type LMLogIngestResponse struct {
	Success   bool                     `json:"success"`
	Message   string                   `json:"message"`
	Errors    []map[string]interface{} `json:"errors"`
	RequestID uuid.UUID                `json:"requestId"`
}

type Option added in v0.2.0

type Option func(*LMLogIngest) error

LMLogIngest configuration options

func WithAuthentication added in v0.3.0

func WithAuthentication(authParams utils.AuthParams) Option

WithAuthentication is used for passing authentication token if not set in environment variables.

func WithEndpoint added in v0.6.1

func WithEndpoint(endpoint string) Option

WithEndpoint is used to set Endpoint URL to export logs

func WithGzipCompression added in v0.4.0

func WithGzipCompression(gzip bool) Option

WithGzipCompression can be used to enable/disable gzip compression of log payload Note: By default, gzip compression is enabled.

func WithHTTPClient added in v0.6.0

func WithHTTPClient(client *http.Client) Option

WithHTTPClient is used to set HTTP client

func WithLogBatchingDisabled added in v0.5.0

func WithLogBatchingDisabled() Option

WithLogBatchingDisabled is used for disabling log batching.

func WithLogBatchingInterval added in v0.5.0

func WithLogBatchingInterval(batchingInterval time.Duration) Option

WithLogBatchingInterval is used for configuring batching time interval for logs.

func WithRateLimit added in v0.6.0

func WithRateLimit(requestCount int) Option

WithRateLimit is used to limit the log request count per minute

func WithResourceMappingOperation added in v1.1.0

func WithResourceMappingOperation(op string) Option

WithResourceMappingOperation is used to set the operation to be used for device mapping

func WithUserAgent added in v1.2.0

func WithUserAgent(userAgent string) Option

WithUserAgent sets the provided user agent

type SendLogResponse added in v1.2.0

type SendLogResponse struct {
	StatusCode int    `json:"statusCode"`
	Success    bool   `json:"success"`
	Message    string `json:"message"`

	RequestID  uuid.UUID `json:"requestId"`
	RetryAfter int       `json:"retryAfter"`

	Error       error `json:"error"`
	MultiStatus []struct {
		Code  float64 `json:"code"`
		Error string  `json:"error"`
	} `json:"multiStatus"`
}

type SendLogsOptionalParameters added in v1.0.0

type SendLogsOptionalParameters struct {
}

func NewSendLogOptionalParameters added in v1.0.0

func NewSendLogOptionalParameters() *SendLogsOptionalParameters

Jump to

Keyboard shortcuts

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