Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrDisallowsTrailingSlash = fmt.Errorf("a command must not include a trailing slash")
ErrDisallowsTrailingSlash is returned when parsing a string that ends with a trailing slash character.
var ErrRequiresLeadingSlash = fmt.Errorf("a command requires a leading slash character")
ErrRequiresLeadingSlash is returned when a parsing a string that doesn't start with a leading slash character.
var ErrRequiresLowercase = fmt.Errorf("UCAN path segments must must not contain upper-case characters")
ErrRequiresLowercase is returned if a Command contains, or would contain, uppercase unicode characters.
Functions ¶
Types ¶
type Command ¶
type Command string
Command is a concrete messages (a "verb") that MUST be unambiguously interpretable by the Subject of a UCAN.
A Command is composed of a leading slash which is optionally followed by one or more slash-separated Segments of lowercase characters.
func New ¶
New creates a validated command from the provided list of segment strings. An error is returned if an invalid Command would be formed
func Parse ¶
Parse verifies that the provided string contains the required segment structure and, if valid, returns the resulting Command.
func Top ¶
func Top() Command
Top is the most powerful capability.
This function returns a Command that is a wildcard and therefore represents the most powerful ability. As such, it should be handled with care and used sparingly.
func (Command) Covers ¶
Covers returns true if the command is identical or a parent of the given other command.
func (Command) Join ¶
Join appends segments to the end of this command using the required segment separator.