client

package
v0.0.0-...-3931716 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResponseFromReader

func ResponseFromReader(
	httpRequestReader io.Reader,
	conn net.Conn,
) (resp *http.Response, err error)

Types

type BrowserId

type BrowserId struct {
	Browser string `json:"browser"`
	Pid     string `json:"pid"`
}

func (BrowserId) String

func (bi BrowserId) String() string

type BrowserItem

type BrowserItem struct {
	Id         BrowserItemId `json:"id"`
	Url        string        `json:"url"`
	Date       string        `json:"date"`
	Title      string        `json:"title"`
	ExternalId string        `json:"external-id"` // external to the browser, so for us, it's actually our id
}

func (BrowserItem) GetUrl

func (i BrowserItem) GetUrl() (u *url.URL, err error)

type BrowserItemId

type BrowserItemId struct {
	BrowserId BrowserId `json:"browser-id"`
	Id        string    `json:"id"`
	Type      string    `json:"type"`
}

func (BrowserItemId) String

func (bi BrowserItemId) String() string

type BrowserProxy

type BrowserProxy struct {
	config.Config
}

func (BrowserProxy) HTTPRequest

func (b BrowserProxy) HTTPRequest(
	httpReq *http.Request,
	req BrowserRequest,
) (resp ResponseWithParsedJSONBody, err error)

func (BrowserProxy) HTTPRequestWithContext

func (b BrowserProxy) HTTPRequestWithContext(
	ctx context.Context,
	httpReq *http.Request,
	req BrowserRequest,
) (resp ResponseWithParsedJSONBody, err error)

TODO figure out which method retunrs err == io.EOF and set err to nil

func (BrowserProxy) Request

func (b BrowserProxy) Request(
	req BrowserRequest,
) (resp ResponseWithParsedJSONBody, err error)

type BrowserRequest

type BrowserRequest struct {
	config.BrowserId

	Method string
	Path   string
	Body   io.ReadCloser
}

type ResponseWithParsedJSONBody

type ResponseWithParsedJSONBody struct {
	*http.Response
	ParsedJSONBody server.JSONAnything
}

Jump to

Keyboard shortcuts

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