Documentation
¶
Index ¶
- Variables
- func WithSignature(ctx context.Context, signature *Signature) context.Context
- type Carrier
- type Client
- type Device
- type Geo
- type Person
- type PersonType
- func (p *PersonType) IsInited() bool
- func (p *PersonType) Predict(req *PredictRequest) (*PredictResponse, error)
- func (p *PersonType) PredictPrice(req *PredictPriceRequest) (*PredictPriceResponse, error)
- func (p *PersonType) Properties(name string) Properties
- func (p *PersonType) UserInfo() *UserInfo
- 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 (
ContextKeySignature = struct{ s string }{/* contains filtered or unexported fields */}
)
View Source
var EmptyPerson = &PersonType{ UserInfoValue: UserInfo{ User: &udetect.User{}, Device: &udetect.DeviceDefault, Geo: &udetect.GeoDefault, }, }
Functions ¶
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 PersonType ¶
PersonType is a personification type
func (*PersonType) Predict ¶
func (p *PersonType) Predict(req *PredictRequest) (*PredictResponse, error)
Predict what does he likes?
func (*PersonType) PredictPrice ¶
func (p *PersonType) PredictPrice(req *PredictPriceRequest) (*PredictPriceResponse, error)
PredictPrice what minimal
func (*PersonType) Properties ¶
func (p *PersonType) Properties(name string) Properties
Properties for domain
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 SignatureFromContext ¶
func (*Signature) SignCookie ¶
func (sign *Signature) SignCookie(resp Person, req *fasthttp.RequestCtx)
SignCookie do sign request by traking response
Source Files
¶
Click to show internal directories.
Click to hide internal directories.