privacy

package
v1.4.2-beta3 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const UnixScheme = "http+unix"

Scheme is the URL scheme used for HTTP over UNIX domain sockets.

Variables

View Source
var (
	ErrPtmNodeNotRunning = errors.New("ptm node not running")
	ErrPtmAPIFailed      = errors.New("ptm api failed")
	ErrPtmClientNull     = errors.New("ptm client null")
)

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(ptmNode string) *Client

func (*Client) ReceivePayload

func (c *Client) ReceivePayload(key []byte) ([]byte, error)

func (*Client) SendPayload

func (c *Client) SendPayload(pl []byte, b64From string, b64To []string) ([]byte, error)

func (*Client) Upcheck

func (c *Client) Upcheck() (bool, error)

type Controller

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

func NewController

func NewController(cc *context.ChainContext) *Controller

func (*Controller) Init

func (c *Controller) Init() error

func (*Controller) Start

func (c *Controller) Start() error

func (*Controller) Stop

func (c *Controller) Stop() error

type HttpTransport

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

func (*HttpTransport) RoundTrip

func (t *HttpTransport) RoundTrip(req *http.Request) (*http.Response, error)

func (*HttpTransport) SetFakeMode

func (t *HttpTransport) SetFakeMode(mode bool)

type PTM

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

func NewPTM

func NewPTM(cfg *config.Config) *PTM

func (*PTM) GetDebugInfo

func (m *PTM) GetDebugInfo() map[string]interface{}

func (*PTM) Init

func (m *PTM) Init() error

func (*PTM) Receive

func (m *PTM) Receive(data []byte) ([]byte, error)

func (*PTM) Send

func (m *PTM) Send(data []byte, from string, to []string) (out []byte, err error)

func (*PTM) SetFakeMode

func (m *PTM) SetFakeMode(mode bool)

func (*PTM) Start

func (m *PTM) Start() error

func (*PTM) Stop

func (m *PTM) Stop() error

type Transport

type Transport interface {
	http.RoundTripper
	SetFakeMode(mode bool)
}

type UnixTransport

type UnixTransport struct {
	// DialTimeout is deprecated. Use context instead.
	DialTimeout time.Duration
	// RequestTimeout is deprecated and has no effect.
	RequestTimeout time.Duration
	// ResponseHeaderTimeout is deprecated. Use context instead.
	ResponseHeaderTimeout time.Duration
	// contains filtered or unexported fields
}

UnixTransport is a http.RoundTripper that connects to Unix domain sockets.

func (*UnixTransport) RegisterLocation

func (t *UnixTransport) RegisterLocation(loc string, path string)

RegisterLocation registers an URL location and maps it to the given file system path.

Calling RegisterLocation twice for the same location is a programmer error, and causes a panic.

func (*UnixTransport) RoundTrip

func (t *UnixTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip executes a single HTTP transaction. See net/http.RoundTripper.

func (*UnixTransport) SetFakeMode

func (t *UnixTransport) SetFakeMode(mode bool)

Jump to

Keyboard shortcuts

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