Documentation ¶
Index ¶
- Constants
- Variables
- type AdInfo
- type Code
- func (c Code) Compress() Code
- func (c Code) Data() []byte
- func (c Code) DecodeObject(target any, gen ...types.DecodeGenerator) error
- func (c Code) Decompress() Code
- func (c Code) Error() string
- func (c Code) ErrorObj() error
- func (c *Code) ResetData()
- func (c Code) String() string
- func (c Code) URLDecode() Code
- func (c Code) URLEncode() Code
- func (c *Code) Write(p []byte) (n int, err error)
- type Event
- func (e *Event) DateTime() time.Time
- func (e *Event) DecodeCodeOld(data string) error
- func (e *Event) EncodeCodeOld() (string, error)
- func (e *Event) Normalize() *Event
- func (e *Event) Pack() Code
- func (e *Event) PreparedURL(https bool, args ...string) string
- func (e *Event) SetDateTime(tmNano int64)
- func (e *Event) String() string
- func (e *Event) TimeFormat(format string) string
- func (e *Event) Unpack(data []byte, unpuckFnc ...func(code Code) Code) error
- func (e *Event) UpdateDateTime()
- func (e *Event) Validate() error
- type LeadCode
- type Type
- type UserInfo
Constants ¶
View Source
const ( StatusUndefined = 0 StatusSuccess = 1 StatusFailed = 2 StatusCompromised = 3 StatusCustom = 4 // User code )
Event status
View Source
const LZ4BlockMaxSize = 64 << 10
LZ4BlockMaxSize constant
Variables ¶
View Source
var ErrEmptyData = errors.New(`data is empty`)
ErrEmptyData error
Functions ¶
This section is empty.
Types ¶
type AdInfo ¶
type AdInfo struct { Time int64 `thrift:",1" json:"tm,omitempty"` // Timestamp Type string `thrift:",2" json:"type,omitempty"` // Type of message info Duration uint64 `thrift:",3" json:"d,omitempty"` // Duration in Nanoseconds Service string `thrift:",4" json:"srv,omitempty"` // Service sender Cluster string `thrift:",5" json:"cl,omitempty"` // Cluster code (eu, us, as) Param1 int `thrift:",6" json:"p1,omitempty"` // Reserved Param2 int `thrift:",7" json:"p2,omitempty"` // Reserved // Accounts link information Project uint64 `thrift:",8" json:"pr,omitempty"` // Project network ID PublisherCompany uint64 `thrift:",9" json:"pcb,omitempty"` // -- // -- AdvertiserCompany uint64 `thrift:",10" json:"acv,omitempty"` // -- // -- // Source AuctionID string `thrift:",11" json:"auc,omitempty"` // Internal Auction ID AuctionType uint8 `thrift:",12" json:"auctype,omitempty"` // Aution type 1 - First price, 2 - Second price ImpID string `thrift:",13" json:"imp,omitempty"` // Sub ID of request for paticular impression spot ImpAdID string `thrift:",14" json:"impad,omitempty"` // Specific ID for paticular ad impression ExtAuctionID string `thrift:",15" json:"eauc,omitempty"` // RTB Request/Response ID ExtImpID string `thrift:",16" json:"eimp,omitempty"` // RTB Imp ID ExtTargetID string `thrift:",17" json:"extz,omitempty"` // RTB Zone ID (tagid) Source uint64 `thrift:",18" json:"src,omitempty"` // Advertisement Source ID Network string `thrift:",19" json:"net,omitempty"` // Source Network Name or Domain (Cross sails) AccessPoint uint64 `thrift:",20" json:"acp,omitempty"` // Access Point ID to own Advertisement }
AdInfo represents some additional information which aggregated during advertisement and ad-request processing
type Code ¶
type Code struct {
// contains filtered or unexported fields
}
Code structure can contains and conver data for URL
func ObjectCode ¶
func ObjectCode(obj any, gen ...types.EncodeGenerator) Code
ObjectCode converts object to code object with defined encoder/decoder
func (Code) DecodeObject ¶
func (c Code) DecodeObject(target any, gen ...types.DecodeGenerator) error
DecodeObject converts current object data to target
type Event ¶
type Event struct { Time int64 `thrift:",1" json:"tm,omitempty"` // Timestamp Delay uint64 `thrift:",2" json:"dl,omitempty"` // Delay of preparation of Ads in Nanosecinds Duration uint64 `thrift:",3" json:"d,omitempty"` // Duration in Nanoseconds Service string `thrift:",4" json:"srv,omitempty"` // Service sender Cluster string `thrift:",5" json:"cl,omitempty"` // Cluster code (eu, us, as) Event Type `thrift:",6" json:"e,omitempty"` // Event code string Status uint8 `thrift:",7" json:"st,omitempty"` // Status: 0 - undefined, 1 - success, 2 - failed, 3 - compromised // Accounts link information ProjectID uint64 `thrift:",8" json:"pr,omitempty"` // Project network ID PublisherAccountID uint64 `thrift:",9" json:"pcb,omitempty"` // -- // -- AdvertiserAccountID uint64 `thrift:",10" json:"acv,omitempty"` // -- // -- // Source AuctionID string `thrift:",11" json:"auc,omitempty"` // Internal Auction ID AuctionType uint8 `thrift:",12" json:"auctype,omitempty"` // Aution type 1 - First price, 2 - Second price ImpID string `thrift:",13" json:"imp,omitempty"` // Sub ID of request for paticular impression spot ImpAdID string `thrift:",14" json:"impad,omitempty"` // Specific ID for paticular ad impression ExtAuctionID string `thrift:",15" json:"eauc,omitempty"` // RTB Request/Response ID ExtImpID string `thrift:",16" json:"eimp,omitempty"` // RTB Imp ID ExtTargetID string `thrift:",17" json:"extz,omitempty"` // RTB Zone ID (tagid) SourceID uint64 `thrift:",18" json:"sid,omitempty"` // Advertisement Source ID Network string `thrift:",19" json:"net,omitempty"` // Source Network Name or Domain (Cross sails) AccessPointID uint64 `thrift:",20" json:"acp,omitempty"` // Access Point ID to own Advertisement // State Location Platform int `thrift:",21" json:"pl,omitempty"` // Where displaid? 0 – undefined, 1 – web site, 2 – native app, 3 – game Domain string `thrift:",22" json:"dm,omitempty"` // If not web site then "bundle" ApplicationID uint64 `thrift:",23" json:"app,omitempty"` // application ID (registered in the system) ZoneID uint64 `thrift:",24" json:"z,omitempty"` // -- // -- PixelID uint64 `thrift:",25" json:"pxl,omitempty"` // -- // -- CampaignID uint64 `thrift:",26" json:"cmp,omitempty"` // Campaign info FormatID uint64 `thrift:",27" json:"fmt,omitempty"` // Format ID AdID uint64 `thrift:",28" json:"ad,omitempty"` // -- // -- AdWidth int `thrift:",29" json:"aw,omitempty"` // -- // -- AdHeight int `thrift:",30" json:"ah,omitempty"` // -- // -- SourceURL string `thrift:",31" json:"su,omitempty"` // Advertisement source URL (iframe, image, video, direct) WinURL string `thrift:",32" json:"wu,omitempty"` // Win URL used for RTB confirmation URL string `thrift:",33" json:"u,omitempty"` // Non modified target URL JumperID uint64 `thrift:",34" json:"j,omitempty"` // Jumper Page ID // Money section // We have a different situations how we are pay for the traffic // For example // 1) If we have external traffic resource: // ViewPrice = 0.01 CPV - Have to pay advertiser // LeadPrice = 40$ - How much will we pay for the lead // PurchaseViewPrice = 0.001 CPV - how much we will pay for this traffic // 2) If external second price auction type // ViewPrice = 0.02 CPV - Have to pay advertiser // PurchaseViewPrice = 0.01 CPV - how much we will pay for this traffic // 3) If we are buying the traffic for CPA // LeadPrice = 20$ - Have to pay advertiser // PurchaseViewPrice = 10$ - Have to pay to the source PricingModel uint `thrift:",36" json:"pm,omitempty"` // Display As CPM/CPC/CPA/CPI TestPriceMode bool `thrift:",37" json:"tpm,omitempty"` // Test price mode ECPM float64 `thrift:",38" json:"ecpm,omitempty"` // Effective Cost per Mille // Prurchase price from SSP or other TRAFFIC sources (menetisation of income requests) // We are buying the place of advertisement display PurchaseViewPrice int64 `thrift:",39" json:"pvpr,omitempty"` // Price of the view of source traffic cost PurchaseClickPrice int64 `thrift:",40" json:"pcpr,omitempty"` // Price of the click of source traffic cost PurchaseLeadPrice int64 `thrift:",41" json:"plpr,omitempty"` // Price of the lead of source traffic cost PotentialViewPrice int64 `thrift:",42" json:"ptvpr,omitempty"` // Price of the view of source of ads oitential PotentialClickPrice int64 `thrift:",43" json:"ptcpr,omitempty"` // Price of the click of source of ads oitential PotentialLeadPrice int64 `thrift:",44" json:"ptlpr,omitempty"` // Price of the lead of source of ads oitential ViewPrice int64 `thrift:",45" json:"vpr,omitempty"` // Price per view ClickPrice int64 `thrift:",46" json:"cpr,omitempty"` // Price per click LeadPrice int64 `thrift:",47" json:"lpr,omitempty"` // Price per lead CompetitorCampaignID uint64 `thrift:",48" json:"cmid,omitempty"` // Competitor compaign ID CompetitorSourceID uint64 `thrift:",49" json:"cmsrc,omitempty"` // Competitor source ID CompetitorECPM float64 `thrift:",50" json:"cmecpm,omitempty"` // Competitor ECPM or auction // User IDENTITY UDID string `thrift:",51" json:"udi,omitempty"` // Unique Device ID (IDFA) UUID string `thrift:",52" json:"uui,omitempty"` // User SessionID string `thrift:",53" json:"ses,omitempty"` // -- // -- Fingerprint string `thrift:",54" json:"fpr,omitempty"` // -- // -- ETag string `thrift:",55" json:"etg,omitempty"` // -- // -- // Targeting CarrierID uint `thrift:",56" json:"car,omitempty"` // -- // -- Country string `thrift:",57" json:"cc,omitempty"` // Country Code ISO-2 City string `thrift:",58" json:"ct,omitempty"` // City Code Latitude string `thrift:",59" json:"lt,omitempty"` // -- // -- Longitude string `thrift:",60" json:"lg,omitempty"` // -- // -- Language string `thrift:",61" json:"lng,omitempty"` // en-US IPString string `thrift:",62" json:"ip,omitempty"` // -- // -- Referer string `thrift:",63" json:"ref,omitempty"` // Referal link Page string `thrift:",64" json:"page,omitempty"` // Page link UserAgent string `thrift:",65" json:"ua,omitempty"` // -- // -- DeviceType uint `thrift:",66" json:"dvt,omitempty"` // Device type 0 - Undefined, 1 - Desktop, etc. DeviceID uint `thrift:",67" json:"dv,omitempty"` // Device ID OSID uint `thrift:",68" json:"os,omitempty"` // OS ID BrowserID uint `thrift:",69" json:"br,omitempty"` // Browser ID Categories string `thrift:",70" json:"c,omitempty"` // -- // -- Adblock uint `thrift:",71" json:"ab,omitempty"` // Ext params PrivateBrowsing uint `thrift:",72" json:"prv,omitempty"` // Private Mode Robot uint `thrift:",73" json:"rt,omitempty"` // Robot traffic Proxy uint `thrift:",74" json:"pt,omitempty"` // Proxy traffic Backup uint `thrift:",75" json:"bt,omitempty"` // Backup Display Type X int `thrift:",76" json:"x,omitempty"` // X - coord of addisplay or click position Y int `thrift:",77" json:"y,omitempty"` // Y - coord of addisplay or click position Width int `thrift:",78" json:"w,omitempty"` // Width - available space Height int `thrift:",79" json:"h,omitempty"` // Height - available space SubID1 string `thrift:",80" json:"sd1,omitempty"` SubID2 string `thrift:",81" json:"sd2,omitempty"` SubID3 string `thrift:",82" json:"sd3,omitempty"` SubID4 string `thrift:",83" json:"sd4,omitempty"` SubID5 string `thrift:",84" json:"sd5,omitempty"` }
Event struct
func (*Event) DecodeCodeOld ¶
DecodeCodeOld URL object
func (*Event) EncodeCodeOld ¶
EncodeCodeOld URL object
func (*Event) PreparedURL ¶
PreparedURL string
type LeadCode ¶
type LeadCode struct { AuctionID string `thrift:",1" json:"id"` // Internal Auction ID ImpAdID string `thrift:",2" json:"iid"` // Specific ID for paticular AD impression SourceID uint64 `thrift:",3" json:"sid,omitempty"` ProjectID uint64 `thrift:",4" json:"pid,omitempty"` PublisherCompany uint64 `thrift:",5" json:"pub,omitempty"` AdvertiserCompany uint64 `thrift:",6" json:"adv,omitempty"` CampaignID uint64 `thrift:",7" json:"cid,omitempty"` AdID uint64 `thrift:",8" json:"aid,omitempty"` Price int64 `thrift:",9" json:"p,omitempty"` Timestamp int64 `thrift:",10" json:"ts"` // In seconds }
LeadCode object
type Type ¶
type Type string
Type of event
const ( Undefined Type = "" Request Type = "request" Impression Type = "impression" View Type = "view" Direct Type = "direct" Click Type = "click" Lead Type = "lead" // Source types SourceNoBid Type = "src.nobid" SourceBid Type = "src.bid" SourceWin Type = "src.win" SourceFail Type = "src.fail" SourceSkip Type = "src.skip" // Access Point types AccessPointNoBid Type = "ap.nobid" AccessPointBid Type = "ap.bid" AccessPointWin Type = "ap.win" AccessPointBillingNotice Type = "ap.bin" AccessPointFail Type = "ap.fail" AccessPointSkip Type = "ap.skip" )
Event types
type UserInfo ¶
type UserInfo struct { Time int64 `json:"tm,omitempty"` // Timestamp AuctionID string `json:"auc,omitempty"` // Internal Auction ID // User IDENTITY UDID string `json:"udi,omitempty"` // Unique Device ID (IDFA) UUID string `json:"uui,omitempty"` // User SessionID string `json:"ses,omitempty"` // -- // -- // Personal information Age byte `age:"age,omitempty"` Gender byte `json:"gender,omitempty"` SearchGender byte `json:"search_gender,omitempty"` Email string `json:"email,omitempty"` Phone string `json:"phone,omitempty"` MessangerType string `json:"messanger_type,omitempty"` Messanger string `json:"messanger,omitempty"` Postcode string `json:"zip,omitempty"` Facebook string `json:"facebook,omitempty"` Twitter string `json:"twitter,omitempty"` Linkedin string `json:"linkedin,omitempty"` // Location info Country string `json:"cc,omitempty"` // Country Code ISO-2 City string `json:"ct,omitempty"` // City Code Latitude string `json:"lt,omitempty"` // -- // -- Longitude string `json:"lg,omitempty"` // -- // -- Language string `json:"lng,omitempty"` // en-US }
UserInfo collects the general information about users
Source Files ¶
Click to show internal directories.
Click to hide internal directories.