strategy

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchCreate added in v1.1.0

func BatchCreate(ctx context.Context, sty []models.Strategy) error

func Create added in v1.1.0

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

func FilterByProjectAndEvent added in v1.1.0

func FilterByProjectAndEvent(ctx context.Context, id types.SFID, tpe string) ([]*types.StrategyResult, error)

func GetBySFID added in v1.1.0

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

func ListByCond added in v1.1.0

func ListByCond(ctx context.Context, r *CondArgs, adds ...builder.Addition) ([]models.Strategy, error)

func Remove added in v1.1.0

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

func RemoveBySFID added in v1.1.0

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

func Update added in v1.1.0

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

Types

type BatchCreateReq added in v1.1.0

type BatchCreateReq struct {
	Strategies []CreateReq `json:"strategies"`
}

type CondArgs added in v1.1.0

type CondArgs struct {
	ProjectID   types.SFID   `name:"-"`
	AppletIDs   []types.SFID `in:"query" name:"appletID,omitempty"`
	StrategyIDs []types.SFID `in:"query" name:"strategyID,omitempty"`
	EventTypes  []string     `in:"query" name:"eventType,omitempty"`
	Handlers    []string     `in:"query" name:"handler,omitempty"`
}

func (*CondArgs) Condition added in v1.1.0

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

type CreateReq added in v1.1.0

type CreateReq struct {
	models.RelApplet
	models.StrategyInfo
}

type Detail

type Detail struct {
	types.StrategyResult
	datatypes.OperationTimes
}

func ListDetailByCond added in v1.1.0

func ListDetailByCond(ctx context.Context, r *CondArgs, adds ...builder.Addition) (data []*Detail, err error)

type ListDetailRsp added in v1.1.0

type ListDetailRsp struct {
	Data  []*Detail `json:"data"`  // Data strategy data list
	Total int64     `json:"total"` // Total strategy count under current projectID
}

func ListDetail added in v1.1.0

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

type ListReq added in v1.1.0

type ListReq struct {
	CondArgs
	datatypes.Pager
}

func (*ListReq) Additions added in v1.1.0

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

type ListRsp added in v1.1.0

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

func List added in v1.1.0

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

type UpdateReq added in v1.1.0

type UpdateReq = CreateReq

Jump to

Keyboard shortcuts

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