traffic

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependencies added in v1.19.0

type Dependencies struct {
	Store      repository.Store
	Redis      *redis.Client
	Queue      *asynqx.Client
	Log        func() config.Log
	Aggregator trafficagg.Deps
}

type FlushTrafficLogic added in v1.3.15

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

func NewFlushTrafficLogic added in v1.3.15

func NewFlushTrafficLogic(deps Dependencies) *FlushTrafficLogic

func (*FlushTrafficLogic) ProcessTask added in v1.3.15

func (l *FlushTrafficLogic) ProcessTask(ctx context.Context, _ *asynq.Task) error

type LogCleanupLogic added in v1.19.0

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

LogCleanupLogic owns retention independently from traffic aggregation so a failed statistics run cannot silently disable log cleanup (or vice versa).

func NewLogCleanupLogic added in v1.19.0

func NewLogCleanupLogic(store cleanupStore, logConfig func() config.Log) *LogCleanupLogic

func (*LogCleanupLogic) ProcessTask added in v1.19.0

func (l *LogCleanupLogic) ProcessTask(ctx context.Context, _ *asynq.Task) error

type ResetTrafficLogic added in v1.0.3

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

ResetTrafficLogic handles traffic reset logic for different subscription cycles Supports three reset modes: - reset_cycle = 1: Reset on 1st of every month - reset_cycle = 2: Reset monthly based on subscription start date - reset_cycle = 3: Reset yearly based on subscription start date

func NewResetTrafficLogic added in v1.0.3

func NewResetTrafficLogic(deps Dependencies) *ResetTrafficLogic

func (*ResetTrafficLogic) ProcessTask added in v1.0.3

func (l *ResetTrafficLogic) ProcessTask(ctx context.Context, _ *asynq.Task) error

ProcessTask executes the traffic reset task for all subscription types with enhanced retry mechanism

type ServerDataLogic

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

func NewServerDataLogic

func NewServerDataLogic(deps Dependencies) *ServerDataLogic

func (*ServerDataLogic) ProcessTask

func (l *ServerDataLogic) ProcessTask(ctx context.Context, _ *asynq.Task) error

type StatLogic added in v1.1.0

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

func NewStatLogic added in v1.1.0

func NewStatLogic(deps Dependencies) *StatLogic

func (*StatLogic) ProcessTask added in v1.1.0

func (l *StatLogic) ProcessTask(ctx context.Context, _ *asynq.Task) error

type TrafficStatisticsLogic

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

func NewTrafficStatisticsLogic

func NewTrafficStatisticsLogic(deps Dependencies) *TrafficStatisticsLogic

func (*TrafficStatisticsLogic) ProcessTask

func (l *TrafficStatisticsLogic) ProcessTask(ctx context.Context, task *asynq.Task) error

Jump to

Keyboard shortcuts

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