testmodule

package
v0.0.0-...-71aae07 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BirdBrowser

func BirdBrowser(ypath source.Opener, json string) (*node.Browser, map[string]*Bird)

func BirdDevice

func BirdDevice(ypath source.Opener, json string) (*device.Local, map[string]*Bird)

func BirdModule

func BirdModule(ypath source.Opener) *meta.Module

func BirdNode

func BirdNode(birds map[string]*Bird) node.Node

func Manage

func Manage(c *Car) node.Node

carNode is root handler from car.yang

module car { ... }

Types

type Bird

type Bird struct {
	Name     string
	Wingspan int
	Species  *Species
}

type Car

type Car struct {
	Tire []*tire

	// Not everything has to be structs, using a map may be useful
	// in early prototyping
	Specs map[string]interface{}

	Miles   int64
	Running bool

	// When the tires were last rotated
	LastRotation int64

	// Default speed value is in yang model file and free's your code
	// from hardcoded values, even if they are only default values
	// units milliseconds/mile
	Speed int
	// contains filtered or unexported fields
}

//////////////////////// C A R Your application code.

Notice there are no reference to C2Stack in this file. This means your code remains: - unit test-able - Not auto-generated from model files - free of golang source code annotations/tags.

func New

func New() *Car

func (*Car) OnUpdate

func (c *Car) OnUpdate(l CarListener) nodeutil.Subscription

func (*Car) Start

func (c *Car) Start()

type CarListener

type CarListener func(c *Car)

type Species

type Species struct {
	Name  string
	Class string
}

Jump to

Keyboard shortcuts

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