Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(env *Options) destination.Destination
New returns a valid Blacksmith destination.Destination for Amplitude.
Types ¶
type Alias ¶
type Alias struct { APIKey string `json:"api_key,omitempty"` Mapping []UserMap `json:"mapping"` // contains filtered or unexported fields }
Alias implements the Blacksmith destination.Action interface for the action "alias". It holds the complete job's structure to load into the destination.
func (Alias) Load ¶
func (a Alias) Load(tk *destination.Toolkit, queue *store.Queue, then chan<- destination.Then)
Load is the function being run by the scheduler to load the data into the destination. It is in charge of the "L" in the ETL process.
func (Alias) Marshal ¶
func (a Alias) Marshal(tk *destination.Toolkit) (*destination.Job, error)
Marshal is the function being run when the action receives data into the Alias receiver. It allows to transform and enrich the data before saving it in the store adapter.
func (Alias) Schedule ¶
func (a Alias) Schedule() *destination.Schedule
Schedule allows the action to override the schedule options of its destination. Do not override.
type Amplitude ¶
type Amplitude struct {
// contains filtered or unexported fields
}
Amplitude implements the Blacksmith destination.Destination interface for the destination "amplitude".
func (*Amplitude) Actions ¶
func (d *Amplitude) Actions() map[string]destination.Action
Actions return a list of actions the destination Amplitude is able to handle.
func (*Amplitude) Options ¶
func (d *Amplitude) Options() *destination.Options
Options returns common destination options for Amplitude. They will be shared across every actions of this destination, except when overridden.
type Event ¶
type Event struct { Event string `json:"event_type"` InsertId string `json:"insert_id,omitempty"` UserId string `json:"user_id"` DeviceId string `json:"device_id"` Time int64 `json:"time,omitempty"` Traits analytics.Traits `json:"user_properties"` Context *analytics.Context `json:"event_properties"` AppVersion string `json:"app_version,omitempty"` Platform string `json:"platform,omitempty"` OSName string `json:"os_name,omitempty"` OSVersion string `json:"os_version,omitempty"` DeviceBrand string `json:"device_brand,omitempty"` DeviceManufacturer string `json:"device_manufacturer,omitempty"` DeviceModel string `json:"device_model,omitempty"` Carrier string `json:"carrier,omitempty"` Country string `json:"country,omitempty"` Region string `json:"region,omitempty"` City string `json:"city,omitempty"` Latitude float64 `json:"location_lat,omitempty"` Longitude float64 `json:"location_lng,omitempty"` DMA string `json:"dma,omitempty"` Language string `json:"language,omitempty"` Paying string `json:"paying,omitempty"` StartVersion string `json:"start_version,omitempty"` IP net.IP `json:"ip,omitempty"` ProductId string `json:"productId,omitempty"` Quantity float64 `json:"quantity,omitempty"` Price float64 `json:"price,omitempty"` Revenue float64 `json:"revenue,omitempty"` }
Event holds the data of a event for the Amplitude API. It is used by the Identify, Track, Page, and Screen actions.
type Group ¶
type Group struct { APIKey string `json:"api_key,omitempty"` Identification []Identification `json:"identification"` // contains filtered or unexported fields }
Group implements the Blacksmith destination.Action interface for the action "group". It holds the complete job's structure to load into the destination.
func (Group) Load ¶
func (a Group) Load(tk *destination.Toolkit, queue *store.Queue, then chan<- destination.Then)
Load is the function being run by the scheduler to load the data into the destination. It is in charge of the "L" in the ETL process.
func (Group) Marshal ¶
func (a Group) Marshal(tk *destination.Toolkit) (*destination.Job, error)
Marshal is the function being run when the action receives data into the Group receiver. It allows to transform and enrich the data before saving it in the store adapter.
func (Group) Schedule ¶
func (a Group) Schedule() *destination.Schedule
Schedule allows the action to override the schedule options of its destination. Do not override.
type Identification ¶
type Identification struct { UserId string `json:"user_id"` GroupType string `json:"group_type,omitempty"` GroupValue string `json:"group_value"` GroupProperties analytics.Traits `json:"group_properties"` }
Identification struct holds the data needed to identify a user within a group in Amplitude. It is used by the Group action.
type Identify ¶
type Identify struct { APIKey string `json:"api_key,omitempty"` Events []Event `json:"events"` // contains filtered or unexported fields }
Identify implements the Blacksmith destination.Action interface for the action "identify". It holds the complete job's structure to load into the destination.
func (Identify) Load ¶
func (a Identify) Load(tk *destination.Toolkit, queue *store.Queue, then chan<- destination.Then)
Load is the function being run by the scheduler to load the data into the destination. It is in charge of the "L" in the ETL process.
func (Identify) Marshal ¶
func (a Identify) Marshal(tk *destination.Toolkit) (*destination.Job, error)
Marshal is the function being run when the action receives data into the Identify receiver. It allows to transform and enrich the data before saving it in the store adapter.
func (Identify) Schedule ¶
func (a Identify) Schedule() *destination.Schedule
Schedule allows the action to override the schedule options of its destination. Do not override.
type Options ¶
type Options struct { // Realtime indicates if the pubsub adapter of the Blacksmith application shall // be used to load events to the destination in realtime or not. When false, the // Interval will be used. Realtime bool // Interval represents an interval or a CRON string at which a job shall be // loaded to the destination. It is used as the time-lapse between retries in // case of a job failure. // // Defaults to "@every 1h". Interval string // MaxRetries indicates the maximum number of retries per job the scheduler will // attempt to execute before it succeed. When the limit is reached, the job is // marked as "discarded". // // Defaults to 72. MaxRetries uint16 // APIKey is the Amplitude API Key to use for loading data into Amplitude. You // can copy-paste your Amplitude API Key from the Amplitude Settings page. // // Required. APIKey string }
Options is the options the destination can take as an input to be configured.
type Page ¶
type Page struct { APIKey string `json:"api_key,omitempty"` Events []Event `json:"events"` // contains filtered or unexported fields }
Page implements the Blacksmith destination.Action interface for the action "page". It holds the complete job's structure to load into the destination.
func (Page) Load ¶
func (a Page) Load(tk *destination.Toolkit, queue *store.Queue, then chan<- destination.Then)
Load is the function being run by the scheduler to load the data into the destination. It is in charge of the "L" in the ETL process.
func (Page) Marshal ¶
func (a Page) Marshal(tk *destination.Toolkit) (*destination.Job, error)
Marshal is the function being run when the action receives data into the Page receiver. It allows to transform and enrich the data before saving it in the store adapter.
func (Page) Schedule ¶
func (a Page) Schedule() *destination.Schedule
Schedule allows the action to override the schedule options of its destination. Do not override.
type Screen ¶
type Screen struct { APIKey string `json:"api_key,omitempty"` Events []Event `json:"events"` // contains filtered or unexported fields }
Screen implements the Blacksmith destination.Action interface for the action "screen". It holds the complete job's structure to load into the destination.
func (Screen) Load ¶
func (a Screen) Load(tk *destination.Toolkit, queue *store.Queue, then chan<- destination.Then)
Load is the function being run by the scheduler to load the data into the destination. It is in charge of the "L" in the ETL process.
func (Screen) Marshal ¶
func (a Screen) Marshal(tk *destination.Toolkit) (*destination.Job, error)
Marshal is the function being run when the action receives data into the Screen receiver. It allows to transform and enrich the data before saving it in the store adapter.
func (Screen) Schedule ¶
func (a Screen) Schedule() *destination.Schedule
Schedule allows the action to override the schedule options of its destination. Do not override.
type Track ¶
type Track struct { APIKey string `json:"api_key,omitempty"` Events []Event `json:"events"` // contains filtered or unexported fields }
Track implements the Blacksmith destination.Action interface for the action "track". It holds the complete job's structure to load into the destination.
func (Track) Load ¶
func (a Track) Load(tk *destination.Toolkit, queue *store.Queue, then chan<- destination.Then)
Load is the function being run by the scheduler to load the data into the destination. It is in charge of the "L" in the ETL process.
func (Track) Marshal ¶
func (a Track) Marshal(tk *destination.Toolkit) (*destination.Job, error)
Marshal is the function being run when the action receives data into the Track receiver. It allows to transform and enrich the data before saving it in the store adapter.
func (Track) Schedule ¶
func (a Track) Schedule() *destination.Schedule
Schedule allows the action to override the schedule options of its destination. Do not override.