shared_backend

package
v0.0.0-...-bb564d6 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleRequest

func HandleRequest(rawRequest []byte) []byte

Types

type ConnectivityTestError

type ConnectivityTestError struct {
	// TODO: add Shadowsocks/Transport error
	Op string `json:"operation"`
	// Posix error, when available
	PosixError string `json:"posixError"`
	// TODO: remove IP addresses
	Msg string `json:"message"`
}

type ConnectivityTestProtocolConfig

type ConnectivityTestProtocolConfig struct {
	TCP bool `json:"tcp"`
	UDP bool `json:"udp"`
}

type ConnectivityTestRequest

type ConnectivityTestRequest struct {
	AccessKey string                         `json:"accessKey"`
	Domain    string                         `json:"domain"`
	Resolvers []string                       `json:"resolvers"`
	Protocols ConnectivityTestProtocolConfig `json:"protocols"`
}

type ConnectivityTestResult

type ConnectivityTestResult struct {
	// Inputs
	Proxy    string `json:"proxy"`
	Resolver string `json:"resolver"`
	Proto    string `json:"proto"`
	Prefix   string `json:"prefix"`
	// Observations
	Time       time.Time              `json:"time"`
	DurationMs int64                  `json:"durationMs"`
	Error      *ConnectivityTestError `json:"error"`
}

func ConnectivityTest

func ConnectivityTest(request ConnectivityTestRequest) ([]ConnectivityTestResult, error)

type PlatformMetadata

type PlatformMetadata struct {
	OS string `json:"operatingSystem"`
}

func Platform

func Platform() PlatformMetadata

type Prefix

type Prefix []byte

func ParseStringPrefix

func ParseStringPrefix(utf8Str string) (Prefix, error)

func (Prefix) String

func (p Prefix) String() string

type Request

type Request struct {
	ResourceName string `json:"resourceName"`
	Parameters   string `json:"parameters"`
}

TODO: generalize via reflection/generics and move to infrastructure

type Response

type Response struct {
	Body  string `json:"body"`
	Error string `json:"error"`
}

Jump to

Keyboard shortcuts

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