trafficlimit

package
v1.6.5-rc46 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAndStartScheduler

func AddAndStartScheduler(ctx context.Context, v *models.TrafficLimit) error

func AddScheduler

func AddScheduler(ctx context.Context, v *models.TrafficLimit, start ...bool) error

func Create

func Create(ctx context.Context, r *CreateReq) (*models.TrafficLimit, error)

func GetBySFID

func GetBySFID(ctx context.Context, id types.SFID) (*models.TrafficLimit, error)

func Init

func Init(ctx context.Context) error

func ListByCond

func ListByCond(ctx context.Context, r *CondArgs) (data []models.TrafficLimit, err error)

func Remove

func Remove(ctx context.Context, r *CondArgs) error

func RemoveBySFID

func RemoveBySFID(ctx context.Context, id types.SFID) error

func RmvScheduler

func RmvScheduler(ctx context.Context, id types.SFID)

func TrafficLimit

func TrafficLimit(ctx context.Context, prj types.SFID, tpe enums.TrafficLimitType) error

func Update

func Update(ctx context.Context, id types.SFID, r *UpdateReq) (*models.TrafficLimit, error)

Types

type CondArgs

type CondArgs struct {
	ProjectID types.SFID             `name:"-"`
	ApiType   enums.TrafficLimitType `in:"query" name:"apiType,omitempty"`
}

func (*CondArgs) Condition

func (r *CondArgs) Condition() builder.SqlCondition

type CreateReq

type CreateReq struct {
	Threshold int                    `json:"threshold"`
	Duration  types.Duration         `json:"duration"`
	ApiType   enums.TrafficLimitType `json:"apiType"`
}

type Detail

type Detail struct {
	ProjectName string `json:"projectName" db:"f_project_name"`
	models.TrafficLimit
	datatypes.OperationTimes
}

type ListDetailRsp

type ListDetailRsp struct {
	Total int64     `json:"total"`
	Data  []*Detail `json:"data"`
}

func ListDetail

func ListDetail(ctx context.Context, r *ListReq) (*ListDetailRsp, error)

type ListReq

type ListReq struct {
	CondArgs
	datatypes.Pager
}

func (*ListReq) Additions

func (r *ListReq) Additions() builder.Additions

type ListRsp

type ListRsp struct {
	Data  []models.TrafficLimit `json:"data"`
	Total int64                 `json:"total"`
}

func List

func List(ctx context.Context, r *ListReq) (*ListRsp, error)

type Scheduler

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

func NewScheduler

func NewScheduler(ctx context.Context, v *models.TrafficLimit, start ...bool) (*Scheduler, error)

func (*Scheduler) Start

func (s *Scheduler) Start()

func (*Scheduler) Stop

func (s *Scheduler) Stop()

type UpdateReq

type UpdateReq struct {
	Threshold int            `json:"threshold"`
	Duration  types.Duration `json:"duration"`
}

Jump to

Keyboard shortcuts

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