scope

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	Key   *regexp.Regexp
	Value *regexp.Regexp
}

type Repository

type Repository interface {
	UpsertSettings(ctx context.Context, module string, settings interface{}) error
	FindSettingsByModule(ctx context.Context, module string, settings interface{}) error
}

type Rule

type Rule struct {
	URL    *regexp.Regexp
	Header Header
	Body   *regexp.Regexp
}

func (Rule) MarshalJSON

func (r Rule) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (Rule) Match

func (r Rule) Match(req *http.Request, body []byte) bool

func (*Rule) UnmarshalJSON

func (r *Rule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Scope

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

func New

func New(repo Repository, projService *proj.Service) *Scope

func (*Scope) Match

func (s *Scope) Match(req *http.Request, body []byte) bool

func (*Scope) Rules

func (s *Scope) Rules() []Rule

func (*Scope) SetRules

func (s *Scope) SetRules(ctx context.Context, rules []Rule) error

Jump to

Keyboard shortcuts

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