personification

package
v0.0.0-...-3e353e7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

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 Carrier

type Carrier = udetect.Carrier

type Client

type Client interface {
	Detect(ctx context.Context, req *Request) (*Response, error)
}

Client interface

type Device

type Device = udetect.Device

type Geo

type Geo = udetect.Geo

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 PredictPriceRequest

type PredictPriceRequest struct{}

PredictPriceRequest ...

type PredictPriceResponse

type PredictPriceResponse struct{}

PredictPriceResponse ...

type PredictRequest

type PredictRequest struct{}

PredictRequest ...

type PredictResponse

type PredictResponse struct{}

PredictResponse ...

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 Request

type Request = udetect.Request

type Response

type Response = udetect.Response

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

func (*Signature) Whois

func (sign *Signature) Whois(ctx context.Context, req *fasthttp.RequestCtx) (Person, error)

Whois user information

type User

type User = udetect.User

type UserInfo

type UserInfo struct {
	User   *User
	Device *Device
	Geo    *Geo
}

UserInfo value

func (*UserInfo) Ages

func (i *UserInfo) Ages() (from, to int)

Ages of the user

func (*UserInfo) CarrierInfo

func (i *UserInfo) CarrierInfo() *Carrier

GeoInfo get method

func (*UserInfo) Country

func (i *UserInfo) Country() *Geo

Country info

func (*UserInfo) DeviceInfo

func (i *UserInfo) DeviceInfo() *Device

DeviceInfo get method

func (*UserInfo) ETag

func (i *UserInfo) ETag() string

ETag of the user

func (*UserInfo) Fingerprint

func (i *UserInfo) Fingerprint() string

Fingerprint of the iser

func (*UserInfo) GeoInfo

func (i *UserInfo) GeoInfo() *Geo

GeoInfo get method

func (*UserInfo) Keywords

func (i *UserInfo) Keywords() string

Keywords of the user

func (*UserInfo) MostPossibleSex

func (i *UserInfo) MostPossibleSex() int

MostPossibleSex of the user

func (*UserInfo) SessionID

func (i *UserInfo) SessionID() string

SessionID of the user

func (*UserInfo) UUID

func (i *UserInfo) UUID() string

UUID of the user

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL