Documentation
¶
Overview ¶
Package subtypes provides helpers to work with boundary resource subtypes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry stores a collection of boundary resource subtypes along with their prefixes and allows for translating prefixes back to registered subtypes. Registry is not thread safe.
func NewRegistry ¶
func NewRegistry() *Registry
New Registry creates a new boundary resource subtype registry.
func (*Registry) Register ¶
Register registers all the prefixes for a provided Subtype. Register returns an error if the subtype has already been registered or if any of the prefixes are associated with another subtype.
func (*Registry) SubtypeFromId ¶
SubtypeFromId returns the Subtype from the provided id if the id's prefix was registered with a Subtype. Otherwise Unknown is returned.
func (*Registry) SubtypeFromType ¶
SubtypeFromType returns the Subtype from the provided string or if no Subtype was registered with that string Unknown is returned.