Documentation ¶
Index ¶
- Variables
- func ApplyRule(rule *ChaosRule, stmt *gorm.Statement) (applied bool)
- func ApplyValuesIfMatch(stmt *gorm.Statement, matcher Matcher, applier Applier) (applied bool)
- func Canonical(schema *schema.Schema, v map[string]interface{})
- type Applier
- type ApplyBy
- type ApplyByInterface
- type ApplyByReflectValue
- type Callback
- type ChaosRule
- type Match
- type MatchBy
- type MatchByInterface
- type MatchByReflectValue
- type Matcher
- type RuleProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DEBUG = os.Getenv("SQLCHAOS_DEBUG") != "" SQLCHAOS_DEBUG = func(format string, args ...interface{}) { if DEBUG { fmt.Fprintf(os.Stdout, "SQLCHAOS:"+format+"\n", args...) } } SQLCHAOS_ERROR = func(format string, args ...interface{}) { fmt.Fprintf(os.Stderr, "SQLCHAOS:"+format+"\n", args...) } )
Functions ¶
func ApplyValuesIfMatch ¶
Types ¶
type Applier ¶
func ParseThenStatement ¶
ParseThenStatement parses then clause to appliers. NOTE: then clause spec be like: column1=value1, column2=value2
type ApplyByInterface ¶
type ApplyByInterface map[string]interface{}
type ApplyByReflectValue ¶
type Callback ¶
type Callback struct { DBName string RuleProvider RuleProvider }
func (*Callback) BeforeCreate ¶
func (*Callback) BeforeUpdate ¶
type MatchByInterface ¶
type MatchByInterface map[string]interface{}
type MatchByReflectValue ¶
type Matcher ¶
func ParseWhenStatement ¶
ParseWhenStatement parses when clause to matchers NOTE: when clause spec be like: column1=value1 AND column2>=value2
Click to show internal directories.
Click to hide internal directories.