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 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 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.