sentinel

package
v1.2.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: GPL-2.0, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Identify

func Identify(b []byte) (match string, buf *text.Buffer, err error)

Identify takes a byte slice and scans it as a nostr Envelope array, and returns the label type and a text.Buffer that is ready for the Read function to generate the appropriate structure.

func Read

func Read(buf *text.Buffer, match string) (env enveloper.I, err error)

Read performs a second stage process after Identify that allocates a proper data structure for the Unmarshal function to populate with the remainder of the buffer.

This function exists because of the count and auth envelopes that have one label but two distinct structures - they are different by the role of the sender but need extra scanning to distinguish between them.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL