Documentation
¶
Index ¶
- Constants
- Variables
- func CountryFilter(arr gosql.NullableStringArray) (narr gosql.NullableOrderedNumberArray[uint64], executed bool)
- func IDArrayFilter(arr gosql.NullableOrderedNumberArray[int64]) (narr gosql.NullableOrderedNumberArray[uint64], executed bool)
- func IDArrayFilterAny(v any, panicMsg string) (gosql.NullableOrderedNumberArray[uint64], bool)
- func IntArrayToInt64(arr []int) (res gosql.NullableOrderedNumberArray[int64])
- func IntArrayToUint64(arr []int) (res gosql.NullableOrderedNumberArray[uint64])
- func LanguageFilter(arr gosql.NullableStringArray) (narr gosql.NullableOrderedNumberArray[uint64], executed bool)
- func StringArrayFilter(arr gosql.NullableStringArray) (gosql.StringArray, bool)
- func TestTimeRequest(h Hours, UTCOffset int, pointer TimeRequestPointer) bool
- type ActiveStatus
- func (st ActiveStatus) IsActive() bool
- func (st ActiveStatus) MarshalJSON() ([]byte, error)
- func (st ActiveStatus) Name() string
- func (st *ActiveStatus) Scan(value any) error
- func (st *ActiveStatus) UnmarshalJSON(b []byte) error
- func (st *ActiveStatus) UnmarshalYAML(unmarshal func(any) error) error
- func (st ActiveStatus) Value() (driver.Value, error)
- type AdFileAssetType
- func (ft AdFileAssetType) Code() string
- func (ft AdFileAssetType) IsHTML5() bool
- func (ft AdFileAssetType) IsImage() bool
- func (ft AdFileAssetType) IsUndefined() bool
- func (ft AdFileAssetType) IsVASTTag() bool
- func (ft AdFileAssetType) IsVideo() bool
- func (ft AdFileAssetType) MarshalJSON() ([]byte, error)
- func (ft AdFileAssetType) Name() string
- func (ft AdFileAssetType) Num() int
- func (ft *AdFileAssetType) Scan(value any) error
- func (ft *AdFileAssetType) UnmarshalJSON(b []byte) error
- func (ft AdFileAssetType) Value() (driver.Value, error)
- type AppInfo
- type ApplicationType
- func (tp ApplicationType) DisplayName() string
- func (tp ApplicationType) MarshalJSON() ([]byte, error)
- func (tp ApplicationType) Name() string
- func (tp *ApplicationType) Scan(value any) error
- func (tp *ApplicationType) UnmarshalJSON(b []byte) error
- func (tp ApplicationType) Value() (driver.Value, error)
- type ApproveStatus
- func (st ApproveStatus) DisplayName() string
- func (st ApproveStatus) IsApproved() bool
- func (st ApproveStatus) MarshalJSON() ([]byte, error)
- func (st ApproveStatus) Name() string
- func (st *ApproveStatus) Scan(value any) error
- func (st *ApproveStatus) UnmarshalJSON(b []byte) error
- func (st *ApproveStatus) UnmarshalYAML(unmarshal func(any) error) error
- func (st ApproveStatus) Value() (driver.Value, error)
- type AuctionType
- func (at AuctionType) DisplayName() string
- func (at AuctionType) IsFirtsPrice() bool
- func (at AuctionType) IsSecondPrice() bool
- func (at AuctionType) MarshalJSON() ([]byte, error)
- func (at AuctionType) Name() string
- func (at *AuctionType) Scan(value any) error
- func (at *AuctionType) UnmarshalJSON(b []byte) error
- func (at *AuctionType) UnmarshalYAML(unmarshal func(any) error) error
- func (at AuctionType) Value() (driver.Value, error)
- type BaseFilter
- func (fl *BaseFilter) Reset()
- func (fl *BaseFilter) SetAppIDs(arr []uint64)
- func (fl *BaseFilter) SetApps(arr []int64)
- func (fl *BaseFilter) SetBrowsers(data any)
- func (fl *BaseFilter) SetCategories(data any)
- func (fl *BaseFilter) SetCountries(data any)
- func (fl *BaseFilter) SetDeviceTypes(data any)
- func (fl *BaseFilter) SetDevices(data any)
- func (fl *BaseFilter) SetDomains(arr gosql.NullableStringArray)
- func (fl *BaseFilter) SetFormats(arr []string)
- func (fl *BaseFilter) SetInterstitialFormats(arr []string)
- func (fl *BaseFilter) SetLanguages(data any)
- func (fl *BaseFilter) SetOS(data any)
- func (fl *BaseFilter) SetPositive(field uint64, positive bool)
- func (fl *BaseFilter) SetTrafficSources(data any)
- func (fl *BaseFilter) SetZoneIDs(arr []uint64)
- func (fl *BaseFilter) SetZones(arr []int64)
- func (fl *BaseFilter) Test(t TargetPointer) bool
- func (fl *BaseFilter) TestFormat(f *Format) bool
- func (fl *BaseFilter) TestInterstitialFormat(f *Format) bool
- type BidFormater
- type BrowserInfo
- type CarrierInfo
- type DeviceInfo
- type FilterField
- type Format
- func (f *Format) CloneWithSize(width, height, minWidth, minHeight int) *Format
- func (f Format) Code() uint64
- func (f Format) Compare(format *Format) (r int)
- func (f Format) Diagonal() float64
- func (f *Format) GetConfig() *FormatConfig
- func (f Format) IsBanner() bool
- func (f *Format) IsCloned() bool
- func (f Format) IsDirect() bool
- func (f *Format) IsFixed() bool
- func (f Format) IsNative() bool
- func (f Format) IsProxy() bool
- func (f *Format) IsStretch() bool
- func (f Format) IsVideo() bool
- func (f *Format) IsZero() bool
- func (f Format) String() string
- func (f Format) SuitsCompare(format *Format) int
- func (f Format) SuitsCompareSize(w, h, mw, mh int) int
- type FormatConfig
- func (c *FormatConfig) AssetByName(name string) *FormatFileRequirement
- func (c *FormatConfig) ContainsAsset(asset *FormatFileRequirement, revers ...bool) bool
- func (c *FormatConfig) GetField(name string) *FormatField
- func (c *FormatConfig) Intersec(conf *FormatConfig) bool
- func (c *FormatConfig) IsEmpty() bool
- func (c *FormatConfig) MainAsset() (as *FormatFileRequirement)
- func (c *FormatConfig) RequiredField(fields ...string) *FormatField
- func (c *FormatConfig) RequiredFieldExcept(fields ...string) *FormatField
- func (c *FormatConfig) SimilarField(field *FormatField, revers ...bool) *FormatField
- func (c *FormatConfig) SimpleAsset() (as *FormatFileRequirement)
- type FormatField
- type FormatFieldType
- type FormatFileRequirement
- func (f FormatFileRequirement) GetName() string
- func (f FormatFileRequirement) IsFixed() bool
- func (f FormatFileRequirement) IsHTML5Support() bool
- func (f FormatFileRequirement) IsImageSupport() bool
- func (f FormatFileRequirement) IsMain() bool
- func (f FormatFileRequirement) IsMimeTypeSupport(mimePrefix string) bool
- func (f *FormatFileRequirement) IsRequired() bool
- func (f FormatFileRequirement) IsSoundSupport() bool
- func (f FormatFileRequirement) IsVideoSupport() bool
- func (f *FormatFileRequirement) MinMaxHeight() (mn, mx int)
- func (f *FormatFileRequirement) MinMaxWidth() (mn, mx int)
- func (f FormatFileRequirement) SoftEqual(asset *FormatFileRequirement) bool
- type FormatType
- func (t FormatType) DisplayName() string
- func (t FormatType) IsBanner() bool
- func (t FormatType) IsBannerHTML5() bool
- func (t FormatType) IsDirect() bool
- func (t FormatType) IsInvalid() bool
- func (t FormatType) IsNative() bool
- func (t FormatType) IsProxy() bool
- func (t FormatType) IsUndefined() bool
- func (t FormatType) MarshalJSON() ([]byte, error)
- func (t FormatType) Name() string
- func (t *FormatType) Scan(value any) error
- func (t *FormatType) UnmarshalJSON(b []byte) error
- func (t FormatType) Value() (driver.Value, error)
- type FormatTypeBitset
- func (b FormatTypeBitset) FirstType() FormatType
- func (b *FormatTypeBitset) Has(t FormatType) bool
- func (b FormatTypeBitset) HasOneType() FormatType
- func (b FormatTypeBitset) Intersec(set FormatTypeBitset) FormatTypeBitset
- func (b *FormatTypeBitset) Is(t FormatType) bool
- func (b FormatTypeBitset) IsEmpty() bool
- func (b *FormatTypeBitset) IsIntersec(set FormatTypeBitset) bool
- func (b *FormatTypeBitset) Reset() *FormatTypeBitset
- func (b *FormatTypeBitset) Set(types ...FormatType) *FormatTypeBitset
- func (b *FormatTypeBitset) SetBitset(bitset ...FormatTypeBitset) *FormatTypeBitset
- func (b *FormatTypeBitset) SetFromFormats(formats ...*Format) *FormatTypeBitset
- func (b *FormatTypeBitset) SetOne(t FormatType) *FormatTypeBitset
- func (b *FormatTypeBitset) SetOneBitset(bitset FormatTypeBitset) *FormatTypeBitset
- func (b FormatTypeBitset) Types() (list []FormatType)
- func (b *FormatTypeBitset) Unset(types ...FormatType) *FormatTypeBitset
- type FormatsAccessor
- type GeoInfo
- type Hours
- type ListFormat
- type MultiTargetPointer
- type OSInfo
- type PlatformType
- type PricingModel
- func (pm PricingModel) IsCPA() bool
- func (pm PricingModel) IsCPC() bool
- func (pm PricingModel) IsCPM() bool
- func (pm PricingModel) IsCPV() bool
- func (pm PricingModel) MarshalJSON() ([]byte, error)
- func (pm PricingModel) Name() string
- func (pm PricingModel) Or(npm PricingModel) PricingModel
- func (pm *PricingModel) Scan(value any) error
- func (pm PricingModel) String() string
- func (pm PricingModel) UInt() uint
- func (pm *PricingModel) UnmarshalJSON(b []byte) error
- func (pm PricingModel) Value() (driver.Value, error)
- type PrivateStatus
- func (st PrivateStatus) IsPrivate() bool
- func (st PrivateStatus) MarshalJSON() ([]byte, error)
- func (st PrivateStatus) Name() string
- func (st *PrivateStatus) Scan(value any) error
- func (st *PrivateStatus) UnmarshalJSON(b []byte) error
- func (st *PrivateStatus) UnmarshalYAML(unmarshal func(any) error) error
- func (st PrivateStatus) Value() (driver.Value, error)
- type ProcessingStatus
- func (st ProcessingStatus) Code() string
- func (st ProcessingStatus) MarshalJSON() ([]byte, error)
- func (st ProcessingStatus) Name() string
- func (st *ProcessingStatus) Scan(value any) error
- func (st *ProcessingStatus) UnmarshalJSON(b []byte) error
- func (st ProcessingStatus) Value() (driver.Value, error)
- type RTBRequestType
- type SimpleFormatAccessor
- func (fa *SimpleFormatAccessor) DirectFormatSet() *searchtypes.NumberBitset[uint]
- func (fa *SimpleFormatAccessor) FormatByCode(code string) *Format
- func (fa *SimpleFormatAccessor) FormatByID(id uint64) *Format
- func (fa *SimpleFormatAccessor) Formats() []*Format
- func (fa *SimpleFormatAccessor) FormatsBySize(w, h, minWidth, minHeight int, fmtTypes ...FormatTypeBitset) []*Format
- func (fa *SimpleFormatAccessor) Prepare()
- func (fa *SimpleFormatAccessor) Reload() error
- type SiteInfo
- type TargetPointer
- type TimeRequestPointer
- type Version
- func (v *Version) IsEmpty() bool
- func (v *Version) Less(other Version) bool
- func (v *Version) MarshalJSON() ([]byte, error)
- func (v *Version) Scan(value any) error
- func (v *Version) SetFromStr(str string) error
- func (v *Version) String() string
- func (v *Version) UnmarshalJSON(data []byte) error
- func (v Version) Value() (driver.Value, error)
- type ZoneType
- func (tp ZoneType) IsSmartlink() bool
- func (st ZoneType) MarshalJSON() ([]byte, error)
- func (tp ZoneType) Name() string
- func (st *ZoneType) Scan(value any) error
- func (st *ZoneType) UnmarshalJSON(b []byte) error
- func (st *ZoneType) UnmarshalYAML(unmarshal func(any) error) error
- func (st ZoneType) Value() (driver.Value, error)
Constants ¶
const ( ApplicationUndefined ApplicationType = 0 ApplicationSite ApplicationType = 1 ApplicationApp ApplicationType = 2 ApplicationGame ApplicationType = 3 ApplicationUndefinedName = `undefined` ApplicationSiteName = `site` ApplicationAppName = `application` ApplicationGameName = `game` )
Application type
const ( StatusPending ApproveStatus = 0 StatusApproved ApproveStatus = 1 StatusRejected ApproveStatus = 2 StatusPendingName = `pending` StatusApprovedName = `approved` StatusRejectedName = `rejected` )
Status approve
const ( SecureAny int8 = iota // do not filter by HTTPS SecureOnly // HTTPS only SecureExclude // HTTP only )
Secure request filter values.
const ( AdBlockAny int8 = iota // do not filter by ad-block presence AdBlockOnly // ad-block traffic only AdBlockExclude // exclude ad-block traffic )
AdBlock filter values.
const ( PrivateBrowsingAny int8 = iota // do not filter by private-browsing mode PrivateBrowsingOnly // private-browsing traffic only PrivateBrowsingExclude // exclude private-browsing traffic )
PrivateBrowsing filter values.
const ( IPAny int8 = iota // do not filter by IP version IPv4Only // IPv4 traffic only IPv6Only // IPv6 traffic only )
IP version filter values.
const ( FormatFieldStringType FormatFieldType = "string" FormatFieldIntType = "int" FormatFieldFloatType = "float" FormatFieldBoolType = "bool" FormatFieldPhoneType = "phone" FormatFieldDefaultType = FormatFieldStringType )
Format Field types
const ( FormatFieldTitle = "title" FormatFieldDescription = "description" FormatFieldBrandname = "brandname" FormatFieldPhone = "phone" FormatFieldURL = "url" FormatFieldStartDisplay = "start" FormatFieldContent = "content" FormatFieldRating = "rating" FormatFieldLikes = "likes" FormatFieldAddress = "address" FormatFieldSponsored = "sponsored" )
Format field defaults
const ( FormatAssetBanner = "banner" FormatAssetMain = "main" FormatAssetIcon = "icon" FormatAssetLogo = "logo" )
Format asset defaults
const ( PlatformUndefined PlatformType = 0 PlatformWeb PlatformType = 1 PlatformDesktop PlatformType = 2 PlatformMobile PlatformType = 3 // Smart.Phone & Tablet PlatformSmartPhone PlatformType = 4 PlatformTablet PlatformType = 5 PlatformSmartTV PlatformType = 6 PlatformGameStation PlatformType = 7 PlatformSmartWatch PlatformType = 8 PlatformVR PlatformType = 9 PlatformSmartGlasses PlatformType = 10 PlatformSmartBillboard PlatformType = 11 PlatformUndefinedName = `undefined` PlatformWebName = `web` PlatformDesktopName = `desktop` PlatformMobileName = `mobile` PlatformSmartPhoneName = `smart.phone` PlatformTabletName = `tablet` PlatformSmartTVName = `smart.tv` PlatformGameStationName = `gamestation` PlatformSmartWatchName = `smart.watch` PlatformVRName = `vr` PlatformSmartGlassesName = `smart.glasses` PlatformSmartBillboardName = `smart.billboard` )
Platform type list
Variables ¶
var ActiveStatusNameList = []string{
`pause`,
`active`,
}
ActiveStatusNameList contains posible active status names
var ApplicationTypeNameList = []string{ ApplicationUndefinedName, ApplicationSiteName, ApplicationAppName, ApplicationGameName, }
ApplicationTypeNameList contains list of posible platform name
var ApproveStatusNameList = []string{ StatusPendingName, StatusApprovedName, StatusRejectedName, }
ApproveStatusNameList contains available names list
var (
ErrFormatFieldIsRequired = errors.New("field is required")
)
Errors list...
var ErrInvalidParseVersion = fmt.Errorf("invalid parse version")
var FormatMapping = map[string]FormatType{ `invalid`: FormatInvalidType, `undefined`: FormatUndefinedType, `direct`: FormatDirectType, `proxy`: FormatProxyType, `video`: FormatVideoType, `banner`: FormatBannerType, `html5`: FormatBannerHTML5Type, `native`: FormatNativeType, `custom`: FormatCustomType, }
FormatMapping from name to constant
var FormatTypeList = []FormatType{ FormatInvalidType, FormatUndefinedType, FormatDirectType, FormatProxyType, FormatVideoType, FormatBannerType, FormatBannerHTML5Type, FormatNativeType, FormatCustomType, }
FormatTypeList of types
var PlatformTypeNameList = []string{ PlatformUndefinedName, PlatformWebName, PlatformDesktopName, PlatformMobileName, PlatformSmartPhoneName, PlatformTabletName, PlatformSmartTVName, PlatformGameStationName, PlatformSmartWatchName, PlatformVRName, PlatformSmartGlassesName, PlatformSmartBillboardName, }
PlatformTypeNameList contains list of available platform names
Functions ¶
func CountryFilter ¶
func CountryFilter(arr gosql.NullableStringArray) (narr gosql.NullableOrderedNumberArray[uint64], executed bool)
CountryFilter resolves ISO 3166-1 alpha-2 country codes to geo IDs and returns a sorted ID array with include/exclude polarity (see StringArrayFilter). Codes with a leading '-' contribute to an exclude list; all others form an include list. An unrecognised code resolves to ID 0.
func IDArrayFilter ¶
func IDArrayFilter(arr gosql.NullableOrderedNumberArray[int64]) (narr gosql.NullableOrderedNumberArray[uint64], executed bool)
IDArrayFilter splits a signed int64 slice into an include or exclude list.
If any element is positive, those elements form an include list and executed=false is returned. If all elements are negative (or zero), their absolute values form an exclude list and executed=true is returned. An empty input returns (nil, false) — no constraint.
The returned bool mirrors the "executed" flag used by BaseFilter.SetPositive: false = include mode, true = exclude mode.
func IDArrayFilterAny ¶
IDArrayFilterAny is a type-dispatching wrapper around IDArrayFilter.
Accepted types and their include/exclude semantics:
- gosql.NullableOrderedNumberArray[int64] / []int64 / []int — delegated to IDArrayFilter: positive values = include (false), negative = exclude (true). []int is converted via IntArrayToInt64 first.
- gosql.NullableOrderedNumberArray[uint64] / []uint64 — raw unsigned IDs with no sign convention; always returns false (include mode). For a pre-processed exclude list, call BaseFilter.SetPositive manually after.
If the value does not match any case and panicMsg is non-empty, it panics.
func IntArrayToInt64 ¶
func IntArrayToInt64(arr []int) (res gosql.NullableOrderedNumberArray[int64])
IntArrayToInt64 converts a []int slice to a sorted gosql.NullableOrderedNumberArray[int64]. Negative values are preserved.
func IntArrayToUint64 ¶
func IntArrayToUint64(arr []int) (res gosql.NullableOrderedNumberArray[uint64])
IntArrayToUint64 converts a []int slice to a sorted gosql.NullableOrderedNumberArray[uint64]. Only non-negative values produce meaningful results; negative ints are cast directly (two's complement) and will produce incorrect large IDs.
func LanguageFilter ¶
func LanguageFilter(arr gosql.NullableStringArray) (narr gosql.NullableOrderedNumberArray[uint64], executed bool)
LanguageFilter resolves BCP-47 language codes to language IDs and returns a sorted ID array with include/exclude polarity (see StringArrayFilter). Codes with a leading '-' contribute to an exclude list; all others form an include list. An unrecognised code resolves to ID 0.
func StringArrayFilter ¶
func StringArrayFilter(arr gosql.NullableStringArray) (gosql.StringArray, bool)
StringArrayFilter splits a string array into an include or exclude list based on a leading '-' prefix convention.
Elements without a '-' prefix form an include list (executed=false). If no such elements exist, elements with a '-' prefix have the prefix stripped and form an exclude list (executed=true). An empty input returns (nil, false) — no constraint.
func TestTimeRequest ¶
func TestTimeRequest(h Hours, UTCOffset int, pointer TimeRequestPointer) bool
TestTimeRequest checks hours for the request pointer
Types ¶
type ActiveStatus ¶
type ActiveStatus uint
ActiveStatus of the object CREATE TYPE ActiveStatus AS ENUM ('active', 'pause')
const ( StatusPause ActiveStatus = 0 StatusActive ActiveStatus = 1 )
Status active
func ActiveNameToStatus ¶
func ActiveNameToStatus(name string) ActiveStatus
ActiveNameToStatus converts avtivity status name to status
func (ActiveStatus) MarshalJSON ¶
func (st ActiveStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler
func (*ActiveStatus) Scan ¶
func (st *ActiveStatus) Scan(value any) error
Scan implements the driver.Valuer interface, json field interface
func (*ActiveStatus) UnmarshalJSON ¶
func (st *ActiveStatus) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaller
func (*ActiveStatus) UnmarshalYAML ¶
func (st *ActiveStatus) UnmarshalYAML(unmarshal func(any) error) error
Implements the Unmarshaler interface of the yaml pkg.
type AdFileAssetType ¶
type AdFileAssetType uint
AdFileAssetType represents the type of the asset
const ( AdFileAssetUndefinedType AdFileAssetType = 0 AdFileAssetImageType AdFileAssetType = 1 AdFileAssetVideoType AdFileAssetType = 2 AdFileAssetHTML5Type AdFileAssetType = 3 AdFileAssetVASTTagType AdFileAssetType = 4 )
AdFileAssetType values
func AdFileAssetTypeByName ¶
func AdFileAssetTypeByName(name string) AdFileAssetType
AdFileAssetTypeByName returns adfile value type
func (AdFileAssetType) IsUndefined ¶
func (ft AdFileAssetType) IsUndefined() bool
IsUndefined file type
func (AdFileAssetType) MarshalJSON ¶
func (ft AdFileAssetType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler
func (*AdFileAssetType) Scan ¶
func (ft *AdFileAssetType) Scan(value any) error
Scan implements the driver.Valuer interface, json field interface
func (*AdFileAssetType) UnmarshalJSON ¶
func (ft *AdFileAssetType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaller
type ApplicationType ¶
type ApplicationType uint
ApplicationType type CREATE TYPE ApplicationType AS ENUM ('site', 'application', 'game')
func ApplicationTypeNameToType ¶
func ApplicationTypeNameToType(name string) ApplicationType
ApproveNameToStatus name to const
func (ApplicationType) DisplayName ¶
func (tp ApplicationType) DisplayName() string
DisplayName of the type
func (ApplicationType) MarshalJSON ¶
func (tp ApplicationType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler
func (*ApplicationType) Scan ¶
func (tp *ApplicationType) Scan(value any) error
Scan implements the driver.Valuer interface, json field interface
func (*ApplicationType) UnmarshalJSON ¶
func (tp *ApplicationType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaller
type ApproveStatus ¶
type ApproveStatus uint
ApproveStatus type CREATE TYPE ApproveStatus AS ENUM ('pending', 'approved', 'rejected')
func ApproveNameToStatus ¶
func ApproveNameToStatus(name string) ApproveStatus
ApproveNameToStatus name to const
func (ApproveStatus) DisplayName ¶
func (st ApproveStatus) DisplayName() string
DisplayName of the status
func (ApproveStatus) IsApproved ¶
func (st ApproveStatus) IsApproved() bool
IsApproved status of the object
func (ApproveStatus) MarshalJSON ¶
func (st ApproveStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler
func (*ApproveStatus) Scan ¶
func (st *ApproveStatus) Scan(value any) error
Scan implements the driver.Valuer interface, json field interface
func (*ApproveStatus) UnmarshalJSON ¶
func (st *ApproveStatus) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaller
func (*ApproveStatus) UnmarshalYAML ¶
func (st *ApproveStatus) UnmarshalYAML(unmarshal func(any) error) error
Implements the Unmarshaler interface of the yaml pkg.
type AuctionType ¶
type AuctionType uint8
AuctionType data CREATE TYPE AuctionType AS ENUM ('undefined', 'first_price', 'second_price')
const ( UndefinedAuctionType AuctionType = 0 AutoPriceAuctionType AuctionType = 0 FirstPriceAuctionType AuctionType = 1 SecondPriceAuctionType AuctionType = 2 )
Auction types
func AuctionTypeNameToType ¶
func AuctionTypeNameToType(name string) AuctionType
AuctionTypeNameToType name to const
func (AuctionType) DisplayName ¶
func (at AuctionType) DisplayName() string
DisplayName of the auction
func (AuctionType) IsFirtsPrice ¶
func (at AuctionType) IsFirtsPrice() bool
IsFirtsPrice auction type
func (AuctionType) IsSecondPrice ¶
func (at AuctionType) IsSecondPrice() bool
IsSecondPrice auction type
func (AuctionType) MarshalJSON ¶
func (at AuctionType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler
func (*AuctionType) Scan ¶
func (at *AuctionType) Scan(value any) error
Scan implements the driver.Valuer interface, json field interface
func (*AuctionType) UnmarshalJSON ¶
func (at *AuctionType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaller
func (*AuctionType) UnmarshalYAML ¶
func (at *AuctionType) UnmarshalYAML(unmarshal func(any) error) error
Implements the Unmarshaler interface of the yaml pkg.
type BaseFilter ¶
type BaseFilter struct {
Formats gosql.StringArray // format codenames for non-interstitial requests
InterstitialFormats gosql.StringArray // format codenames for interstitial requests (overrides Formats when set)
DeviceTypes gosql.NullableOrderedNumberArray[uint64]
Devices gosql.NullableOrderedNumberArray[uint64]
OS gosql.NullableOrderedNumberArray[uint64]
Browsers gosql.NullableOrderedNumberArray[uint64]
Categories gosql.NullableOrderedNumberArray[uint64]
Countries gosql.NullableOrderedNumberArray[uint64]
Languages gosql.NullableOrderedNumberArray[uint64]
TrafficSources gosql.NullableOrderedNumberArray[uint64]
Domains gosql.StringArray
Apps gosql.NullableOrderedNumberArray[uint64]
Zones gosql.NullableOrderedNumberArray[uint64]
Secure int8 // SecureAny | SecureOnly | SecureExclude
AdBlock int8 // AdBlockAny | AdBlockOnly | AdBlockExclude
PrivateBrowsing int8 // PrivateBrowsingAny | PrivateBrowsingOnly | PrivateBrowsingExclude
IP int8 // IPAny | IPv4Only | IPv6Only
// contains filtered or unexported fields
}
BaseFilter holds the targeting criteria that a TargetPointer must satisfy.
Array-type fields can act as either an include list (allow only matching values) or an exclude list (reject matching values). The polarity for each field is recorded in the internal excludeMask bitset:
- bit CLEAR → include list: request passes when the value IS found
- bit SET → exclude list: request passes when the value is NOT found
- empty list → no constraint (field is ignored)
For signed-integer source arrays (int64 convention): positive values build an include list, negative values build an exclude list (absolute values are stored; see IDArrayFilter). Use BaseFilter.SetPositive to set the polarity directly when building from uint64 or pre-processed data.
Format selection is context-aware:
- Non-interstitial requests are matched against Formats.
- Interstitial requests are matched against InterstitialFormats when it is non-empty; otherwise Formats is used as the fallback.
func (*BaseFilter) Reset ¶
func (fl *BaseFilter) Reset()
Reset clears all filter fields and resets excludeMask and tristate flags to their zero / Any defaults. Underlying array memory is reused where possible.
func (*BaseFilter) SetAppIDs ¶
func (fl *BaseFilter) SetAppIDs(arr []uint64)
SetAppIDs sets the app filter as an explicit include list of unsigned IDs.
func (*BaseFilter) SetApps ¶
func (fl *BaseFilter) SetApps(arr []int64)
SetApps sets the app filter from a signed integer slice. Positive values form an include list; negative values (absolute value stored) form an exclude list.
func (*BaseFilter) SetBrowsers ¶
func (fl *BaseFilter) SetBrowsers(data any)
SetBrowsers sets the browser filter from a signed ([]int64) or unsigned ([]uint64) slice. Negative int64 values denote exclusion.
func (*BaseFilter) SetCategories ¶
func (fl *BaseFilter) SetCategories(data any)
SetCategories sets the IAB content-category filter from a signed ([]int64) or unsigned ([]uint64) slice. Negative int64 values denote exclusion.
func (*BaseFilter) SetCountries ¶
func (fl *BaseFilter) SetCountries(data any)
SetCountries sets the country filter. Accepts numeric ID slices ([]int64, []uint64) or ISO 3166-1 alpha-2 code arrays (gosql.StringArray / gosql.NullableStringArray). Prefix a code with '-' to exclude that country.
func (*BaseFilter) SetDeviceTypes ¶
func (fl *BaseFilter) SetDeviceTypes(data any)
SetDeviceTypes sets the device-type filter from a signed ([]int64) or unsigned ([]uint64) slice. Negative int64 values denote exclusion.
func (*BaseFilter) SetDevices ¶
func (fl *BaseFilter) SetDevices(data any)
SetDevices sets the device-model filter from a signed ([]int64) or unsigned ([]uint64) slice. Negative int64 values denote exclusion.
func (*BaseFilter) SetDomains ¶
func (fl *BaseFilter) SetDomains(arr gosql.NullableStringArray)
SetDomains sets the domain / bundle-name filter. Values with a leading '-' are treated as an exclusion list; all others form an inclusion list.
func (*BaseFilter) SetFormats ¶
func (fl *BaseFilter) SetFormats(arr []string)
SetFormats sets the format codename allowlist used for non-interstitial requests. An empty slice removes the format constraint.
func (*BaseFilter) SetInterstitialFormats ¶
func (fl *BaseFilter) SetInterstitialFormats(arr []string)
SetInterstitialFormats sets the format codename allowlist used when the request is interstitial (IsInterstitial() == true). When non-empty it overrides Formats for such requests; an empty slice falls back to Formats.
func (*BaseFilter) SetLanguages ¶
func (fl *BaseFilter) SetLanguages(data any)
SetLanguages sets the language filter. Accepts numeric ID slices ([]int64, []uint64) or BCP-47 code arrays (gosql.StringArray / gosql.NullableStringArray). Prefix a code with '-' to exclude that language.
func (*BaseFilter) SetOS ¶
func (fl *BaseFilter) SetOS(data any)
SetOS sets the operating-system filter from a signed ([]int64) or unsigned ([]uint64) slice. Negative int64 values denote exclusion.
func (*BaseFilter) SetPositive ¶
func (fl *BaseFilter) SetPositive(field uint64, positive bool)
SetPositive records the include/exclude polarity for the given field in excludeMask. Despite the name, positive=true activates exclude mode (sets the corresponding bit); positive=false activates include mode (clears the bit). The parameter mirrors the "executed" return value of IDArrayFilter: true means the exclude path was taken.
func (*BaseFilter) SetTrafficSources ¶
func (fl *BaseFilter) SetTrafficSources(data any)
SetTrafficSources sets the traffic-source filter from a signed ([]int64) or unsigned ([]uint64) slice. Negative int64 values denote exclusion.
func (*BaseFilter) SetZoneIDs ¶
func (fl *BaseFilter) SetZoneIDs(arr []uint64)
SetZoneIDs sets the zone filter as an explicit include list of unsigned IDs.
func (*BaseFilter) SetZones ¶
func (fl *BaseFilter) SetZones(arr []int64)
SetZones sets the zone filter from a signed integer slice. Positive values form an include list; negative values (absolute value stored) form an exclude list.
func (*BaseFilter) Test ¶
func (fl *BaseFilter) Test(t TargetPointer) bool
Test evaluates whether the target satisfies every configured filter. Checks are applied in order: format → tristate flags (secure, adblock, private browsing, IP version) → source identifiers (traffic source, zone, app, domain) → device / OS / browser / geo / language. Any single failing check short-circuits and returns false immediately.
func (*BaseFilter) TestFormat ¶
func (fl *BaseFilter) TestFormat(f *Format) bool
TestFormat reports whether format f is permitted by the Formats allowlist. An empty Formats slice permits every format. Note: does not consider InterstitialFormats; call BaseFilter.Test for context-aware format matching that respects TargetPointer.IsInterstitial.
func (*BaseFilter) TestInterstitialFormat ¶
func (fl *BaseFilter) TestInterstitialFormat(f *Format) bool
TestInterstitialFormat reports whether format f is permitted by the InterstitialFormats allowlist. An empty InterstitialFormats slice permits every format. Note: does not consider Formats; call BaseFilter.Test for context-aware format matching that respects TargetPointer.IsInterstitial.
type BidFormater ¶
type BidFormater interface {
// List returns the list of formats
List() []*Format
// Bitset returns the bitset of format IDs
Bitset() *searchtypes.NumberBitset[uint]
// TypeMask returns the format type mask
TypeMask() FormatTypeBitset
}
BidFormater defines the interface for managing ad formats in a bid request.
type BrowserInfo ¶
type CarrierInfo ¶
type DeviceInfo ¶
type FilterField ¶
type FilterField = uint64
FilterField identifies a filter dimension in BaseFilter. Prefer the typed setter methods (SetFormats, SetDeviceTypes, etc.) over the legacy Set() dispatcher — they provide compile-time type safety.
const ( FieldFormat FilterField = iota // ad format codenames (Formats / InterstitialFormats) FieldDeviceTypes // device category (phone, tablet, desktop…) FieldDevices // specific device model IDs FieldOS // operating system IDs FieldBrowsers // browser IDs FieldCategories // IAB content category IDs FieldCountries // country IDs (or ISO 3166-1 alpha-2 codes) FieldLanguages // language IDs (or BCP-47 codes) FieldTrafficSources // traffic-source IDs FieldDomains // domain / bundle-name allowlist or blocklist FieldApps // app IDs FieldZones // zone IDs FieldInterstitialFormats // ad format codenames for interstitial requests )
Base filter fields.
type Format ¶
type Format struct {
ID uint64 `json:"id"`
Codename string `json:"codename"`
Types FormatTypeBitset `json:"type"`
Width int `json:"w"`
Height int `json:"h"`
MinWidth int `json:"mw,omitempty"`
MinHeight int `json:"mh,omitempty"`
Config *FormatConfig `json:"config,omitempty"`
// contains filtered or unexported fields
}
Format struct
func (*Format) CloneWithSize ¶
CloneWithSize of current format object with the new params
func (*Format) GetConfig ¶
func (f *Format) GetConfig() *FormatConfig
GetConfig of the format object
func (Format) SuitsCompare ¶
SuitsCompare formats for premetive test
func (Format) SuitsCompareSize ¶
SuitsCompareSize for premetive test
type FormatConfig ¶
type FormatConfig struct {
// Assets list of the files and configs
Assets []FormatFileRequirement `json:"assets,omitempty"`
// By default empty, so in requirements only the link from Ad object
Fields []FormatField `json:"fields,omitempty"`
}
FormatConfig description
func (*FormatConfig) AssetByName ¶
func (c *FormatConfig) AssetByName(name string) *FormatFileRequirement
AssetByName from config
func (*FormatConfig) ContainsAsset ¶
func (c *FormatConfig) ContainsAsset(asset *FormatFileRequirement, revers ...bool) bool
ContainsAsset in the list
func (*FormatConfig) GetField ¶
func (c *FormatConfig) GetField(name string) *FormatField
GetField by name
func (*FormatConfig) Intersec ¶
func (c *FormatConfig) Intersec(conf *FormatConfig) bool
Intersec with other format config
func (*FormatConfig) MainAsset ¶
func (c *FormatConfig) MainAsset() (as *FormatFileRequirement)
MainAsset returns the main asset if exists
func (*FormatConfig) RequiredField ¶
func (c *FormatConfig) RequiredField(fields ...string) *FormatField
RequiredField have in the config
func (*FormatConfig) RequiredFieldExcept ¶
func (c *FormatConfig) RequiredFieldExcept(fields ...string) *FormatField
RequiredFieldExcept have any required field Fileds in param must be optional
func (*FormatConfig) SimilarField ¶
func (c *FormatConfig) SimilarField(field *FormatField, revers ...bool) *FormatField
SimilarField in the list
func (*FormatConfig) SimpleAsset ¶
func (c *FormatConfig) SimpleAsset() (as *FormatFileRequirement)
SimpleAsset returns the main asset in case of one required asset
type FormatField ¶
type FormatField struct {
// ID of the field
ID int `json:"id,omitempty"`
// Is required field
Required bool `json:"required,omitempty"`
// Title of yje field for interface
Title string `json:"title,omitempty"`
// Name of the field (required)
Name string `json:"name" validation:"required"`
// Type of the field data
Type FormatFieldType `json:"type,omitempty"`
// Exclude those fields if this field is filled
Exclude []string `json:"exclude,omitempty"`
// Select is the choice of the available values
Select []any `json:"select,omitempty"`
// Minimum length for string or minimum value for int
Min float64 `json:"min,omitempty"`
// Maximum length for string or maximum value for int
Max float64 `json:"max,omitempty"`
// Mask pattern of data
Mask string `json:"mask,omitempty"`
// RegExp validation pattern
RegExp string `json:"regexp,omitempty"`
}
FormatField description
func (FormatField) Prepare ¶
func (f FormatField) Prepare(value any) (result any, err error)
Prepare and validate value
func (FormatField) SoftEqual ¶
func (f FormatField) SoftEqual(field *FormatField) bool
SoftEqual compare
type FormatFileRequirement ¶
type FormatFileRequirement struct {
// ID of the assert
ID int `json:"id,omitempty"`
// Is required file
Required bool `json:"required,omitempty"`
// Name of the asset asset (optional for the first asset) by default: main
Name string `json:"name,omitempty"`
// AdjustSize if size is bigger
AdjustSize bool `json:"adjust_size,omitempty"`
// Max or exact width of image or video in pixels
Width int `json:"width,omitempty"`
// Max or exact height of image or video in pixels
Height int `json:"height,omitempty"`
// Minimal allowed width of image or video in pixels
MinWidth int `json:"min_width,omitempty"`
// Minimal allowed height of image or video in pixels
MinHeight int `json:"min_height,omitempty"`
// Is animated type of file acceptable
Animated bool `json:"animated,omitempty"`
// Is sound acceptable
Sound bool `json:"sound,omitempty"`
// Thumbs settings for autogenerator
Thumbs []string `json:"thumbs,omitempty"`
// AllowedTypes of files (for paticular asset)
AllowedTypes []string `json:"allowed_types,omitempty"`
}
FormatFileRequirement rule
func (FormatFileRequirement) GetName ¶
func (f FormatFileRequirement) GetName() string
GetName of the asset
func (FormatFileRequirement) IsFixed ¶
func (f FormatFileRequirement) IsFixed() bool
IsFixed format size
func (FormatFileRequirement) IsHTML5Support ¶
func (f FormatFileRequirement) IsHTML5Support() bool
IsHTML5Support of the file
func (FormatFileRequirement) IsImageSupport ¶
func (f FormatFileRequirement) IsImageSupport() bool
IsImageSupport of the file
func (FormatFileRequirement) IsMimeTypeSupport ¶
func (f FormatFileRequirement) IsMimeTypeSupport(mimePrefix string) bool
IsMimeTypeSupport of the file
func (*FormatFileRequirement) IsRequired ¶
func (f *FormatFileRequirement) IsRequired() bool
IsRequired asset
func (FormatFileRequirement) IsSoundSupport ¶
func (f FormatFileRequirement) IsSoundSupport() bool
IsSoundSupport of the file
func (FormatFileRequirement) IsVideoSupport ¶
func (f FormatFileRequirement) IsVideoSupport() bool
IsVideoSupport of the file
func (*FormatFileRequirement) MinMaxHeight ¶
func (f *FormatFileRequirement) MinMaxHeight() (mn, mx int)
MinMaxHeight sizes
func (*FormatFileRequirement) MinMaxWidth ¶
func (f *FormatFileRequirement) MinMaxWidth() (mn, mx int)
MinMaxWidth sizes
func (FormatFileRequirement) SoftEqual ¶
func (f FormatFileRequirement) SoftEqual(asset *FormatFileRequirement) bool
SoftEqual compare
type FormatType ¶
type FormatType int
FormatType value CREATE TYPE FormatType AS ENUM ('invalid', 'undefined', 'direct', 'proxy', 'video', 'banner', 'html5', 'native', 'custom')
const ( FormatInvalidType FormatType = -1 FormatUndefinedType FormatType = 0 FormatDirectType FormatType = 1 FormatProxyType FormatType = 2 FormatVideoType FormatType = 3 // It's kinde of integrated into video player FormatBannerType FormatType = 4 FormatBannerHTML5Type FormatType = 5 FormatNativeType FormatType = 6 FormatCustomType FormatType = 31 )
Format types
func FormatTypeByName ¶
func FormatTypeByName(name string) FormatType
FormatTypeByName returns format type by name
func (FormatType) DisplayName ¶
func (t FormatType) DisplayName() string
DisplayName of the format type
func (FormatType) IsBannerHTML5 ¶
func (t FormatType) IsBannerHTML5() bool
IsBannerHTML5 format type
func (FormatType) MarshalJSON ¶
func (t FormatType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler
func (*FormatType) Scan ¶
func (t *FormatType) Scan(value any) error
Scan implements the driver.Valuer interface, json field interface
func (*FormatType) UnmarshalJSON ¶
func (t *FormatType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaller
type FormatTypeBitset ¶
type FormatTypeBitset uint
FormatTypeBitset of types
const ( // FormatTypeBitsetEmpty by default FormatTypeBitsetEmpty FormatTypeBitset = 0 // FormatTypeBitsetDirect for direct type FormatTypeBitsetDirect FormatTypeBitset = 1 << FormatTypeBitset(FormatDirectType) )
func NewFormatTypeBitset ¶
func NewFormatTypeBitset(types ...FormatType) *FormatTypeBitset
NewFormatTypeBitset from types
func (FormatTypeBitset) FirstType ¶
func (b FormatTypeBitset) FirstType() FormatType
FirstType from the bitset
func (FormatTypeBitset) HasOneType ¶
func (b FormatTypeBitset) HasOneType() FormatType
HasOneType in the mask
func (FormatTypeBitset) Intersec ¶
func (b FormatTypeBitset) Intersec(set FormatTypeBitset) FormatTypeBitset
Intersec between two bitsets
func (*FormatTypeBitset) IsIntersec ¶
func (b *FormatTypeBitset) IsIntersec(set FormatTypeBitset) bool
IsIntersec between two bitsets
func (*FormatTypeBitset) Reset ¶
func (b *FormatTypeBitset) Reset() *FormatTypeBitset
Reset type value
func (*FormatTypeBitset) Set ¶
func (b *FormatTypeBitset) Set(types ...FormatType) *FormatTypeBitset
Set format type values
func (*FormatTypeBitset) SetBitset ¶
func (b *FormatTypeBitset) SetBitset(bitset ...FormatTypeBitset) *FormatTypeBitset
SetBitset intersection
func (*FormatTypeBitset) SetFromFormats ¶
func (b *FormatTypeBitset) SetFromFormats(formats ...*Format) *FormatTypeBitset
SetFromFormats type values
func (*FormatTypeBitset) SetOne ¶
func (b *FormatTypeBitset) SetOne(t FormatType) *FormatTypeBitset
SetOne format type value
func (*FormatTypeBitset) SetOneBitset ¶
func (b *FormatTypeBitset) SetOneBitset(bitset FormatTypeBitset) *FormatTypeBitset
SetOneBitset set one bitset
func (FormatTypeBitset) Types ¶
func (b FormatTypeBitset) Types() (list []FormatType)
Types list from bites
func (*FormatTypeBitset) Unset ¶
func (b *FormatTypeBitset) Unset(types ...FormatType) *FormatTypeBitset
Unset type values
type FormatsAccessor ¶
type FormatsAccessor interface {
// Format list collection
Formats() []*Format
// FormatsBySize returns the list of acceptable formats
FormatsBySize(w, h, minWidth, minHeight int, ftypes ...FormatTypeBitset) []*Format
// FormatByID of the model
FormatByID(id uint64) *Format
// FormatByCode of the model
FormatByCode(code string) *Format
// DirectFormatSet to search
DirectFormatSet() *searchtypes.NumberBitset[uint]
}
FormatsAccessor object interface
type Hours ¶
type Hours = hourstable.Hours
Hours SQL type declaration
func HoursByString ¶
HoursByString returns hours object by string pattern
type ListFormat ¶
type ListFormat []*Format
ListFormat array
func (ListFormat) HasSuitsCompare ¶
func (l ListFormat) HasSuitsCompare(format *Format) bool
HasSuitsCompare in the list
type MultiTargetPointer ¶
type MultiTargetPointer interface {
TargetPointer
TargetIDs() []uint64
}
MultiTargetPointer extends standart target pointer untile multi zone targetting
type PlatformType ¶
type PlatformType uint
PlatformType type CREATE TYPE PlatformType AS ENUM ('web', 'desktop', 'mobile', 'smart.phone', 'tablet', 'smart.tv', 'gamestation', 'smart.watch', 'vr', 'smart.glasses', 'smart.billboard')
func PlatformTypeNameToType ¶
func PlatformTypeNameToType(name string) PlatformType
ApproveNameToStatus name to const
func (PlatformType) DisplayName ¶
func (tp PlatformType) DisplayName() string
DisplayName of the type
func (PlatformType) MarshalJSON ¶
func (tp PlatformType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler
func (*PlatformType) Scan ¶
func (tp *PlatformType) Scan(value any) error
Scan implements the driver.Valuer interface, json field interface
func (*PlatformType) UnmarshalJSON ¶
func (tp *PlatformType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaller
type PricingModel ¶
type PricingModel uint8
PricingModel value CREATE TYPE PricingModel AS ENUM ('undefined', 'CPM', 'CPC', 'CPA')
const ( PricingModelUndefined PricingModel = iota PricingModelCPM PricingModelCPC PricingModelCPA PricingModelCPV )
PricingModel consts
func PricingModelByName ¶
func PricingModelByName(model string) PricingModel
PricingModelByName string
func (PricingModel) MarshalJSON ¶
func (pm PricingModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler
func (PricingModel) Or ¶
func (pm PricingModel) Or(npm PricingModel) PricingModel
Or returns current value if not undefined or alternative value
func (*PricingModel) Scan ¶
func (pm *PricingModel) Scan(value any) error
Scan implements the driver.Valuer interface, json field interface
func (PricingModel) String ¶
func (pm PricingModel) String() string
func (*PricingModel) UnmarshalJSON ¶
func (pm *PricingModel) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaller
type PrivateStatus ¶
type PrivateStatus uint
PrivateStatus of the object CREATE TYPE PrivateStatus AS ENUM ('public', 'private')
const ( StatusPublic PrivateStatus = 0 StatusPrivate PrivateStatus = 1 )
Status private
func PrivateNameToStatus ¶
func PrivateNameToStatus(name string) PrivateStatus
PrivateNameToStatus converts private status name to status
func (PrivateStatus) IsPrivate ¶
func (st PrivateStatus) IsPrivate() bool
IsPrivate status of the object
func (PrivateStatus) MarshalJSON ¶
func (st PrivateStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler
func (*PrivateStatus) Scan ¶
func (st *PrivateStatus) Scan(value any) error
Scan implements the driver.Valuer interface, json field interface
func (*PrivateStatus) UnmarshalJSON ¶
func (st *PrivateStatus) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaller
func (*PrivateStatus) UnmarshalYAML ¶
func (st *PrivateStatus) UnmarshalYAML(unmarshal func(any) error) error
Implements the Unmarshaler interface of the yaml pkg.
type ProcessingStatus ¶
type ProcessingStatus int
ProcessingStatus of any item type
const ( ProcessingUndefined ProcessingStatus = 0 ProcessingProgress ProcessingStatus = 1 ProcessingProcessed ProcessingStatus = 2 ProcessingError ProcessingStatus = 3 ProcessingDeleted ProcessingStatus = 4 )
ProcessingStatus values
func ProcessingStatusByName ¶
func ProcessingStatusByName(name string) ProcessingStatus
func (ProcessingStatus) Code ¶
func (st ProcessingStatus) Code() string
Code returns value of status
func (ProcessingStatus) MarshalJSON ¶
func (st ProcessingStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler
func (ProcessingStatus) Name ¶
func (st ProcessingStatus) Name() string
Name returns the name of status
func (*ProcessingStatus) Scan ¶
func (st *ProcessingStatus) Scan(value any) error
Scan implements the driver.Valuer interface, json field interface
func (*ProcessingStatus) UnmarshalJSON ¶
func (st *ProcessingStatus) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaller
type RTBRequestType ¶
type RTBRequestType int
RTBRequestType contains type of representation of request information CREATE TYPE RTBRequestType AS ENUM ('undefined','json','xml','protobuff','postformencoded','plain')
const ( RTBRequestTypeUndefined RTBRequestType = 0 RTBRequestTypeJSON RTBRequestType = 1 RTBRequestTypeXML RTBRequestType = 2 RTBRequestTypeProtoBUFF RTBRequestType = 3 RTBRequestTypePOSTFormEncoded RTBRequestType = 4 // application/x-www-form-urlencoded RTBRequestTypePLAINTEXT RTBRequestType = 5 )
Request types
func (RTBRequestType) MarshalJSON ¶
func (rt RTBRequestType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler
func (*RTBRequestType) Scan ¶
func (rt *RTBRequestType) Scan(value any) error
Scan implements the driver.Valuer interface, json field interface
func (*RTBRequestType) UnmarshalJSON ¶
func (rt *RTBRequestType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaller
type SimpleFormatAccessor ¶
type SimpleFormatAccessor struct {
// contains filtered or unexported fields
}
SimpleFormatAccessor implements basic inmemory storage of formats
func NewSimpleFormatAccessor ¶
func NewSimpleFormatAccessor(formats []*Format) *SimpleFormatAccessor
NewSimpleFormatAccessor object
func NewSimpleFormatAccessorWithLoader ¶
func NewSimpleFormatAccessorWithLoader(formatLoader formatLoaderFnk) *SimpleFormatAccessor
NewSimpleFormatAccessorWithLoader object
func (*SimpleFormatAccessor) DirectFormatSet ¶
func (fa *SimpleFormatAccessor) DirectFormatSet() *searchtypes.NumberBitset[uint]
DirectFormatSet to search
func (*SimpleFormatAccessor) FormatByCode ¶
func (fa *SimpleFormatAccessor) FormatByCode(code string) *Format
FormatByCode of the model
func (*SimpleFormatAccessor) FormatByID ¶
func (fa *SimpleFormatAccessor) FormatByID(id uint64) *Format
FormatByID of the model
func (*SimpleFormatAccessor) Formats ¶
func (fa *SimpleFormatAccessor) Formats() []*Format
Formats list collection
func (*SimpleFormatAccessor) FormatsBySize ¶
func (fa *SimpleFormatAccessor) FormatsBySize(w, h, minWidth, minHeight int, fmtTypes ...FormatTypeBitset) []*Format
FormatsBySize returns the list of acceptable formats
func (*SimpleFormatAccessor) Prepare ¶
func (fa *SimpleFormatAccessor) Prepare()
Prepare format list
type TargetPointer ¶
type TargetPointer interface {
// BidFormater of the request
Formats() BidFormater
// Size of the area of visibility
Size() (width, height int)
// Request state and flags
IsDebug() bool // True if debug mode is enabled
IsSecure() bool // True if request is HTTPS
IsAdBlock() bool // True if adblock detected
IsPrivateBrowsing() bool // True if in incognito
IsRobot() bool // True if bot detected
IsProxy() bool // True if proxy detected
IsIPv6() bool // True if IP is IPv6
IsInterstitial() bool // True if ad slot is interstitial (full-screen takeover)
// Device and environment
DeviceInfo() *DeviceInfo // Full device info
BrowserInfo() *BrowserInfo // Browser info
OSInfo() *OSInfo // OS info
// App, site, geo
TrafficSourceID() uint64 // Traffic source ID
AppID() uint64 // Target app ID
AppInfo() *AppInfo // App info
SiteInfo() *SiteInfo // Site info or default
Domain() []string // Domain list
DomainName() string // Main domain or bundle name
GeoID() uint64 // Geo ID
GeoInfo() *GeoInfo // Geo info
CarrierInfo() *CarrierInfo // Carrier info
LanguageID() uint64 // Browser language
// TargetID of the specific point
TargetID() uint64
Sex() uint // Sex of the user
Age() uint // Age in years
// Tags list
Tags() []string
// Categories of the current request
Categories() []uint64
// MinECPM value
MinECPM() billing.Money
// Time of the request start
Time() time.Time
CurrentGeoTime() time.Time
}
TargetPointer describer of base target params
type TimeRequestPointer ¶
TimeRequestPointer is interface for request pointer with time
type Version ¶
Version model description of standard version type like: 1.2.3
func IgnoreParseVersion ¶
func MustParseVersion ¶
func ParseVersion ¶
func (*Version) MarshalJSON ¶
func (*Version) SetFromStr ¶
func (*Version) UnmarshalJSON ¶
type ZoneType ¶
type ZoneType uint
PrivateStatus of the object CREATE TYPE ZoneType AS ENUM ('zone', 'smartlink')
func ZoneNameToType ¶
ZoneNameToType converts zone type name to const
func (ZoneType) MarshalJSON ¶
MarshalJSON implements the json.Marshaler
func (*ZoneType) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller
func (*ZoneType) UnmarshalYAML ¶
Implements the Unmarshaler interface of the yaml pkg.
Source Files
¶
- active_status.go
- ad_file_asset_type.go
- application_type.go
- approve_status.go
- auction_type.go
- base_filter.go
- filters.go
- format.go
- format_accessor.go
- format_accessor_simple.go
- format_meta.go
- format_meta_field.go
- format_meta_file.go
- format_mock.go
- format_type.go
- format_type_bitset.go
- hours.go
- list_format.go
- platform_type.go
- pricing_model.go
- private_status.go
- processing_status.go
- rtb_request_type.go
- target_pointer.go
- version.go
- zone_type.go