profile

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestProfile added in v0.9.0

func CreateTestProfile(profileName string, profileContent string, profilesDir string)

CreateTestProfile helper method for testing. Will create a profile file with the specified content in the specified directory.

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

func SetupTestProfilesDir added in v0.9.0

func SetupTestProfilesDir() string

SetupTestProfilesDir helper method for testing. This will create a temporary directory where profiles can be dropped in. It will also set the environment variable so that profile files are read from the temporary directory.

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) (loadedOptions Options, err 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
	FileToUpload string
	Headers      map[string][]string
	Method       string
	URL          string
}

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

Jump to

Keyboard shortcuts

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