Documentation
¶
Index ¶
- Variables
- type Carrier
- type Client
- type Device
- type Geo
- type Person
- type PredictPriceRequest
- type PredictPriceResponse
- type PredictRequest
- type PredictResponse
- type Properties
- type Request
- type Response
- type Signature
- type User
- type UserInfo
- func (i *UserInfo) Ages() (from, to int)
- func (i *UserInfo) CarrierInfo() *Carrier
- func (i *UserInfo) Country() *Geo
- func (i *UserInfo) DeviceInfo() *Device
- func (i *UserInfo) ETag() string
- func (i *UserInfo) Fingerprint() string
- func (i *UserInfo) GeoInfo() *Geo
- func (i *UserInfo) Keywords() string
- func (i *UserInfo) MostPossibleSex() int
- func (i *UserInfo) SessionID() string
- func (i *UserInfo) UUID() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GeoDefault = udetect.GeoDefault DeviceDefault = udetect.DeviceDefault )
View Source
var EmptyPerson = &person{ userInfo: UserInfo{ User: &udetect.User{}, Device: &udetect.DeviceDefault, Geo: &udetect.GeoDefault, }, }
Functions ¶
This section is empty.
Types ¶
type Person ¶
type Person interface {
// User info data
UserInfo() *UserInfo
// IsInited person in database
IsInited() bool
// Properties for domain
Properties(name string) Properties
// Predict what does he likes?
Predict(req *PredictRequest) (*PredictResponse, error)
// PredictPrice what minimal
PredictPrice(req *PredictPriceRequest) (*PredictPriceResponse, error)
}
Person information block
type Properties ¶
type Properties interface {
// Get property by key
Get(key string) any
// GetString property by key
GetString(key string) string
// GetIntSlice property by key
GetIntSlice(key string) []int
// Set property
Set(key string, prop any)
// Delete property by key
Delete(key string)
// Synchronise properties
Synchronise() error
}
Properties accessor
type Signature ¶
type Signature struct {
UUIDName string
SessidName string
SessidLifetime time.Duration
Detector Client
}
Signature provides the builder of cookie assigned to the user by HTTP
func (*Signature) SignCookie ¶
func (sign *Signature) SignCookie(resp Person, req *fasthttp.RequestCtx)
SignCookie do sign request by traking response
Click to show internal directories.
Click to hide internal directories.