profile

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAvailableProfiles

func GetAvailableProfiles() ([]string, error)

GetAvailableProfiles return the name of all profiles available in the configured directory

func GetAvailableRequests

func GetAvailableRequests(profileName string) ([]string, error)

GetAvailableRequests returns a list of all the names of requests available in a profile.

func GetProfilesDir

func GetProfilesDir() (string, error)

GetProfilesDir return the directory where profiles are stored

Types

type Options

type Options struct {
	BaseURL        string
	Headers        map[string][]string
	RequestOptions map[string]RequestOptions
	Variables      map[string]string
}

Options that can come from a profile file.

func LoadProfile

func LoadProfile(profileName string) (*Options, error)

LoadProfile loads Options for a specific profile by name.

func MergeOptions

func MergeOptions(profiles []Options) Options

MergeOptions merges all options passed in into a final Options object.

type RequestOptions

type RequestOptions struct {
	Body    string
	Headers map[string][]string
	Method  string
	URL     string
}

RequestOptions is a representation of a request that can be loaded from a profile.

func LoadRequestOptions

func LoadRequestOptions(requestNameToFind string, profiles []string) (*RequestOptions, error)

LoadRequestOptions loads request configurations from the profile names passed in. It returns an error if it doesn't find a request configuration with the specified name. It will return the last request options found, if the same name is found in multiple profiles.

Jump to

Keyboard shortcuts

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