strategy

package
v1.0.1-rc4 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateStrategy

func CreateStrategy(ctx context.Context, projectID types.SFID, r *CreateStrategyBatchReq) (err error)

func GetBySFID added in v1.1.0

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

func GetStrategyByStrategyID

func GetStrategyByStrategyID(ctx context.Context, strategyID types.SFID) (*models.Strategy, error)

func Remove added in v1.1.0

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

func Update added in v1.1.0

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

Types

type CondArgs added in v1.1.0

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

func (*CondArgs) Condition added in v1.1.0

func (arg *CondArgs) Condition(prj types.SFID) builder.SqlCondition

type CreateData

type CreateData struct {
	models.RelApplet
	models.StrategyInfo
}

type CreateReq added in v1.1.0

type CreateReq struct {
	Data []CreateData `json:"data"`
}

type CreateRsp

type CreateRsp struct {
	Data []*models.Strategy `json:"data"`
}

func Create added in v1.1.0

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

type CreateStrategyBatchReq

type CreateStrategyBatchReq struct {
	Strategies []CreateStrategyReq `json:"strategies"`
}

type CreateStrategyReq

type CreateStrategyReq struct {
	models.RelApplet
	models.StrategyInfo
}

type Detail

type Detail struct {
	ProjectID  types.SFID   `json:"projectID"`
	Strategies []InfoDetail `json:"strategies,omitempty"`
	datatypes.OperationTimes
}

type InfoDetail

type InfoDetail struct {
	StrategyID types.SFID `json:"strategyID"`
	AppletID   types.SFID `json:"appletID"`
	AppletName string     `json:"appletName"`
	EventType  string     `json:"eventType"`
	Handler    string     `json:"handler"`
}

type InstanceHandler

type InstanceHandler struct {
	AppletID   types.SFID
	InstanceID types.SFID
	Handler    string
}

func FindStrategyInstances

func FindStrategyInstances(ctx context.Context, prjName string, eventType string) ([]*InstanceHandler, error)

type ListReq added in v1.1.0

type ListReq struct {
	CondArgs
	datatypes.Pager
}

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) (ret *ListRsp, err error)

type ListStrategyReq

type ListStrategyReq struct {
	IDs         []uint64     `in:"query" name:"id,omitempty"`
	AppletIDs   []types.SFID `in:"query" name:"appletID,omitempty"`
	StrategyIDs []types.SFID `in:"query" name:"strategyID,omitempty"`
	EventTypes  []string     `in:"query" name:"eventType,omitempty"`
	datatypes.Pager
	// contains filtered or unexported fields
}

func (*ListStrategyReq) Additions

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

func (*ListStrategyReq) Condition

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

func (*ListStrategyReq) SetCurrentProjectID

func (r *ListStrategyReq) SetCurrentProjectID(projectID types.SFID)

type ListStrategyRsp

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

func ListStrategy

func ListStrategy(ctx context.Context, r *ListStrategyReq) (*ListStrategyRsp, error)

type UpdateReq added in v1.1.0

type UpdateReq = CreateData

Jump to

Keyboard shortcuts

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