endpoint

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointConfig

type EndpointConfig struct {
	Filename string

	Method     string
	Url        string
	OnComplete []string
	Transform  []string
	Headers    map[string][]string
	Prompts    []*Prompt
	// contains filtered or unexported fields
}

func Load

func Load(filename string) (*EndpointConfig, error)

Load - Loads a confugruation from a file on the disk.

func LoadBytes

func LoadBytes(fileBytes []byte) (*EndpointConfig, error)

LoadBytes - Loads a configuration from a byte array

func New added in v0.2.0

func New() *EndpointConfig

func (*EndpointConfig) GetJSONBytes

func (ep *EndpointConfig) GetJSONBytes(path string) []byte

GetJSONBytes - returns the inner JSON at the path as a byte array.

func (*EndpointConfig) GetJSONString

func (ep *EndpointConfig) GetJSONString(path string) string

GetJSONString - returns the inner JSON at the path as a string.

func (*EndpointConfig) GetRequestParams

func (ep *EndpointConfig) GetRequestParams() map[string]string

GetRequestParams - Returns a string map of any request params for the request. This only applies to GET requests.

func (*EndpointConfig) GetString

func (ep *EndpointConfig) GetString(path string) string

GetString - returns a string from an arbitrary path in the configuration.

func (*EndpointConfig) RequestData added in v0.1.2

func (ep *EndpointConfig) RequestData() []byte

RequestData - returns the data attribute from the config. This contains the payload, for a POST request, that will be sent to the server.

func (*EndpointConfig) RequestMethod

func (ep *EndpointConfig) RequestMethod() string

RequestMethod - returns the request method.

func (*EndpointConfig) RequestURL

func (ep *EndpointConfig) RequestURL() string

RequestURL - returns the full url for the request. If this is a GET request and has request parameters they are included in the URL.

func (*EndpointConfig) String added in v0.3.0

func (ep *EndpointConfig) String() string

type Prompt added in v0.3.0

type Prompt struct {
	Name         string
	DefaultValue string
}

Jump to

Keyboard shortcuts

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