options

package
v0.0.0-...-8f99d81 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package options provides convenience methods for reading node's options.

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL