manifest

package
v0.0.0-...-3a6b306 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 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 Endpoint

type Endpoint struct {
	Label        string                 `json:label`
	Method       string                 `json:"method"`
	Endpoint     string                 `json:"endpoint"`
	PathArgs     map[string]string      `json:"pathArgs"`
	BodyArgs     map[string]string      `json:"bodyArgs"`
	BodyLiterals map[string]interface{} `json:"bodyLiterals"`
	Use          map[string]string      `json:"use"`
	Spec         *common.HandlerSpec    `json:"spec"`
	DelayBefore  int                    `json:"delayBefore"`
	DelayAfter   int                    `json:"delayAfter"`
	// contains filtered or unexported fields
}

func (*Endpoint) Eval

func (endpoint *Endpoint) Eval(f func(*Manifest, interface{}) bool) *Endpoint

func (*Endpoint) Evaluate

func (endpoint *Endpoint) Evaluate(manifest *Manifest, x interface{}) bool

func (*Endpoint) NewBodyArgs

func (endpoint *Endpoint) NewBodyArgs(args map[string]string) *Endpoint

func (*Endpoint) NewBodyLiterals

func (endpoint *Endpoint) NewBodyLiterals(args map[string]interface{}) *Endpoint

func (*Endpoint) NewPathArgs

func (endpoint *Endpoint) NewPathArgs(args map[string]string) *Endpoint

func (*Endpoint) NewUsage

func (endpoint *Endpoint) NewUsage(args map[string]string) *Endpoint

func (*Endpoint) SecDelayAfter

func (endpoint *Endpoint) SecDelayAfter(x int) *Endpoint

func (*Endpoint) SecDelayBefore

func (endpoint *Endpoint) SecDelayBefore(x int) *Endpoint

type Manifest

type Manifest struct {
	Host      string                 `json:"host"`
	Spec      string                 `json:"spec"`
	Headers   map[string]string      `json:"headers"`
	Label     string                 `json:"label"`
	Variables map[string]interface{} `json:"variables"`
	Endpoints []*Endpoint            `json:"endpoints"`
}

func LoadManifest

func LoadManifest(path string) (*Manifest, error)

func ParseManifest

func ParseManifest(b []byte) (*Manifest, error)

func (*Manifest) AddEndpoints

func (manifest *Manifest) AddEndpoints(endpoints ...*Endpoint)

func (*Manifest) NewEndpoint

func (manifest *Manifest) NewEndpoint(label, method, path string) *Endpoint

func (*Manifest) SetHeader

func (manifest *Manifest) SetHeader(k, v string)

Jump to

Keyboard shortcuts

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