rule

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileTpl

func CompileTpl(tpl interface{}, vars map[string]string) (compiled string)

CompileTpl receive []byte or string type tpl and variables map. Return the template after variable substitution

Types

type BaseRule

type BaseRule struct {
	Rule       `gorm:"-" json:"-" yaml:"-"`
	ID         uint      `gorm:"primarykey" form:"id" json:"id" yaml:"-"`
	CreatedAt  time.Time `json:"created_at" yaml:"-"`
	UpdatedAt  time.Time `json:"updated_at" yaml:"-"`
	Name       string    `gorm:"index;unique;not null;" form:"name" json:"name"`
	FlagFormat string    `gorm:"unique;not null;" form:"flag_format" json:"flag_format" yaml:"flag_format"`

	// base_bank 解决 mysql 中关键字 rank 冲突和 pg 下不能使用 “
	Rank         int  `gorm:"default:0;column:base_rank" json:"rank" form:"rank"`
	PushToClient bool `gorm:"default:false;not null;" form:"push_to_client" json:"push_to_client" yaml:"push_to_client"`
	Notice       bool `gorm:"default:false;not null;" form:"notice" json:"notice"`
	// contains filtered or unexported fields
}

func (BaseRule) Match

func (br BaseRule) Match(s string) (flag, flagGroup string, vars map[string]string)

type Rule

type Rule interface {
	CreateOrUpdate() error
	Delete() error
}

Jump to

Keyboard shortcuts

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