hook

package
v0.0.0-...-befbd13 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

type Hook struct {
	Method  string      `yaml:"method"`
	Headers http.Header `yaml:"headers"`
	Body    string      `yaml:"body"`
}

Hook represents a single hook configuration.

func New

func New(bs []byte) (*Hook, error)

New creates a new Hook from the given bytestring.

func NewFromPath

func NewFromPath(path string) (*Hook, error)

NewFromPath creates a new Hook from the given path.

func NewFromRequest

func NewFromRequest(r *http.Request) (*Hook, error)

NewFromRequest creates a new Hook from the given HTTP Request.

func (*Hook) Dump

func (h *Hook) Dump() ([]byte, error)

Dump TODO(eddiezane): Is this the right method?

func (*Hook) Fire

func (h *Hook) Fire(target string) (*http.Response, error)

Fire sends an HTTP request to the given target.

Jump to

Keyboard shortcuts

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