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

# Functions

BulkDecodeEntry extract a JSON object from the binary.
BulkDecodeTemplate decodes the template.
Checkpoint all noteboxes and purge noteboxes that have been sitting unused for the autopurge interval.
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.
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.
HubSetNoteboxInit sets the global notebox function to update env vars.
HubSetReadFile sets the read file func.
HubSetSignal sets the web request function.
HubSetWebRequest sets the web request function.
Inf returns a Float16 with an infinity value with the specified sign.
Merge the contents of two Notes.
NaN returns a Float16 of IEEE 754 binary16 not-a-number (NaN).
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.
PrecisionFromfloat32 returns Precision without performing the conversion.
Printf is an externally-callable version of same, for server use so it doesn't get held up writing to console.
Purge checkpoints all noteboxes and force a purge of notefiles.
RegisterTLSSupport tells the discover module that we do support TLS.
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

BulkNoteFormatV1 is the first and only version.
ErrInvalidNaNValue indicates a NaN was not received.
HTTPUserAgent is the HTTP user agent for all our uses of HTTP.
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.
ReservedIDDelimiter is used to separate lists of noteIDs, notefileIDs, endpointIDs, thus is invalid in names.

# 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.
HubSessionContext are the fields that are coordinated between the client and the server for the duration of an open session.
HubSessionEvent is an event queue entry, containing everything necessary to process an event.
Notebox is the in-memory data structure for an open notebox.
NoteboxInstance is the in-memory data structure for an open notebox.
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.
TimeZoneNames is the struct for the table below.
Tracker is the structure maintained on a per-endpoint basis.

# 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.
NoteboxAccessFunc is the func to check an access assertion.
NoteboxInitFunc is the func to initialize the notebox at the start of a session.
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.