Documentation
¶
Index ¶
- Constants
- Variables
- func Boole2Byte(b bool) (ret byte)
- func Byte2Boole(b byte) (ret bool)
- func ClientDomainIsValid(domain string) (ok bool)
- func FindPeer(ctx context.Context, pid peer.ID) (pAddrInfo peer.AddrInfo, err error)
- func G_pubSub() (p *pubSub)
- func GenerateAndSaveKeypair(filename string) (err error)
- func GetDomainNames() (names []string)
- func GoodPrivKeyLen(pk ed25519.PrivateKey) (ok bool)
- func GoodPubKeyLen(pk ed25519.PublicKey) (ok bool)
- func Hash(b ...[]byte) (h []byte)
- func Home_Dir() (hd string, err error)
- func PubSubGetTopics() (ls []string)
- func PubSubTopicHashed(str string) (r string)
- func Publish(topic string, data []byte) (err error)
- func SESH_Config_Path() (cp string, err error)
- func SESH_Path() (sp string, err error)
- func SaveConfig(conf interface{}) (err error)
- func ServeDomain(domainName string)
- func SetStreamHandler()
- func Sign(pk *ed25519.PrivateKey, message []byte) (sig []byte, err error)
- func StartHandshake(domainName string) chan *ConnBundle
- func StartStream(ctx context.Context, pid peer.ID) (s network.Stream, err error)
- func StreamHandler(s network.Stream)
- func Subscribe(topic, alertName string) (err error)
- func VerifySig(pk *ed25519.PublicKey, message, sig []byte) (ok bool)
- type Client
- type Config
- type Conn
- func (c Conn) Close() (err error)
- func (c *Conn) LocalAddr() (addr net.Addr)
- func (c *Conn) Read(b []byte) (int, error)
- func (c Conn) RemoteAddr() (addr net.Addr)
- func (c Conn) SetDeadline(t time.Time) (err error)
- func (c Conn) SetReadDeadline(t time.Time) (err error)
- func (c Conn) SetWriteDeadline(t time.Time) (err error)
- func (c *Conn) Write(b []byte) (int, error)
- type ConnBundle
- type DomName
- type DomNameMgr
- type DomainNKeyfile
- type Handshake
- type HandshakeMgr
- type HandshakePacket
- type IpfsNode
- type SESH_FILETYPE
- type SSHMgr
- func (s *SSHMgr) DumpPubKeys(domainName string) (pks []*ed25519.PublicKey)
- func (s *SSHMgr) ImportPrivKey(domainName string, priv ed25519.PrivateKey) (err error)
- func (s *SSHMgr) ImportPubKey(domainName string, pub ed25519.PublicKey) (err error)
- func (s *SSHMgr) IsAuthorized(pk *ed25519.PublicKey) (tf bool)
- type Server
- type StreamStatus
Constants ¶
View Source
const DomNameMgrInitTimeout = 3 * time.Second // TODO tune
View Source
const G_MaxNetworkTimeout = 4 * time.Second // TODO PUT IN CONSTS
View Source
const ModInitTimeout = 3 * time.Second // TODO tune
Variables ¶
View Source
var G_ConfigMgr = newConfigMgr() // TODO use mod_init
View Source
var G_HandshakeMgr = newHandshakeMgr() // TODO USE MODINIT
View Source
var G_ValidClientDomains LocklessMap
Functions ¶
func Boole2Byte ¶
func Byte2Boole ¶
func ClientDomainIsValid ¶
func GenerateAndSaveKeypair ¶
func GetDomainNames ¶
func GetDomainNames() (names []string)
func GoodPrivKeyLen ¶
func GoodPrivKeyLen(pk ed25519.PrivateKey) (ok bool)
func GoodPubKeyLen ¶
func PubSubGetTopics ¶
func PubSubGetTopics() (ls []string)
func PubSubTopicHashed ¶
func SESH_Config_Path ¶
func SaveConfig ¶
func SaveConfig(conf interface{}) (err error)
func ServeDomain ¶
func ServeDomain(domainName string)
func SetStreamHandler ¶
func SetStreamHandler()
func StartHandshake ¶
func StartHandshake(domainName string) chan *ConnBundle
func StartStream ¶
func StreamHandler ¶
Types ¶
type Client ¶
type Client struct {
Domains []*DomainNKeyfile `json:"domains"`
}
type ConnBundle ¶
type DomNameMgr ¶
type DomNameMgr struct {
// contains filtered or unexported fields
}
func G_DomNameMgr ¶
func G_DomNameMgr() (m *DomNameMgr)
type DomainNKeyfile ¶
type HandshakeMgr ¶
type HandshakeMgr struct { DomainName2Handshake LocklessMap // map[string]*Handshake Nonce2Handshake LocklessMap // map[string]*Handshake }
func (*HandshakeMgr) SendStop ¶
func (m *HandshakeMgr) SendStop(domainName string)
func (*HandshakeMgr) Stop ¶
func (m *HandshakeMgr) Stop(domainName string) <-chan bool
type HandshakePacket ¶
type HandshakePacket struct { DomainName string Nonce []byte Hash []byte Challenge []byte Signature []byte PubKey *ed25519.PublicKey }
func Slice2HandshakePacket ¶
func Slice2HandshakePacket(b []byte) (hp *HandshakePacket, err error)
func (*HandshakePacket) Bytes ¶
func (hp *HandshakePacket) Bytes() (b []byte)
type SSHMgr ¶
type SSHMgr struct { Domains *domains Authorized *authorized PubKey2PrivKey LocklessMap }
func (*SSHMgr) DumpPubKeys ¶
func (*SSHMgr) ImportPrivKey ¶
func (s *SSHMgr) ImportPrivKey( domainName string, priv ed25519.PrivateKey) (err error)
func (*SSHMgr) ImportPubKey ¶
type Server ¶
type Server struct {
Authorized []*DomainNKeyfile `json:"authorized"`
}
type StreamStatus ¶
type StreamStatus byte
const ( HandshakeInitChallenge StreamStatus = iota HandshakeResponse HandshakeResult Shell Error )
func (StreamStatus) Byte ¶
func (ss StreamStatus) Byte() (b byte)
Click to show internal directories.
Click to hide internal directories.