Documentation ¶
Index ¶
- Constants
- func Build(Vb []byte, tsxSize int) [][]byte
- func DecodeStringToBdn(sk, pk string) (kyber.Scalar, kyber.Point, error)
- func DecodeStringToBdnPK(pk string) (kyber.Point, error)
- func DecodeStringToBdnSK(sk string) (kyber.Scalar, error)
- func DialTCP(raddr *net.TCPAddr) (*net.TCPConn, error)
- func EncodeBdnToString(sk kyber.Scalar, pk kyber.Point) (string, string, error)
- func EncodeBdnToStringPk(pk kyber.Point) (string, error)
- func EncodeBdnToStringSk(sk kyber.Scalar) (string, error)
- func Frame(buf []byte) []byte
- func ListenTCP(laddr *net.TCPAddr) (*net.TCPListener, error)
- func MarshalUInt32(n uint32) []byte
- func MarshalUInt64(n uint64) []byte
- func ResolveTCPAddr(address string) (*net.TCPAddr, error)
- func UnmarshalUInt32(buf []byte) uint32
- func UnmarshalUInt64(buf []byte) uint64
- func WriteKeypairFile(f string, kp *KeyPairString) error
- type Addresses
- type Config
- type KeyPair
- type KeyPairString
- type Neighbour
- type Params
- type Settings
- type Signature
Constants ¶
View Source
const ( Network = "tcp4" // Type of network, choices are in net.DialTCP PortsPerCarrier = 3 // Used by the config generator to know how many ports to reserve for each carrier //LogTimeFormat = zerolog.TimeFormatUnixMs LogTimeFormat = time.RFC3339 )
Variables ¶
This section is empty.
Functions ¶
func DecodeStringToBdn ¶
func DecodeStringToBdnPK ¶
func DecodeStringToBdnSK ¶
func EncodeBdnToString ¶
func EncodeBdnToStringPk ¶
func EncodeBdnToStringSk ¶
func ListenTCP ¶
func ListenTCP(laddr *net.TCPAddr) (*net.TCPListener, error)
ListenTCP Simple wrawpper around net.ListenTCP
func MarshalUInt32 ¶
MarshalUInt32 returns a byte array of length 8 in little-endian encoding
func MarshalUInt64 ¶
MarshalUInt64 returns a byte array of length 8 in little-endian encoding
func ResolveTCPAddr ¶
ResolveTCPAddr Simple wrapper around net.ResolveTCPAddr
func UnmarshalUInt32 ¶
func UnmarshalUInt64 ¶
func WriteKeypairFile ¶
func WriteKeypairFile(f string, kp *KeyPairString) error
Types ¶
type Config ¶
type Config struct { ID string `json:"id"` Addresses Addresses `json:"addresses"` Keys KeyPairString `json:"keys"` Neighbours []Neighbour `json:"neighbours"` Settings Settings `json:"settings"` }
func LoadConfig ¶
type KeyPair ¶
type KeyPair struct { Name string Sk kyber.Scalar Pk kyber.Point }
func NewKeyPair ¶
func NewKeyPair(sk kyber.Scalar, pk kyber.Point) *KeyPair
func (*KeyPair) Convert ¶
func (kp *KeyPair) Convert() (*KeyPairString, error)
type KeyPairString ¶
func GenerateRandomKeypair ¶
func GenerateRandomKeypair() (*KeyPairString, error)
func ReadKeypairFile ¶
func ReadKeypairFile(f string) (*KeyPairString, error)
func (*KeyPairString) Convert ¶
func (kpstr *KeyPairString) Convert() (*KeyPair, error)
type Params ¶
type Params struct { Hosts []string `json:"hosts"` Fronts []string `json:"fronts"` Settings Settings `json:"settings"` }
func LoadParams ¶
type Settings ¶
type Settings struct { TsxSize int `json:"tsx-size"` Rate int `json:"rate"` Nodes int `json:"nodes"` DecisionPort int `json:"decision-port"` ClientPort int `json:"client-port"` CarrierPort int `json:"carrier-port"` InitThreshold int `json:"init-threshold"` ForwardMode int `json:"forward-mode"` LogLevel string `json:"log-level"` CarrierConnRetryDelay int `json:"carrier-conn-retry-delay"` CarrierConnMaxRetry int `json:"carrier-conn-max-retry"` NodeConnRetryDelay int `json:"node-conn-retry-delay"` NodeConnMaxRetry int `json:"node-conn-max-retry"` LocalBasePort int `json:"local-base-port"` LocalFrontPort int `json:"local-front-port"` }
func NewSettings ¶
func NewSettings() Settings
Click to show internal directories.
Click to hide internal directories.