Documentation
¶
Index ¶
- Variables
- func BasicRequestWithBody(c *cli.Context, method string) (string, error)
- func GenerateDocs(c *cli.Context) error
- func Getbasic(c *cli.Context) (string, error)
- func ProcessCollection(jsonArr []Collection) (string, error)
- type BodyParams
- type Collection
- type FileTrunk
- type Folders
- type Headers
- type Requests
Constants ¶
This section is empty.
Variables ¶
var Contenttypes = map[string]string{
"html": "text/html",
"js": "application/json",
"xml": "application/xml",
"plain": "text/plain",
}
Contenttypes are used in Place for ctypes for sending requests
Functions ¶
func BasicRequestWithBody ¶
BasicRequestWithBody sends put|patch|post|delete requests
func GenerateDocs ¶
GenerateDocs generates the Documentation site from the hoppscotch-collection.json
func Getbasic ¶
Getbasic sends a simple GET request to the url with any potential parameters like Tokens or Basic Auth
func ProcessCollection ¶
func ProcessCollection(jsonArr []Collection) (string, error)
ProcessCollection parses the Collection struct and execute the said requests
Types ¶
type BodyParams ¶
BodyParams include the Body Parameters
type Collection ¶
type Collection struct {
// Name of the Whole Collection
Name string `json:"name"`
// Folders JSON Type
Folders []Folders `json:"folders"`
// Requests inside the Collection
Requests []Requests `json:"requests"`
}
Collection hold the structure of the basic `postwoman-collection.json`
func ReadCollection ¶
func ReadCollection(filename string) ([]Collection, error)
ReadCollection reads the `hoppScotch-collection.json` File and returns a the Loaded Collection Struct
type FileTrunk ¶
FileTrunk handles the buffer for generated README.md File
type Folders ¶
type Folders struct {
// Folder name
Name string `json:"name"`
// Requests inside the Folder
Requests []Requests `json:"requests"`
}
Folders can be organized to Folders
type Requests ¶
type Requests struct {
// Base URL of the Request
URL string `json:"url"`
// Path is the enpoint path
// URL+PATH = Full URL
Path string `json:"path"`
// Request Method - GET,POST,PUT,PATCH,DELETE
Method string `json:"method"`
// Authentication Type - Bearer Token or Basic Auth
Auth string `json:"auth"`
// Username for Basic Auth
User string `json:"httpUser"`
// Password for Basic Auth
Pass string `json:"httpPassword"`
PasswordFieldType string `json:"passwordFieldType"`
// Bearer token
Token string `json:"bearerToken"`
// Request Headers if any- Key,Value pairs
Headers []Headers `json:"headers"`
// Params for Get Requests
Params []interface{} `json:"params"`
// Body Params for POST requests and forth
Bparams []interface{} `json:"bodyParams"`
// Raw Input. Not Formatted JSON
RawParams string `json:"rawParams"`
// If RawInputs are used or Not
RawInput bool `json:"rawInput"`
// Content Type of Request
Ctype string `json:"contentType"`
RequestType string `json:"requestType"`
PreRequestScript string `json:"preRequestScript"`
TestScript string `json:"testScript"`
// Label of Collection
Label string `json:"label"`
// Name of the Request
Name string `json:"name"`
// Number of Collection
Collection int `json:"collection"`
}
Requests are the Request Model in JSON