package
1.7.2
Repository: https://github.com/blues/note.git
Documentation: pkg.go.dev

# Functions

BulkDecodeTemplate sets up a context for decoding by taking the template and a binary buffer to be decoded.
BulkEncodeTemplate sets up a context for encoding by taking the template and preparing a binary output buffer.
Checkpoint all noteboxes and purge noteboxes that have been sitting unused for the autopurge interval.
CheckpointNoteboxIfNeeded checkpoints a notebox if it's open.
CreateNotebox creates a notebox on this endpoint.
CreateNotefile instantiates and initializes a new Notefile, and prepares it so that notes may be added on behalf of the specified endpoint.
DebugSet sets the debug variable.
Delete deletes a closed Notebox, and releases its storage.
ErrorContains tests to see if an error contains an error keyword that we might expect.
ErrorResponse creates a simple JSON response given an error.
ErrorString safely returns a string from any error, returning "" for nil.
FileCleanName generates a clean filename with correct extension from a filename input.
FileDefaultStorageObject gives a deterministic storage object name from two components.
FileSetHandler sets an alternate file I/O package.
FileSetStorageLocation sets the root location for storage.
FileStorageObject gives a deterministic storage object name from two components.
Frombits returns the float16 number corresponding to the IEEE 754 binary16 representation u16, with the sign bit of u16 and the result in the same bit position.
Fromfloat32 returns a Float16 value converted from f32.
FromNaN32ps converts nan to IEEE binary16 NaN while preserving both signaling and payload.
GetNotecardSecureElementRootCertificateAsPEM is the ST Microelectronics root certificate used to generate the certificate embedded in every Notecard's STSAFE-A100 secure element at point of chip manufacture.
Make a checkpoint request.
HubDiscover ensures that we've read the local server's discover info, and return the Hub's Endpoint ID.
HubErrorResponse creates an error response message to be sent to the client device, and terminates the session so that no further requests can be processed.
HubRequest creates a request message from a map of arguments, given an optional context parameter for fields that are shared across requests that happen within a single session.
HubSetAccessControl sets the global notebox function to check access assertions.
HubSetDeviceNotifications sets the hub notification.
HubSetDiscover sets the global discovery function.
HubSetReadFile sets the read file func.
HubSetSignal sets the web request function.
HubSetUpdateEnvironment sets the global notebox function to update env vars.
HubSetWebRequest sets the web request function.
Inf returns a Float16 with an infinity value with the specified sign.
No description provided by the author
Merge the contents of two Notes.
NaN returns a Float16 of IEEE 754 binary16 not-a-number (NaN).
No description provided by the author
NoteboxNotefileInfoByPort gets info about all notefiles in a notebox.
NotefileAttributesFromID extracts attributes implied by the notefileID.
NotefileIDIsReserved returns true if the notefileID is reserved.
NotefileIDIsReservedWithExceptions returns true if the notefileID is reserved.
OLCFromINT64 converts a 64-bit OLC code into a string.
OLCToINT64 converts an OLC string into a 64-bit code.
OpenEndpointNotebox opens - creating if necessary - a notebox in File storage for an endpoint.
OpenNotebox opens a local notebox into memory.
packetHeaderFromWire extracts the connection ID from the wire format.
PrecisionFromfloat32 returns Precision without performing the conversion.
Purge checkpoints all noteboxes and force a purge of notefiles.
SetTLSSupport tells the discover module that we do support TLS.
No description provided by the author
TimeZoneNameToNumber converts a timezone number to a name.
TimeZoneNumberToCountry retrieves the country from the name.
TimeZoneNumberToName converts a timezone name to a number.
TLSSupport tells the discover module that we do support TLS.
WireBarsFromSession extracts device's perception of the number of bars of signal from a session.
WireExtractSessionContext extracts session context from the wire message.
WireReadRequest reads a message from the specified reader.

# Constants

Different 'where', 'string', and 'payload' handling.
Same as Flex but omits Where/When.
Original format.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Zero bytes.
CidRandomLen bytes.
No description provided by the author
ErrInvalidNaNValue indicates a NaN was not received.
HTTPUserAgent is the HTTP user agent for all our uses of HTTP.
Define an invalid time so that we force a history to be added with a 0 time.
No description provided by the author
No description provided by the author
Message ports for packet handling.
No description provided by the author
Enum of <port><datalen><data>.
Same but with a guaranteed response formatted the same way.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Packet type is split - a nibble of flags and a nibble of Connection ID type.
PrecisionExact is for non-subnormals that don't drop bits during conversion.
PrecisionInexact is for dropped significand bits and cannot round-trip.
PrecisionOverflow is for Overflows.
PrecisionUnderflow is for Underflows.
PrecisionUnknown is for subnormals that don't drop bits during conversion but not all of these can round-trip so precision is unknown without more effort.
After trying AES GCM and struggling with block size and tag size constraints, and after then consulting with the folks at WolfSSL, we arrived at using the ChaCha20 stream cipher (thus eliminating block constraints) along with the Poly1305 MAC for integrity and authentication.
No description provided by the author
ReservedIDDelimiter is used to separate lists of noteIDs, notefileIDs, endpointIDs, thus is invalid in names.
No description provided by the author
No description provided by the author
Minimum internet datagram is 576, IPv4 header is 20, UDP header is 8.
Below this, we really wouldn't have enough room for any user data to speak of.
No description provided by the author
Supported packet service types.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
ErrCorrupt reports that the input is invalid.
No description provided by the author
Codebook for smaz compatibility.
Codebook optimized for JSON templates.

# Structs

BulkBody is the bulk data note body.
BulkTemplateContext is the context for the bulk template.
DiscoverInfo is the information returned by DiscoverFunc.
Fileio defines a set of functions for alternative file I/O.
No description provided by the author
A Node represents a logical vertex in the trie structure.
Notebox is the in-memory data structure for an open notebox.
NoteboxInstance is the in-memory data structure for an open notebox.
Information about files and templates.
Notefile is The outermost data structure of a Notefile JSON object, containing a set of notes that may be synchronized.
No description provided by the author
OpenNotefile is the in-memory data structure for an open notefile.
Decoded packet.
Packet handler information.
No description provided by the author
No description provided by the author
No description provided by the author
TimeZoneNames is the struct for the table below.
Tracker is the structure maintained on a per-endpoint basis.
A Trie is a a prefix tree.

# Type aliases

DiscoverFunc is the func to retrieve discovery info for this server.
EventFunc is the func to get called whenever there is a note add/update/delete.
FileioCreateFunc creates a file.
FileioDeleteFunc deletes a file.
FileioExistsFunc checks for file existence.
FileioReadJSONFunc reads a JSON file.
FileioWriteJSONFunc writes a JSON file.
Float16 represents IEEE 754 half-precision floating-point numbers (binary16).
GetNotificationFunc retrieves hub notifications to be sent to client.
No description provided by the author
NoteboxAccessFunc is the func to check an access assertion.
NoteboxUpdateEnvFunc is the func to update environment variables for a device.
Precision indicates whether the conversion to Float16 is exact, subnormal without dropped bits, inexact, underflow, or overflow.
ReadFileFunc is the func to read a byte range from the named file.
SignalFunc performs a web request on behalf of a device.
WebRequestFunc performs a web request on behalf of a device.