rule

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	URL() *url.URL
}

type Executor

type Executor interface {
	Execute(ctx heimdall.Context) (Backend, error)
}

type Factory

type Factory interface {
	CreateRule(version, srcID string, ruleConfig config.Rule) (Rule, error)
	DefaultRule() Rule
	HasDefaultRule() bool
}

type Repository

type Repository interface {
	FindRule(ctx heimdall.Context) (Rule, error)

	AddRuleSet(srcID string, rules []Rule) error
	UpdateRuleSet(srcID string, rules []Rule) error
	DeleteRuleSet(srcID string) error
}

type Route

type Route interface {
	Path() string
	Matches(ctx heimdall.Context, keys, values []string) bool
	Rule() Rule
}

type Rule

type Rule interface {
	ID() string
	SrcID() string
	Execute(ctx heimdall.Context) (Backend, error)
	Routes() []Route
	SameAs(other Rule) bool
	EqualTo(other Rule) bool
	AllowsBacktracking() bool
}

type SetProcessor

type SetProcessor interface {
	OnCreated(ruleSet *config.RuleSet) error
	OnUpdated(ruleSet *config.RuleSet) error
	OnDeleted(ruleSet *config.RuleSet) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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