invoke

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Id       string        `json:"id"`
	Request  EntryRequest  `json:"request"`
	Response EntryResponse `json:"response"`
}

type EntryRequest

type EntryRequest struct {
	Method  string              `json:"method"`
	Url     string              `json:"url"`
	Headers map[string][]string `json:"headers"`
	Body    string              `json:"body"`
	Started int64               `json:"started"`
}

type EntryResponse

type EntryResponse struct {
	Status   int                 `json:"status"`
	Headers  map[string][]string `json:"headers"`
	Body     string              `json:"body"`
	Received int64               `json:"received"`
}

type InvokeSrv

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

func New

func New(repos repository.Repos) InvokeSrv

func (*InvokeSrv) Get

func (srv *InvokeSrv) Get(id string) (Entry, error)

func (*InvokeSrv) GetBaseUrl

func (srv *InvokeSrv) GetBaseUrl() string

TODO

func (*InvokeSrv) Invoke

func (srv *InvokeSrv) Invoke(entry *Entry) error

func (*InvokeSrv) List

func (srv *InvokeSrv) List() ([]Entry, error)

TODO: paginate

func (*InvokeSrv) NewEntry

func (srv *InvokeSrv) NewEntry(method string) Entry

func (*InvokeSrv) Read

func (srv *InvokeSrv) Read() (Workspace, error)

func (*InvokeSrv) Save

func (srv *InvokeSrv) Save(entry Entry) error

func (*InvokeSrv) Write

func (srv *InvokeSrv) Write(ws Workspace) error

type Workspace

type Workspace struct {
	// BaseUrl string  `json:"baseUrl"` // like `https://example.com`
	Entries []Entry `json:"entries"`
}

Jump to

Keyboard shortcuts

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