Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEventInvalidRequest = errors.New("invalid request") // 400 ErrEventMissingParameters = errors.New("namespace, dataStream or dataTenant not found") // 404 ErrEventPayloadTooLarge = errors.New("payload too large, maximum allowed data size is 1MB") // 413 ErrEventUnknown = errors.New("unknown error") ErrEventMarshal = errors.New("marshal error") ErrEventHTTPRequest = errors.New("HTTP request error") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client has all the context and parameters needed to run a EDP worker pool.
func NewClient ¶
func NewClient(c *Config, httpClient *http.Client, eventsChannel <-chan *Event, logger log.Logger) *Client
NewClient constructs a EDP client from the provided config.
type Config ¶
type Config struct { URL string `kong:"help='EDP base URL',env='EDP_URL',default='https://input.yevents.io',required=true"` Token string `kong:"help='EDP source token',placeholder='SECRET',env='EDP_TOKEN',required=true"` Namespace string `kong:"help='EDP Namespace',env='EDP_NAMESPACE',required=true"` DataStream string `kong:"help='EDP data stream name',env='EDP_DATASTREAM_NAME',required=true"` DataStreamVersion string `kong:"help='EDP data stream version',env='EDP_DATASTREAM_VERSION',required=true"` DataStreamEnv string `kong:"help='EDP data stream environment',env='EDP_DATASTREAM_ENV',required=true"` Timeout time.Duration `kong:"help='Time limit for requests made by the EDP client',env='EDP_TIMEOUT',required=true,default='30s'"` Buffer int `kong:"help='Number of events that the buffer can have.',env='EDP_BUFFER',required=true,default=100"` Workers int `kong:"help='Number of workers to send metrics.',env='EDP_WORKERS',required=true,default=5"` EventRetry int `kong:"help='Number of retries for sending event.',env='EDP_RETRY',required=true,default=5"` }
Config holds EDP clients configuration.
type Event ¶
type Event struct { // Datatenant defines the tenant the event belongs to. Datatenant string // Data represent the provider specific event details in raw json, to delay json decoding. Data *json.RawMessage }
Event has the information needed to send an event to EDP.
func (Event) MarshalJSON ¶
MarshalJSON is a helper function to marshal custom provider data and add timestamp field.
Click to show internal directories.
Click to hide internal directories.