db

package
v1.3.0-rc.0...-d217119 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NotDeleted

func NotDeleted(db *gorm.DB) *gorm.DB

Types

type ActionParams

type ActionParams pb.ActionParams

func (*ActionParams) Scan

func (p *ActionParams) Scan(value interface{}) error

func (ActionParams) Value

func (p ActionParams) Value() (driver.Value, error)

type DBClient

type DBClient struct {
	*dao.DBClient
}

func (*DBClient) BatchCreateRuleExecRecords

func (db *DBClient) BatchCreateRuleExecRecords(r []RuleExecRecord) error

func (*DBClient) CreateRule

func (db *DBClient) CreateRule(r *Rule) error

func (*DBClient) CreateRuleExecRecord

func (db *DBClient) CreateRuleExecRecord(r *RuleExecRecord) error

func (*DBClient) DeleteRule

func (db *DBClient) DeleteRule(id string) error

func (*DBClient) GetRule

func (db *DBClient) GetRule(id string) (*Rule, error)

func (*DBClient) ListRuleExecRecords

func (db *DBClient) ListRuleExecRecords(req *pb.ListRuleExecHistoryRequest) ([]RuleExecRecord, int64, error)

func (*DBClient) ListRules

func (db *DBClient) ListRules(req *pb.ListRulesRequest, withSystem bool) ([]Rule, int64, error)

func (*DBClient) UpdateRule

func (db *DBClient) UpdateRule(r *Rule) error

type Env

type Env map[string]interface{}

func (*Env) Scan

func (p *Env) Scan(value interface{}) error

func (Env) Value

func (p Env) Value() (driver.Value, error)

type Rule

type Rule struct {
	ID            string `gorm:"primary_key"`
	CreatedAt     time.Time
	UpdatedAt     time.Time
	Name          string
	Scope         string
	ScopeID       string
	EventType     string
	Enabled       *bool
	Code          string
	Params        ActionParams
	Actor         string
	SoftDeletedAt uint64
}

func (Rule) TableName

func (Rule) TableName() string

type RuleExecRecord

type RuleExecRecord struct {
	ID            string `gorm:"primary_key"`
	CreatedAt     time.Time
	UpdatedAt     time.Time
	Scope         string
	ScopeID       string
	RuleID        string
	Code          string
	Env           Env
	Succeed       *bool
	ActionOutput  string
	SoftDeletedAt uint64
	Actor         string
}

func (RuleExecRecord) TableName

func (RuleExecRecord) TableName() string

Jump to

Keyboard shortcuts

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