Documentation ¶
Index ¶
- func Enrich[E Event](now time.Time, hostname string, countInBatch, batchSize int, event E) E
- func GetHostname() string
- func Send[E Event](ctx context.Context, client Client, traceID TraceID, events []E) error
- type AbsoluteEvent
- type AzureAuthSharedKey
- type AzureBlobStorageClientConfig
- type AzureClient
- type AzureError
- type Client
- type Event
- type HTTPClient
- type IncrementalEvent
- type JSONError
- type RequestError
- type S3Client
- type S3ClientConfig
- type S3Error
- type TraceID
- type UnexpectedStatusCodeError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enrich ¶ added in v0.12.0
Enrich sets the event's Type and IdempotencyKey fields, so that users of this API don't need to manually set them
func GetHostname ¶ added in v0.28.0
func GetHostname() string
GetHostname returns the hostname to be used for enriching billing events (see Enrich())
This function MUST NOT be run before init has finished.
Types ¶
type AbsoluteEvent ¶
type AzureAuthSharedKey ¶ added in v0.33.0
type AzureAuthSharedKey struct {}
type AzureBlobStorageClientConfig ¶ added in v0.33.0
type AzureBlobStorageClientConfig struct { // In Azure a Container is close to a bucket in AWS S3 Container string `json:"container"` // Files will be created with name starting with PrefixInContainer PrefixInContainer string `json:"prefixInContainer"` // Example Endpoint: "https://MYSTORAGEACCOUNT.blob.core.windows.net/" Endpoint string `json:"endpoint"` // contains filtered or unexported fields }
type AzureClient ¶ added in v0.33.0
type AzureClient struct {
// contains filtered or unexported fields
}
func NewAzureBlobStorageClient ¶ added in v0.33.0
func NewAzureBlobStorageClient(cfg AzureBlobStorageClientConfig) (*AzureClient, error)
func (AzureClient) LogFields ¶ added in v0.33.0
func (c AzureClient) LogFields() zap.Field
type AzureError ¶ added in v0.33.0
type AzureError struct {
Err error
}
func (AzureError) Error ¶ added in v0.33.0
func (e AzureError) Error() string
func (AzureError) Unwrap ¶ added in v0.33.0
func (e AzureError) Unwrap() error
type Event ¶ added in v0.12.0
type Event interface { *AbsoluteEvent | *IncrementalEvent // contains filtered or unexported methods }
type HTTPClient ¶ added in v0.29.0
type HTTPClient struct { URL string // contains filtered or unexported fields }
func NewHTTPClient ¶ added in v0.29.0
func NewHTTPClient(url string, c *http.Client) HTTPClient
func (HTTPClient) LogFields ¶ added in v0.29.0
func (c HTTPClient) LogFields() zap.Field
type IncrementalEvent ¶
type RequestError ¶ added in v0.18.0
type RequestError struct {
Err error
}
func (RequestError) Error ¶ added in v0.18.0
func (e RequestError) Error() string
func (RequestError) Unwrap ¶ added in v0.18.0
func (e RequestError) Unwrap() error
type S3Client ¶ added in v0.29.0
type S3Client struct {
// contains filtered or unexported fields
}
func NewS3Client ¶ added in v0.29.0
func NewS3Client(ctx context.Context, cfg S3ClientConfig) (*S3Client, error)
type S3ClientConfig ¶ added in v0.29.0
type TraceID ¶ added in v0.12.0
type TraceID string
func GenerateTraceID ¶ added in v0.29.0
func GenerateTraceID() TraceID
type UnexpectedStatusCodeError ¶ added in v0.18.0
type UnexpectedStatusCodeError struct {
StatusCode int
}
func (UnexpectedStatusCodeError) Error ¶ added in v0.18.0
func (e UnexpectedStatusCodeError) Error() string
Click to show internal directories.
Click to hide internal directories.