data

package
v0.0.0-...-ee38f14 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CurrentVersion = "0.0.1"
)

Variables

View Source
var (
	BodyTypeExtensions = map[BodyType]string{
		BodyTypeNone: "",
		BodyTypeJSON: "json",
		BodyTypeForm: "form",
		BodyTypeText: "txt",
	}

	BodyTypes = [...]BodyType{
		BodyTypeNone,
		BodyTypeJSON,
		BodyTypeForm,
		BodyTypeText,
	}
)

Functions

This section is empty.

Types

type BodyType

type BodyType string
const (
	BodyTypeNone BodyType = "none"
	BodyTypeJSON BodyType = "json"
	BodyTypeForm BodyType = "form"
	BodyTypeText BodyType = "text"
)

type HTTPMethod

type HTTPMethod string
const (
	HTTPMethodGet    HTTPMethod = "GET"
	HTTPMethodPost   HTTPMethod = "POST"
	HTTPMethodPut    HTTPMethod = "PUT"
	HTTPMethodDelete HTTPMethod = "DELETE"
	HTTPMethodPatch  HTTPMethod = "PATCH"
	HTTPMethodHead   HTTPMethod = "HEAD"
	HTTPMethodOption HTTPMethod = "OPTION"
)

type Project

type Project struct {
	Name    string `json:"name"`
	Version string `json:"version"`

	RootDir string `json:"-"`
	// contains filtered or unexported fields
}

func LoadProject

func LoadProject(rootDir string) (*Project, error)

func NewProject

func NewProject(rootDir string, name string) (*Project, error)

func (*Project) GetRequest

func (p *Project) GetRequest(name string) (*Request, bool)

func (*Project) ListEnvironments

func (p *Project) ListEnvironments() ([]string, error)

func (*Project) ListRequests

func (p *Project) ListRequests() []*Request

func (*Project) NewRequest

func (p *Project) NewRequest(
	name string, description string, method HTTPMethod,
	url string, bodyType BodyType, bodyTemplate string,
	headers map[string]string,
) *Request

func (*Project) ReloadRequests

func (p *Project) ReloadRequests() error

func (*Project) Save

func (p *Project) Save() error

type Request

type Request struct {
	Name        string     `json:"-"`
	Description string     `json:"description"`
	Method      HTTPMethod `json:"method"`

	URL       string            `json:"url"`
	BodyType  BodyType          `json:"body_type"`
	Body      string            `json:"body_template"`
	Headers   map[string]string `json:"headers"`
	Variables map[string]string `json:"variables"`

	Version string `json:"version"`
	// contains filtered or unexported fields
}

func (*Request) Clone

func (r *Request) Clone() *Request

func (*Request) Delete

func (r *Request) Delete() error

func (*Request) Rename

func (r *Request) Rename(newName string) error

func (*Request) Save

func (r *Request) Save() error

Jump to

Keyboard shortcuts

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