register

package
v0.0.0-...-92e3287 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(name string, scope []Scope, f func(b []byte) (interface{}, error))

Set adds the received data into the register

Types

type Component

type Component struct {
	Scope       []Scope
	NewFromJSON func(b []byte) (interface{}, error)
}

Component contains the scope and the module factory

type Register

type Register map[string]Component

Register is the struct containing all the martian components

func Get

func Get() Register

Get retrieves a copy of the register

type Scope

type Scope string

Scope defines the scope of the component

const (
	// ScopeRequest modifies an HTTP request.
	ScopeRequest Scope = "request"
	// ScopeResponse modifies an HTTP response.
	ScopeResponse Scope = "response"
)

Jump to

Keyboard shortcuts

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