Documentation ¶
Index ¶
- func Create(ctx context.Context, r *CreateReq) (*models.TrafficLimit, error)
- func CreateScheduler(ctx context.Context, projectKey string, trafficInfo *models.TrafficLimitInfo) error
- func DeleteScheduler(projectKey string) error
- func GetByProjectAndType(ctx context.Context, id types.SFID, apiType enums.TrafficLimitType) (*models.TrafficLimit, error)
- func GetByProjectAndTypeMustDB(ctx context.Context, id types.SFID, apiType enums.TrafficLimitType) (*models.TrafficLimit, error)
- func GetBySFID(ctx context.Context, id types.SFID) (*models.TrafficLimit, error)
- func GetStartAt(projectKey string, duration types.Duration) (startAt time.Time)
- func Init(ctx context.Context) error
- func ListByCond(ctx context.Context, r *CondArgs) (data []models.TrafficLimit, err error)
- func Remove(ctx context.Context, r *CondArgs) error
- func RemoveBySFID(ctx context.Context, id types.SFID) error
- func RestartScheduler(ctx context.Context, projectKey string, trafficInfo *models.TrafficLimitInfo) error
- func TrafficLimit(ctx context.Context, apiType enums.TrafficLimitType) error
- func Update(ctx context.Context, r *UpdateReq) (*models.TrafficLimit, error)
- func UpdateScheduler(ctx context.Context, projectKey string, trafficInfo *models.TrafficLimitInfo) error
- type CondArgs
- type CreateReq
- type Detail
- type ListDetailRsp
- type ListReq
- type ListRsp
- type TrafficScheduler
- type UpdateReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateScheduler ¶
func DeleteScheduler ¶
func GetByProjectAndType ¶
func GetByProjectAndType(ctx context.Context, id types.SFID, apiType enums.TrafficLimitType) (*models.TrafficLimit, error)
func GetByProjectAndTypeMustDB ¶
func GetByProjectAndTypeMustDB(ctx context.Context, id types.SFID, apiType enums.TrafficLimitType) (*models.TrafficLimit, error)
func GetStartAt ¶ added in v1.3.1
func ListByCond ¶
func RestartScheduler ¶
func TrafficLimit ¶
func TrafficLimit(ctx context.Context, apiType enums.TrafficLimitType) error
func UpdateScheduler ¶
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 ¶
func ListDetail ¶
func ListDetail(ctx context.Context, r *ListReq) (*ListDetailRsp, error)
type ListRsp ¶
type ListRsp struct { Data []models.TrafficLimit `json:"data"` Total int64 `json:"total"` }
type TrafficScheduler ¶
type TrafficScheduler struct {
// contains filtered or unexported fields
}
func (*TrafficScheduler) Do ¶
func (ts *TrafficScheduler) Do() error
func (*TrafficScheduler) Start ¶
func (ts *TrafficScheduler) Start()
func (*TrafficScheduler) StartNow ¶
func (ts *TrafficScheduler) StartNow()
func (*TrafficScheduler) Stop ¶
func (ts *TrafficScheduler) Stop()
Click to show internal directories.
Click to hide internal directories.