Documentation ¶
Overview ¶
Package options provides convenience methods for reading node's options.
Index ¶
- type OptionReader
- func (o *OptionReader) GetOptionByID(node desc.Descriptor, tagID int) (interface{}, error)
- func (o *OptionReader) GetOptionByName(node desc.Descriptor, tagName string) (interface{}, error)
- func (o *OptionReader) ReadOptionByID(node desc.Descriptor, tagID int, out interface{}) error
- func (o *OptionReader) ReadOptionByName(node desc.Descriptor, tagName string, out interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OptionReader ¶
type OptionReader struct { Registry *dynamic.ExtensionRegistry // contains filtered or unexported fields }
OptionReader embeds an extension registry
func NewOptionReader ¶
func NewOptionReader(registry *dynamic.ExtensionRegistry) *OptionReader
NewOptionReader uses a default extension registry if the passed one is nil
func (*OptionReader) GetOptionByID ¶
func (o *OptionReader) GetOptionByID(node desc.Descriptor, tagID int) (interface{}, error)
GetOptionByID attempts to find an option on the node by tagID
func (*OptionReader) GetOptionByName ¶
func (o *OptionReader) GetOptionByName(node desc.Descriptor, tagName string) (interface{}, error)
GetOptionByName attempts to find an option on the node by tagName
func (*OptionReader) ReadOptionByID ¶
func (o *OptionReader) ReadOptionByID(node desc.Descriptor, tagID int, out interface{}) error
ReadOptionByID attempts to load the value into the "out" param if it is the correct type, if the found type and the out type do not agree an error is returned
func (*OptionReader) ReadOptionByName ¶
func (o *OptionReader) ReadOptionByName(node desc.Descriptor, tagName string, out interface{}) error
ReadOptionByName attempts to load the value into the "out" param if it is the correct type, if the found type and the out type do not agree an error is returned