control

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrValidation = errors.New("validation")

Functions

func NewHandler

func NewHandler(queues *storage.Queues) http.Handler

func NewJsonRPC

func NewJsonRPC(server *rpc.Server) *jsonRPC

Types

type DelayDuration

type DelayDuration struct {
	time.Duration
}

func (DelayDuration) MarshalJSON

func (d DelayDuration) MarshalJSON() ([]byte, error)

func (*DelayDuration) UnmarshalJSON

func (d *DelayDuration) UnmarshalJSON(data []byte) error

type Headers

type Headers map[string]string

func (*Headers) ToHttpHeaders

func (h *Headers) ToHttpHeaders() http.Header

type Request

type Request struct {
	Method  string  `json:"method"`
	Url     string  `json:"url"`
	Headers Headers `json:"headers"`
	Body    string  `json:"body"`
}

type Requests

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

func NewRequests

func NewRequests(store storage.Store) *Requests

func (*Requests) Clear

func (r *Requests) Clear(_ struct{}, reply *bool) error

func (*Requests) List

func (r *Requests) List(_ struct{}, reply *[]Request) error

func (*Requests) Pop

func (r *Requests) Pop(_ struct{}, reply *interface{}) error

type Response

type Response struct {
	Delay   DelayDuration `json:"delay"`
	Status  int           `json:"status"`
	Headers Headers       `json:"headers"`
	Body    string        `json:"body"`
}

type Responses

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

func NewResponses

func NewResponses(store storage.Store) *Responses

func (*Responses) Clear

func (r *Responses) Clear(_ struct{}, reply *bool) error

func (*Responses) List

func (r *Responses) List(_ struct{}, reply *[]Response) error

func (*Responses) Push

func (r *Responses) Push(arg Response, reply *bool) error

Jump to

Keyboard shortcuts

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