filecustomrule

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Overview

Package filecustomrule implements static custom rule from a config file

Index

Constants

View Source
const FileCustomRuleSource string = "FILE_CUSTOM_RULE"

FileCustomRuleSource is the name of the file based custom rule source

Variables

This section is empty.

Functions

func ActivateFileCustomRules

func ActivateFileCustomRules(qsc tabletserver.Controller)

ActivateFileCustomRules activates this static file based custom rule mechanism

func ParseRules added in v0.10.0

func ParseRules(path string) (*rules.Rules, error)

ParseRules will construct a Rules object based on a file path. In the case of error it returns nil and that error. A log will be printed to capture the stage at which parsing failed.

Types

type FileCustomRule

type FileCustomRule struct {
	// contains filtered or unexported fields
}

FileCustomRule is an implementation of CustomRuleManager, it reads custom query rules from local file for once and push it to vttablet

func NewFileCustomRule

func NewFileCustomRule() (fcr *FileCustomRule)

NewFileCustomRule returns pointer to new FileCustomRule structure

func (*FileCustomRule) GetRules

func (fcr *FileCustomRule) GetRules() (qrs *rules.Rules, version int64, err error)

GetRules returns query rules built from local file

func (*FileCustomRule) Open

func (fcr *FileCustomRule) Open(qsc tabletserver.Controller, rulePath string) error

Open try to build query rules from local file and push the rules to vttablet

Jump to

Keyboard shortcuts

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