device

package
v0.0.0-...-54f1ae0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 13 Imported by: 18

Documentation

Index

Constants

View Source
const (
	ConformanceTypeImplement = "implement"
	ConformanceTypeImport    = "import"
)

Variables

This section is empty.

Functions

func LoadModules

func LoadModules(ietfYangLib *node.Browser, resolver ResolveModule) (map[string]*meta.Module, error)

func LocalDeviceYangLibNode

func LocalDeviceYangLibNode(addresser ModuleAddresser, d Device) node.Node

func YangLibModuleList

func YangLibModuleList(addresser ModuleAddresser, mods map[string]*meta.Module) node.Node

func YangLibModuleSetList

func YangLibModuleSetList(addresser ModuleAddresser, modsets map[string]*moduleSet) node.Node

func YangLibModuleSetModuleList

func YangLibModuleSetModuleList(addresser ModuleAddresser, mods map[string]*meta.Module) node.Node

Types

type DeviationHnd

type DeviationHnd struct {
	Name     string
	Revision string
}

type Device

type Device interface {
	SchemaSource() source.Opener
	UiSource() source.Opener
	Browser(module string) (*node.Browser, error)
	Modules() map[string]*meta.Module
	Close()
}

type Local

type Local struct {
	// contains filtered or unexported fields
}

func New

func New(schemaSource source.Opener) *Local

func NewWithUi

func NewWithUi(schemaSource source.Opener, uiSource source.Opener) *Local

func (*Local) Add

func (self *Local) Add(module string, n node.Node) error

func (*Local) AddBrowser

func (self *Local) AddBrowser(b *node.Browser)

func (*Local) AddSource

func (self *Local) AddSource(module string, src func() node.Node) error

func (*Local) ApplyStartupConfig

func (self *Local) ApplyStartupConfig(config io.Reader) error

func (*Local) ApplyStartupConfigData

func (self *Local) ApplyStartupConfigData(config map[string]interface{}) error

func (*Local) ApplyStartupConfigFile

func (self *Local) ApplyStartupConfigFile(fname string) error

func (*Local) Browser

func (self *Local) Browser(module string) (*node.Browser, error)

func (*Local) Close

func (self *Local) Close()

func (*Local) Modules

func (self *Local) Modules() map[string]*meta.Module

func (*Local) SchemaSource

func (self *Local) SchemaSource() source.Opener

func (*Local) UiSource

func (self *Local) UiSource() source.Opener

type Map

type Map interface {
	Device(deviceId string) (Device, error)
}

Map is used my server to host multiple devices in a single web server at restconf=[device]/...

type ModuleAddresser

type ModuleAddresser func(m *meta.Module) string

Export device by it's address so protocol server can serve a device often referred to northbound

type ModuleHnd

type ModuleHnd struct {
	Name            string
	Schema          string
	Revision        string
	Namespace       string
	Feature         []string
	ConformanceType string
	Deviation       []*DeviationHnd
}

type ProtocolHandler

type ProtocolHandler func(addr string) (Device, error)

Create device from address string associated with protocol often referred to south/east/west bound

type ResolveModule

type ResolveModule interface {
	ResolveModuleHnd(hnd ModuleHnd) (*meta.Module, error)
}

Jump to

Keyboard shortcuts

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