Documentation ¶
Index ¶
- Constants
- func GenRandomBytes(size int) (blk []byte, err error)
- func GetMandatoryFeatures(init *lnwire.Init) map[lnwire.FeatureBit]struct{}
- func ParseMsgType(bytes []byte) uint16
- func ToRawFeatureVector(features map[lnwire.FeatureBit]struct{}) *lnwire.RawFeatureVector
- type CommandoMsg
- type LN
- func (ln *LN) Clone() *LN
- func (ln *LN) CommandoReadAll(ctx context.Context, rune, serviceMethod, params string, timeout time.Duration) (string, error)
- func (ln *LN) Connect(endpoint string) error
- func (ln *LN) DeserializeKey(key string) error
- func (ln *LN) Disconnect()
- func (ln *LN) GenKey()
- func (ln *LN) Handshake() error
- func (ln *LN) NewCommandoReader(ctx context.Context, rune, serviceMethod, params string, timeout time.Duration) (io.Reader, error)
- func (ln *LN) Ping() error
- func (ln *LN) Read() (uint16, []byte, error)
- func (ln *LN) SerializeKey() string
- func (ln *LN) Write(b []byte) (int, error)
Constants ¶
View Source
const ( CommandoCmd = 0x4c4f CommandoReplyContinues = 0x594b CommandoReplyTerm = 0x594d )
Commando message types
Variables ¶
This section is empty.
Functions ¶
func GenRandomBytes ¶
GenRandomBytes gets random bytes
func GetMandatoryFeatures ¶
func GetMandatoryFeatures(init *lnwire.Init) map[lnwire.FeatureBit]struct{}
GetMandatoryFeatures gets mandatory features
func ToRawFeatureVector ¶
func ToRawFeatureVector(features map[lnwire.FeatureBit]struct{}) *lnwire.RawFeatureVector
ToRawFeatureVector gets a raw feature vector
Types ¶
type CommandoMsg ¶
CommandoMsg struct
func NewCommandoMsg ¶
func NewCommandoMsg(token string, method string, params string) CommandoMsg
NewCommandoMsg creates a new commando message
func (*CommandoMsg) Decode ¶
func (msg *CommandoMsg) Decode(reader io.Reader, size uint32) error
Decode API
type LN ¶
type LN struct { Conn net.Conn PrivKeyECDH *keychain.PrivKeyECDH Proxy *tor.ProxyNet Timeout time.Duration }
LN struct - heavily borrowed from https://github.com/jb55/lnsocket/blob/master/go/lnsocket.go
func (*LN) CommandoReadAll ¶
func (ln *LN) CommandoReadAll(ctx context.Context, rune, serviceMethod, params string, timeout time.Duration) (string, error)
CommandoReadAll reads complete commando response as string - used with internal lib
func (*LN) DeserializeKey ¶
DeserializeKey deserializes the private key from base64
func (*LN) NewCommandoReader ¶
func (ln *LN) NewCommandoReader(ctx context.Context, rune, serviceMethod, params string, timeout time.Duration) (io.Reader, error)
NewCommandoReader invokes a command and retruns a reader to read reply
func (*LN) SerializeKey ¶
SerializeKey serializes the private key to base64
Click to show internal directories.
Click to hide internal directories.