Help us shape the future of Go! Take the 2026 Go Developer Survey

rule

package
v0.17.28 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 4 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
	ForwardHostHeader() bool
}

type Executor

type Executor interface {
	Execute(ctx heimdall.RequestContext) (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.RequestContext) (Rule, error)

	AddRuleSet(ctx context.Context, srcID string, rules []Rule) error
	UpdateRuleSet(ctx context.Context, srcID string, rules []Rule) error
	DeleteRuleSet(ctx context.Context, srcID string) error
}

type Route

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

type Rule

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

type SetProcessor

type SetProcessor interface {
	OnCreated(ctx context.Context, ruleSet *config.RuleSet) error
	OnUpdated(ctx context.Context, ruleSet *config.RuleSet) error
	OnDeleted(ctx context.Context, 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