sfdb

package
v0.0.0-...-9a26220 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchAddGroupsForRules

func BatchAddGroupsForRules(db *gorm.DB, ruleNames, groupNames []string) (int64, error)

BatchAddGroupsForRules 为多个规则添加多个组 如果要添加的组不存在,会自动创建

func BatchRemoveGroupsForRules

func BatchRemoveGroupsForRules(db *gorm.DB, ruleNames, groupNames []string) (int64, error)

BatchRemoveGroupsForRules 为多个规则移除多个组

func BuildFileSystem

func BuildFileSystem(s *schema.SyntaxFlowRule) (fi.FileSystem, error)

func CheckSyntaxFlowLanguage

func CheckSyntaxFlowLanguage(languageRaw string) (consts.Language, error)

func CheckSyntaxFlowRuleContent

func CheckSyntaxFlowRuleContent(content string) (*schema.SyntaxFlowRule, error)

func CheckSyntaxFlowRuleType

func CheckSyntaxFlowRuleType(ruleName string) (schema.SyntaxFlowRuleType, error)

func CreateGroup

func CreateGroup(db *gorm.DB, groupName string, isBuildIn ...bool) (*schema.SyntaxFlowGroup, error)

CreateGroup 通过组名创建SyntaxFlow规则组

func CreateRule

func CreateRule(rule *schema.SyntaxFlowRule, groups ...string) (*schema.SyntaxFlowRule, error)

func CreateRuleByContent

func CreateRuleByContent(ruleName string, content string, buildIn bool, tags ...string) (*schema.SyntaxFlowRule, error)

func CreateRuleWithDefaultGroup

func CreateRuleWithDefaultGroup(rule *schema.SyntaxFlowRule, groups ...string) (*schema.SyntaxFlowRule, error)

func DeleteBuildInRule

func DeleteBuildInRule() error

func DeleteGroup

func DeleteGroup(db *gorm.DB, groupName string) error

DeleteGroup 通过组名删除SyntaxFlow规则组

func DeleteRuleByLibName

func DeleteRuleByLibName(name string) error

func DeleteRuleByRuleName

func DeleteRuleByRuleName(name string) error

func DeleteRuleByTitle

func DeleteRuleByTitle(name string) error

func ExportDatabase

func ExportDatabase() io.ReadCloser

func GetAllRules

func GetAllRules() ([]*schema.SyntaxFlowRule, error)

func GetIntersectionGroup

func GetIntersectionGroup(db *gorm.DB, groups [][]*schema.SyntaxFlowGroup) []*schema.SyntaxFlowGroup

func GetLibrary

func GetLibrary(libname string) (*schema.SyntaxFlowRule, error)

func GetOrCreateGroups

func GetOrCreateGroups(db *gorm.DB, groupNames []string) []*schema.SyntaxFlowGroup

func GetRule

func GetRule(ruleName string) (*schema.SyntaxFlowRule, error)

func GetRulePure

func GetRulePure(ruleName string) (*schema.SyntaxFlowRule, error)

func GetRules

func GetRules(ruleNameGlob string) ([]*schema.SyntaxFlowRule, error)

func ImportDatabase

func ImportDatabase(reader io.Reader) error

func ImportRuleWithoutValid

func ImportRuleWithoutValid(ruleName string, content string, buildin bool, tags ...string) (*schema.SyntaxFlowRule, error)

func ImportValidRule

func ImportValidRule(system fi.FileSystem, ruleName string, content string) error

func LoadFileSystem

func LoadFileSystem(s *schema.SyntaxFlowRule, system fi.FileSystem) error

func MigrateSyntaxFlow

func MigrateSyntaxFlow(hash string, i *schema.SyntaxFlowRule) error

func QueryGroupByName

func QueryGroupByName(db *gorm.DB, groupName string) (*schema.SyntaxFlowGroup, error)

QueryGroupByName 根据组名查询组

func QueryGroupsByName

func QueryGroupsByName(db *gorm.DB, groupNames []string) ([]*schema.SyntaxFlowGroup, error)

func QueryRuleByName

func QueryRuleByName(db *gorm.DB, ruleName string) (*schema.SyntaxFlowRule, error)

func QueryRulesByName

func QueryRulesByName(db *gorm.DB, ruleNames []string) ([]*schema.SyntaxFlowRule, error)

func RegisterValid

func RegisterValid(f func(rule *schema.SyntaxFlowRule) error)

func RenameGroup

func RenameGroup(db *gorm.DB, oldName, newName string) error

RenameGroup 重命名组

func UpdateRule

func UpdateRule(rule *schema.SyntaxFlowRule) error

func YieldSyntaxFlowRules

func YieldSyntaxFlowRules(db *gorm.DB, ctx context.Context) chan *schema.SyntaxFlowRule

func YieldSyntaxFlowRulesWithoutLib

func YieldSyntaxFlowRulesWithoutLib(db *gorm.DB, ctx context.Context) chan *schema.SyntaxFlowRule

Types

This section is empty.

Jump to

Keyboard shortcuts

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