Documentation ¶
Index ¶
- Constants
- func Addr() net.Addr
- func CiphertextLength(msgLen int) int
- func Decrypt(ciphertext []byte, sharedKey *[sessionKeyLen]byte) (msg []byte, err error)
- func Encrypt(msg []byte, sharedKey *[sessionKeyLen]byte) (ciphertext []byte, err error)
- func Log(level byte, format string, args ...interface{})
- func MsgLength(cipherLen int) int
- func RsaKeyFromPEM(filename string) (key *rsa.PrivateKey, err error)
- type ChanSet
- type Config
- type Conn
- type ConnRequest
- type ConnResponse
- type Contact
- type ContactList
- type ContactNotFoundError
- type DHT
- type DecryptError
- type FileConfig
- type HolePunchConf
- type Listener
- type Node
- type PeerChan
Constants ¶
View Source
const ( LOG_DEBUG = 4 LOG_INFO = 3 LOG_WARN = 2 LOG_ERROR = 1 )
Variables ¶
This section is empty.
Functions ¶
func CiphertextLength ¶
func RsaKeyFromPEM ¶
func RsaKeyFromPEM(filename string) (key *rsa.PrivateKey, err error)
Types ¶
type ChanSet ¶
type ChanSet struct {
// contains filtered or unexported fields
}
holy mother of god... no set type and no generics
type Conn ¶
type Conn struct { net.Conn // underlying network connection // contains filtered or unexported fields }
CONNECTION
func HandleClientConn ¶
func HandleServerConn ¶
func HandleServerConn(rawConn net.Conn, ownKey *rsa.PrivateKey, contacts *ContactList) (conn *Conn, err error)
type ConnRequest ¶
type ConnRequest struct {
// contains filtered or unexported fields
}
connection request
func (*ConnRequest) MarshalBinary ¶
func (r *ConnRequest) MarshalBinary() (data []byte, err error)
func (*ConnRequest) UnmarshalBinary ¶
func (r *ConnRequest) UnmarshalBinary(data []byte) (err error)
type ConnResponse ¶
type ConnResponse struct {
// contains filtered or unexported fields
}
type ContactList ¶
func NewContactList ¶
func NewContactList() *ContactList
func (*ContactList) AddContact ¶
func (contacts *ContactList) AddContact(contact *Contact) (err error)
func (*ContactList) GetContact ¶
func (contacts *ContactList) GetContact(key [sha256.Size]byte) *Contact
returns nil of not found
type ContactNotFoundError ¶
type ContactNotFoundError struct {
// contains filtered or unexported fields
}
func (ContactNotFoundError) Error ¶
func (e ContactNotFoundError) Error() string
type DHT ¶
DHT
an enhanced version of the DHT that allows per infohash subscriptions with notifications sent down channels
type DecryptError ¶
type DecryptError struct { }
func (DecryptError) Error ¶
func (e DecryptError) Error() string
type HolePunchConf ¶
type HolePunchConf struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.