entities

package
v0.0.0-...-535ab37 Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProxyingRequest int = iota
	PreviewerResponse
)

Variables

This section is empty.

Functions

func MessageTypeToString

func MessageTypeToString(t int) string

MessageTypeToString convert from integer value.

func StringToMessageType

func StringToMessageType(s string) (key int, ok bool)

StringToMessageType convert from string.

Types

type Preview

type Preview struct {
	Params *PreviewParams `json:"params"`
	Image  []byte         `json:"image,omitempty"`
}

Preview

type PreviewParams

type PreviewParams struct {
	Width  int    `json:"width"`
	Height int    `json:"height"`
	URL    string `json:"url,omitempty"`
}

PreviewParams

type Request

type Request struct {
	Params  *PreviewParams      `json:"params"`
	Headers map[string][]string `json:"headers,omitempty"`
}

Request data

func (Request) Type

func (r Request) Type() int

Type implementation for HTTP request proxying.

type Response

type Response struct {
	Preview *Preview `json:"preview,omitempty"`
	Status  Status   `json:"status"`
}

Response data

func (Response) Type

func (r Response) Type() int

Type implementation for image source response.

type Status

type Status struct {
	Code int    `json:"code"`
	Text string `json:"text"`
}

StatusError holds together HTTP response status code and text

Jump to

Keyboard shortcuts

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