rest

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeJSON

func EncodeJSON(data any) ([]byte, error)

func IsJSON

func IsJSON(s string) bool

func ParseJSON

func ParseJSON(text string) (map[string]any, error)

func PrettyJSON

func PrettyJSON(data []byte) (string, error)

Types

type Response

type Response struct {
	StatusCode int
	Headers    map[string]string
	Cookies    []*http.Cookie
	Body       []byte

	TimePassed time.Duration

	IsJSON bool
	JSON   string
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(requests *state.Requests, environments *state.Environments) *Service

func (*Service) SendRequest

func (s *Service) SendRequest(requestID, activeEnvironmentID string) (*Response, error)

Jump to

Keyboard shortcuts

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