chrest

package
v0.0.0-...-d9be513 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const StatusBadBoy = http.StatusBadRequest

Variables

This section is empty.

Functions

func AskChrome

func AskChrome(c Config, req *http.Request) (response interface{}, err error)

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

func ByteArrayToInt32

func ByteArrayToInt32(arr [4]byte) int32

func Int32ToByteArray

func Int32ToByteArray(i int32) [4]byte

TODO read from ohio

func ReadAllOrDieTrying

func ReadAllOrDieTrying(r io.Reader, b []byte) (n int, err error)

func ReadFromChrome

func ReadFromChrome(m interface{}) (n int64, err error)

func ReadInt32

func ReadInt32(r io.Reader, i *int32) (n int64, err error)

func ResponseFromReader

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

func ServeHTTP

func ServeHTTP(w http.ResponseWriter, req *http.Request)

func StateDirectory

func StateDirectory() (v string, err error)
func Symlink(oldPath, newPath string) (err error)

func WriteAllOrDieTrying

func WriteAllOrDieTrying(w io.Writer, b []byte) (n int, err error)

func WriteToChrome

func WriteToChrome(m interface{}) (n int64, err error)

Types

type Config

type Config struct {
	Home string `json:"-"`
	Port string `json:"port"`
}

func ConfigDefault

func ConfigDefault() (c Config, err error)

func (Config) Directory

func (c Config) Directory() (v string)

func (*Config) Read

func (c *Config) Read() (err error)

func (Config) ServerPath

func (c Config) ServerPath() string

func (Config) SocketPath

func (c Config) SocketPath() (v string, err error)

func (*Config) Write

func (c *Config) Write() (err error)

type InstallJSON

type InstallJSON struct {
	Name           string   `json:"name"`
	Description    string   `json:"description"`
	Path           string   `json:"path"`
	Type           string   `json:"type"`
	AllowedOrigins []string `json:"allowed_origins"`
}

func MakeInstallJSON

func MakeInstallJSON(p string, ids ...string) (ij InstallJSON, err error)

type JsonAnything

type JsonAnything = interface{}

type JsonObject

type JsonObject = map[string]JsonAnything

type Request

type Request JsonObject

func NewRequest

func NewRequest(in *http.Request, body JsonAnything) (out Request)

type ServerSocket

type ServerSocket struct {
	SockPath string
	Address  *net.UnixAddr
	Listener *net.UnixListener
}

func (*ServerSocket) Listen

func (s *ServerSocket) Listen() (err error)

Jump to

Keyboard shortcuts

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