hook

package
v0.6.20 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractHook

func ExtractHook(r *http.Request, name string) (rule.HookSpec, bool)

func ExtractRule

func ExtractRule(r *http.Request) (*rule.Rule, bool)

Types

type Attribute

type Attribute struct {
	Key    string        `yaml:"key" mapstructure:"key"`
	Type   AttributeType `yaml:"type" mapstructure:"type"`
	Index  string        `yaml:"index" mapstructure:"index"` // proto index
	Source string        `yaml:"source" mapstructure:"source"`
	Value  string        `yaml:"value" mapstructure:"value"`
}

type AttributeType

type AttributeType string
const (
	AttributeTypeJSONPayload AttributeType = "json_payload"
	AttributeTypeGRPCPayload AttributeType = "grpc_payload"
	AttributeTypeQuery       AttributeType = "query"
	AttributeTypeHeader      AttributeType = "header"
	AttributeTypeConstant    AttributeType = "constant"

	SourceRequest  AttributeType = "request"
	SourceResponse AttributeType = "response"
)

type Hook

type Hook struct{}

func New

func New() Hook

func (Hook) Info

func (h Hook) Info() Info

func (Hook) ServeHook

func (h Hook) ServeHook(res *http.Response, err error) (*http.Response, error)

type Info

type Info struct {
	Name        string
	Description string
}

type Service

type Service interface {
	Info() Info
	ServeHook(res *http.Response, err error) (*http.Response, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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