Documentation ¶
Overview ¶
Package valid does validation of various data types. For the most part, its functions are used by servers and enforce stronger constraints than client code needs to follow.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirBlock ¶
DirBlock verifies that the block is valid, that is, that it has a greater-than-zero Size, non-negative Offset, and valid Location.
func DirEntry ¶
DirEntry verifies that the DirEntry is valid. It is intended for use by DirServer.Put, and so constrains the entry more rigorously than, for instance, the DirEntries that may be returned from servers. For example, it requires that a directory has no blocks, but a DirEntry for a directory returned by a server may contain block data. Rules: - present and valid Name and SignedName - Name is equal to SignedName - blocks may be present only if Attr == AttrNone - Link may be present only if Attr == AttrLink - Attr must not include AttrIncomplete - Packing must be known - Sequence must have a known special value or be non-negative - for non-directory entries, a Writer field is required.
func Endpoint ¶
Endpoint verifies that the endpoint looks syntactically valid. It does not check that the endpoint defines a reachable server.
func Reference ¶
Reference verifies that the Reference is valid. A Reference must be a non-empty UTF-8-encoded string of printable characters, as defined by Unicode. Also, although printable, the replacement rune (U+FFFD) is considered invalid, even if it is explicitly present, as it usually indicates erroneous UTF-8 or Unicode.
Types ¶
This section is empty.