Documentation ¶
Overview ¶
Package splice is a collection of tools for encoding and decoding variables into byte buffers with a fluent chained method interface.
Index ¶
- Constants
- type NameOffset
- type Segments
- type Splice
- func (s *Splice) AddrPort(a *netip.AddrPort) *Splice
- func (s *Splice) Advance(n int, name string) int
- func (s *Splice) Byte(b byte) *Splice
- func (s *Splice) Bytes(b []byte) *Splice
- func (s *Splice) Check(c slice.Bytes) *Splice
- func (s *Splice) Ciphers(h crypto.Ciphers) *Splice
- func (s *Splice) Cloak(pk *crypto.Pub) *Splice
- func (s *Splice) CopyIntoRange(b slice.Bytes, start, end int)
- func (s *Splice) CopyRanges(start1, end1, start2, end2 int)
- func (s *Splice) Done()
- func (s *Splice) Duration(v time.Duration) *Splice
- func (s *Splice) GetAll() slice.Bytes
- func (s *Splice) GetCursor() int
- func (s *Splice) GetFrom(p int) slice.Bytes
- func (s *Splice) GetRange(start, end int) slice.Bytes
- func (s *Splice) GetRest() slice.Bytes
- func (s *Splice) GetSegments() (segments Segments)
- func (s *Splice) GetSlicesFromSegments() (segments []interface{})
- func (s *Splice) GetUntil(p int) slice.Bytes
- func (s *Splice) Hash(h sha256.Hash) *Splice
- func (s *Splice) ID(id nonce.ID) *Splice
- func (s *Splice) IV(iv nonce.IV) *Splice
- func (s *Splice) Len() int
- func (s *Splice) Magic(magic string) *Splice
- func (s *Splice) Nonces(iv crypto.Nonces) *Splice
- func (s *Splice) Prvkey(from *crypto.Prv) *Splice
- func (s *Splice) Pubkey(from *crypto.Pub) *Splice
- func (s *Splice) ReadAddrPort(ap **netip.AddrPort) *Splice
- func (s *Splice) ReadByte(b *byte) *Splice
- func (s *Splice) ReadBytes(b *slice.Bytes) *Splice
- func (s *Splice) ReadCheck(c *slice.Bytes) *Splice
- func (s *Splice) ReadCiphers(h *crypto.Ciphers) *Splice
- func (s *Splice) ReadCloak(ck *crypto.CloakedPubKey) *Splice
- func (s *Splice) ReadDuration(v *time.Duration) *Splice
- func (s *Splice) ReadHash(h *sha256.Hash) *Splice
- func (s *Splice) ReadID(id *nonce.ID) *Splice
- func (s *Splice) ReadIV(iv *nonce.IV) *Splice
- func (s *Splice) ReadMagic(magic *string) *Splice
- func (s *Splice) ReadMilliSatoshi(v *lnwire.MilliSatoshi) *Splice
- func (s *Splice) ReadNonces(iv *crypto.Nonces) *Splice
- func (s *Splice) ReadPrvkey(out **crypto.Prv) *Splice
- func (s *Splice) ReadPubkey(from **crypto.Pub) *Splice
- func (s *Splice) ReadSignature(sb *crypto.SigBytes) *Splice
- func (s *Splice) ReadTime(v *time.Time) *Splice
- func (s *Splice) ReadUint16(v *uint16) *Splice
- func (s *Splice) ReadUint32(v *uint32) *Splice
- func (s *Splice) ReadUint64(v *uint64) *Splice
- func (s *Splice) Remaining() int
- func (s *Splice) Rewind(n int) int
- func (s *Splice) SetCursor(c int) *Splice
- func (s *Splice) Signature(sb crypto.SigBytes) *Splice
- func (s *Splice) StoreCursor(c *int) *Splice
- func (s *Splice) Time(v time.Time) *Splice
- func (s *Splice) TrailingBytes(b slice.Bytes) *Splice
- func (s *Splice) Uint16(v uint16) *Splice
- func (s *Splice) Uint32(v uint32) *Splice
- func (s *Splice) Uint64(v uint64) *Splice
Constants ¶
View Source
const AddrLen = net.IPv6len + 2
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Segments ¶
type Segments []NameOffset
type Splice ¶
func (*Splice) CopyRanges ¶
func (*Splice) GetRange ¶
GetRange slices out a segment of the splicer's data bytes and returns it. Use -1 to indicate start or beginning respectively, or both to get all of it.
func (*Splice) GetSegments ¶
func (*Splice) GetSlicesFromSegments ¶
func (s *Splice) GetSlicesFromSegments() (segments []interface{})
func (*Splice) ReadMilliSatoshi ¶
func (s *Splice) ReadMilliSatoshi(v *lnwire.MilliSatoshi) *Splice
func (*Splice) ReadUint16 ¶
func (*Splice) ReadUint32 ¶
func (*Splice) ReadUint64 ¶
func (*Splice) StoreCursor ¶
Click to show internal directories.
Click to hide internal directories.