types

package
v1.15.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	EmailTypeVerify        = "verify"
	EmailTypeMaintenance   = "maintenance"
	EmailTypeExpiration    = "expiration"
	EmailTypeTrafficExceed = "traffic_exceed"
	EmailTypeCustom        = "custom"
)
View Source
const (
	DeferCloseOrder                 = "defer:order:close"
	ForthwithActivateOrder          = "forthwith:order:activate"
	SchedulerReconcilePaidOrders    = "scheduler:order:reconcile-paid"
	SchedulerReconcilePendingOrders = "scheduler:order:reconcile-pending"
	SchedulerPublishOrderEvents     = "scheduler:order:publish-events"
	SchedulerCleanupOrderEvents     = "scheduler:order:cleanup-events"
)
View Source
const (
	SchedulerCheckSubscription = "scheduler:check:subscription"
	// SchedulerDispatchDomainEvents pumps the generic domain-event outbox
	// onto the asynq queue as events:deliver tasks.
	SchedulerDispatchDomainEvents = "scheduler:events:dispatch"
	SchedulerTotalServerData      = "scheduler:total:server"
	SchedulerResetTraffic         = "scheduler:reset:traffic"
	SchedulerTrafficStat          = "scheduler:traffic:stat"
	SchedulerFlushTraffic         = "scheduler:flush:traffic"
)
View Source
const (
	// ScheduledBatchSendEmail scheduled batch send email
	ScheduledBatchSendEmail = "scheduled:email:batch"

	// ForthwithQuotaTask create quota task immediately
	ForthwithQuotaTask = "forthwith:quota:task"

	// SchedulerExchangeRate fetch exchange rate task
	SchedulerExchangeRate = "scheduler:exchange:rate"
)
View Source
const (
	// EventDeliver carries one domain event from the outbox to its topic
	// subscribers; asynq is the broker (retry, backoff, dead-letter archive).
	EventDeliver = "events:deliver"
)
View Source
const (
	// ForthwithSendEmail forthwith send email
	ForthwithSendEmail = "forthwith:email:send"
)
View Source
const (
	// ForthwithSendSms forthwith send email
	ForthwithSendSms = "forthwith:sms:send"
)
View Source
const ForthwithTrafficStatistics = "forthwith:traffic:statistics"

Variables

This section is empty.

Functions

func ActivationTaskID added in v1.14.0

func ActivationTaskID(orderNo string) string

func EventTaskID added in v1.15.2

func EventTaskID(id int64) string

EventTaskID deduplicates enqueues of the same outbox event: the publish pump may replay an enqueue when marking the event published fails, and the task-id conflict turns that replay into a no-op.

Types

type DeferCloseOrderPayload

type DeferCloseOrderPayload struct {
	OrderNo string `json:"order_no"`
}

type EventDeliverPayload added in v1.15.2

type EventDeliverPayload struct {
	ID      int64  `json:"id"`
	Topic   string `json:"topic"`
	Key     string `json:"key"`
	Payload string `json:"payload"`
}

EventDeliverPayload is the broker representation of one outbox event.

type ForthwithActivateOrderPayload

type ForthwithActivateOrderPayload struct {
	OrderNo string `json:"order_no"`
}

type NodeStatus

type NodeStatus struct {
	OnlineUsers []OnlineUser `json:"online_users"`
	Status      ServerStatus `json:"status"`
	LastAt      int64        `json:"last_at"`
}

type OnlineUser

type OnlineUser struct {
	UID int64  `json:"uid"`
	IP  string `json:"ip"`
}

type SendEmailPayload

type SendEmailPayload struct {
	Type    string                 `json:"type"`
	Email   string                 `json:"to"`
	Subject string                 `json:"subject"`
	Content map[string]interface{} `json:"content"`
}

type SendSmsPayload

type SendSmsPayload struct {
	Type          uint8  `json:"type"`
	Telephone     string `json:"telephone"`
	TelephoneArea string `json:"area"`
	Content       string `json:"content"`
}

type ServerStatus

type ServerStatus struct {
	Cpu       float64 `json:"cpu"`
	Mem       float64 `json:"mem"`
	Disk      float64 `json:"disk"`
	UpdatedAt int64   `json:"updated_at"`
}

type ServerTrafficCount

type ServerTrafficCount struct {
	ServerId  int64  `json:"server_id"`
	Name      string `json:"name"`
	Today     int64  `json:"today"`
	Yesterday int64  `json:"yesterday"`
}

type TrafficStatistics

type TrafficStatistics struct {
	ServerId int64         `json:"server_id"`
	Protocol string        `json:"protocol"`
	Logs     []UserTraffic `json:"logs"`
}

type UserTraffic

type UserTraffic struct {
	SID      int64 `json:"uid"`
	Upload   int64 `json:"upload"`
	Download int64 `json:"download"`
}

Jump to

Keyboard shortcuts

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