Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTestProfile ¶
CreateTestProfile helper method for testing. Will create a profile file with the specified content in the specified directory.
func GetAvailableProfiles ¶
GetAvailableProfiles return the name of all profiles available in the configured directory
func GetAvailableRequests ¶
GetAvailableRequests returns a list of all the names of requests available in a profile.
func GetProfilesDir ¶
GetProfilesDir return the directory where profiles are stored
func SetupTestProfilesDir ¶
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 NamedRequest ¶
type NamedRequest struct { AllowInsecure bool Body string FileToUpload string Headers map[string][]string Method string Name string PostProcessScript string Source string // File where this request was loaded from URL string Values map[string][]string }
NamedRequest is a representation of a request that can be loaded from a profile.
func FindNamedRequest ¶
func FindNamedRequest(mergedProfile *Options, requestName string) (NamedRequest, error)
FindNamedRequest finds a named request in a group of already merged profiles
func (NamedRequest) GetAllowInsecure ¶ added in v1.2.0
func (req NamedRequest) GetAllowInsecure() bool
GetAllowInsecure returns if this named request allow insecure HTTP connections
func (NamedRequest) GetBody ¶
func (req NamedRequest) GetBody() (string, error)
GetBody returns the body for this NamedRequest
func (NamedRequest) GetHeaders ¶
func (req NamedRequest) GetHeaders() map[string][]string
GetHeaders returns the headers for this NamedRequest
func (NamedRequest) GetMethod ¶
func (req NamedRequest) GetMethod() string
GetMethod return the HTTP method for this NamedRequest
func (NamedRequest) GetValues ¶
func (req NamedRequest) GetValues() map[string][]string
GetValues returns the values for this NamedRequest
type Options ¶
type Options struct { AllowInsecure bool BaseURL string Headers map[string][]string NamedRequest map[string]NamedRequest Variables map[string]string }
Options that can come from a profile file.
func LoadAndMergeProfiles ¶
LoadAndMergeProfiles loads all profiles and merge them in the order passed in
func LoadProfile ¶
LoadProfile loads Options for a specific profile by name.
func MergeOptions ¶
MergeOptions merges all options passed in into a final Options object.
func (Options) GetAllowInsecure ¶ added in v1.2.0
GetAllowInsecure returns if this option allow insecure HTTP connections
func (Options) GetHeaders ¶
GetHeaders returns the headers set in this option