data

package
v0.0.0-...-bfc0b13 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	SessionID string
}

func NewBroker

func NewBroker(sessionID string) *Broker

func (*Broker) OnActive

func (b *Broker) OnActive(ctx context.Context, callback func(timestamp time.Time))

func (*Broker) OnConnected

func (b *Broker) OnConnected(callback func(initPop *BrokerInitPop))

func (*Broker) OnUpdated

func (b *Broker) OnUpdated(ctx context.Context, callback func(nextPop *BrokerNextPop))

type BrokerInitPop

type BrokerInitPop struct {
	GlobalSum int64            `json:"global_sum"`
	RegionMap map[string]int64 `json:"region_map"`
}

type BrokerNextPop

type BrokerNextPop struct {
	RegionCode  string `json:"region_code"`
	CountAppend int64  `json:"count_append"`
}

type RegionPop

type RegionPop struct {
	RegionCode string `json:"region_code" gorm:"primaryKey"`
	Count      int64  `json:"count" gorm:"not null"`
}

type Uploader

type Uploader struct {
	// contains filtered or unexported fields
}

func NewUploader

func NewUploader() *Uploader

func (*Uploader) Consume

func (u *Uploader) Consume(delivery rmq.Delivery)

func (*Uploader) Wave

func (u *Uploader) Wave()

type VisitorIP

type VisitorIP net.IP

func ParseVisitorIP

func ParseVisitorIP(ip string) VisitorIP

func (VisitorIP) GormDataType

func (v VisitorIP) GormDataType() string

func (VisitorIP) NetIP

func (v VisitorIP) NetIP() net.IP

func (VisitorIP) RegionCode

func (v VisitorIP) RegionCode() (string, error)

func (*VisitorIP) Scan

func (v *VisitorIP) Scan(value interface{}) error

func (VisitorIP) String

func (v VisitorIP) String() string

func (VisitorIP) Value

func (v VisitorIP) Value() (driver.Value, error)

type VisitorPop

type VisitorPop struct {
	IPAddress  VisitorIP `json:"ip_address" gorm:"primaryKey"`
	RegionCode string    `json:"region_code" gorm:"primaryKey"`
	Count      int64     `json:"count" gorm:"not null"`
}

func (*VisitorPop) FromString

func (v *VisitorPop) FromString(dataString string) error

func (*VisitorPop) Publish

func (v *VisitorPop) Publish(ctx context.Context) error

Jump to

Keyboard shortcuts

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