util

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DHTOrdered

func DHTOrdered(a, b, c types.PublicKey) bool

DHTOrdered returns true if the order of A, B and C is correct, where A < B < C without wrapping.

func DHTWrappedOrdered

func DHTWrappedOrdered(a, b, c types.PublicKey) bool

DHTWrappedOrdered returns true if the ordering of A, B and C is correct, where we may wrap around from C to A. This gives us the property of the successor always being a+1 and the predecessor being a+sizeofkeyspace.

func ForwardOrdering

func ForwardOrdering(target types.PublicKey, input []types.PublicKey) func(i, j int) bool

func LessThan

func LessThan(first, second types.PublicKey) bool

func ReverseOrdering

func ReverseOrdering(target types.PublicKey, input []types.PublicKey) func(i, j int) bool

func SignedTimestamp

func SignedTimestamp(private types.PrivateKey) ([]byte, error)

func VerifySignedTimestamp

func VerifySignedTimestamp(public types.PublicKey, payload []byte) bool

Types

type BufferedRWC

type BufferedRWC struct {
	io.ReadWriteCloser
	// contains filtered or unexported fields
}

func NewBufferedRWC

func NewBufferedRWC(c io.ReadWriteCloser) BufferedRWC

func NewBufferedRWCSize

func NewBufferedRWCSize(c io.ReadWriteCloser, n int) BufferedRWC

func (BufferedRWC) Discard

func (b BufferedRWC) Discard(n int) (int, error)

func (BufferedRWC) Flush

func (b BufferedRWC) Flush() error

func (BufferedRWC) Peek

func (b BufferedRWC) Peek(n int) ([]byte, error)

func (BufferedRWC) Read

func (b BufferedRWC) Read(p []byte) (int, error)

func (BufferedRWC) Write

func (b BufferedRWC) Write(p []byte) (int, error)

type Dispatch

type Dispatch chan struct{}

func NewDispatch

func NewDispatch() Dispatch

func (*Dispatch) Dispatch

func (d *Dispatch) Dispatch()

type Overlay

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

type WebSocketConn

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

func WrapWebSocketConn

func WrapWebSocketConn(c *websocket.Conn) *WebSocketConn

func (*WebSocketConn) Close

func (c *WebSocketConn) Close() error

func (*WebSocketConn) LocalAddr

func (c *WebSocketConn) LocalAddr() net.Addr

func (*WebSocketConn) Read

func (c *WebSocketConn) Read(p []byte) (int, error)

func (*WebSocketConn) RemoteAddr

func (c *WebSocketConn) RemoteAddr() net.Addr

func (*WebSocketConn) SetDeadline

func (c *WebSocketConn) SetDeadline(t time.Time) error

func (*WebSocketConn) SetReadDeadline

func (c *WebSocketConn) SetReadDeadline(t time.Time) error

func (*WebSocketConn) SetWriteDeadline

func (c *WebSocketConn) SetWriteDeadline(t time.Time) error

func (*WebSocketConn) Write

func (c *WebSocketConn) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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