Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultFlushInterval = time.Second * 30 DefaultBatchSize = 50 DefaultQueueSize = 4080 )
Variables ¶
View Source
var ( // The timeout duration to push events. PushTimeout = time.Second * 10 )
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct { // The pusher to send events. Pusher *Pusher // The type of the SDK. SDKType string // The SDK version family. SDKVersionFamily string // The printer to print on console. Default is fmt.Println. Printer func(format string, v ...any) }
A logger that logs on the console and generate log events.
type Pusher ¶
type Pusher struct { // The endpoint where events are sent. Endpoint string // The duration between each event flush. FlushInterval time.Duration // The maximum number of event sent at once. Default is 50. BatchSize int // The size of the queue where events are stored. Default is 4080. QueueSize int // The HTTP transport to send events. Default is http.DefaultTransport. Transport http.RoundTripper // The function to encode events. Default is json.Marshal. Encode func(any) ([]byte, error) // contains filtered or unexported fields }
A Pusher that pushes events to a remote endpoint.
Click to show internal directories.
Click to hide internal directories.