v1

package
v0.0.0-...-0eec777 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package v1 is a generated package which contains definitions of structs which represent a YANG schema. The generated schema can be compressed by a series of transformations (compression was true in this case).

This package was generated by /home/benm/go/src/github.com/benmaddison/topographly/vendor/github.com/openconfig/ygot/ygen/commongen.go using the following YANG input files:

  • yang/topology-v1.yang

Imported modules were sourced from:

  • yang/...

Index

Constants

This section is empty.

Variables

View Source
var (
	SchemaTree map[string]*yang.Entry
)
View Source
var ΛEnumTypes = map[string][]reflect.Type{}

ΛEnumTypes is a map, keyed by a YANG schema path, of the enumerated types that correspond with the leaf. The type is represented as a reflect.Type. The naming of the map ensures that there are no clashes with valid YANG identifiers.

Functions

func Schema

func Schema() (*ytypes.Schema, error)

Schema returns the details of the generated schema.

func Unmarshal

func Unmarshal(data []byte, destStruct ygot.GoStruct, opts ...ytypes.UnmarshalOpt) error

Unmarshal unmarshals data, which must be RFC7951 JSON format, into destStruct, which must be non-nil and the correct GoStruct type. It returns an error if the destStruct is not found in the schema or the data cannot be unmarshaled. The supplied options (opts) are used to control the behaviour of the unmarshal function - for example, determining whether errors are thrown for unknown fields in the input JSON.

func UnzipSchema

func UnzipSchema() (map[string]*yang.Entry, error)

UnzipSchema unzips the zipped schema and returns a map of yang.Entry nodes, keyed by the name of the struct that the yang.Entry describes the schema for.

Types

type Binary

type Binary []byte

Binary is a type that is used for fields that have a YANG type of binary. It is used such that binary fields can be distinguished from leaf-lists of uint8s (which are mapped to []uint8, equivalent to []byte in reflection).

type Root

type Root struct {
	Topology *Topology `path:"topology" module:"topology-v1"`
}

Root represents the /root YANG schema element.

func (*Root) GetOrCreateTopology

func (t *Root) GetOrCreateTopology() *Topology

GetOrCreateTopology retrieves the value of the Topology field or returns the existing field if it already exists.

func (*Root) GetTopology

func (t *Root) GetTopology() *Topology

GetTopology returns the value of the Topology struct pointer from Root. If the receiver or the field Topology is nil, nil is returned such that the Get* methods can be safely chained.

func (*Root) IsYANGGoStruct

func (*Root) IsYANGGoStruct()

IsYANGGoStruct ensures that Root implements the yang.GoStruct interface. This allows functions that need to handle this struct to identify it as being generated by ygen.

func (*Root) Validate

func (t *Root) Validate(opts ...ygot.ValidationOption) error

Validate validates s against the YANG schema corresponding to its type.

func (*Root) ΛEnumTypeMap

func (t *Root) ΛEnumTypeMap() map[string][]reflect.Type

ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types that are included in the generated code.

type Topology

type Topology struct {
	Link map[string]*Topology_Link `path:"links/link" module:"topology-v1"`
	Node map[string]*Topology_Node `path:"nodes/node" module:"topology-v1"`
}

Topology represents the /topology-v1/topology YANG schema element.

func (t *Topology) DeleteLink(IpPrefix string)

DeleteLink deletes the value with the specified keys from the receiver Topology. If there is no such element, the function is a no-op.

func (*Topology) DeleteNode

func (t *Topology) DeleteNode(Hostname string)

DeleteNode deletes the value with the specified keys from the receiver Topology. If there is no such element, the function is a no-op.

func (t *Topology) GetLink(IpPrefix string) *Topology_Link

GetLink retrieves the value with the specified key from the Link map field of Topology. If the receiver is nil, or the specified key is not present in the list, nil is returned such that Get* methods may be safely chained.

func (*Topology) GetNode

func (t *Topology) GetNode(Hostname string) *Topology_Node

GetNode retrieves the value with the specified key from the Node map field of Topology. If the receiver is nil, or the specified key is not present in the list, nil is returned such that Get* methods may be safely chained.

func (t *Topology) GetOrCreateLink(IpPrefix string) *Topology_Link

GetOrCreateLink retrieves the value with the specified keys from the receiver Topology. If the entry does not exist, then it is created. It returns the existing or new list member.

func (*Topology) GetOrCreateNode

func (t *Topology) GetOrCreateNode(Hostname string) *Topology_Node

GetOrCreateNode retrieves the value with the specified keys from the receiver Topology. If the entry does not exist, then it is created. It returns the existing or new list member.

func (*Topology) IsYANGGoStruct

func (*Topology) IsYANGGoStruct()

IsYANGGoStruct ensures that Topology implements the yang.GoStruct interface. This allows functions that need to handle this struct to identify it as being generated by ygen.

func (t *Topology) NewLink(IpPrefix string) (*Topology_Link, error)

NewLink creates a new entry in the Link list of the Topology struct. The keys of the list are populated from the input arguments.

func (*Topology) NewNode

func (t *Topology) NewNode(Hostname string) (*Topology_Node, error)

NewNode creates a new entry in the Node list of the Topology struct. The keys of the list are populated from the input arguments.

func (*Topology) Validate

func (t *Topology) Validate(opts ...ygot.ValidationOption) error

Validate validates s against the YANG schema corresponding to its type.

func (*Topology) ΛEnumTypeMap

func (t *Topology) ΛEnumTypeMap() map[string][]reflect.Type

ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types that are included in the generated code.

type Topology_Link struct {
	EndpointA *string `path:"config/endpoint-a" module:"topology-v1"`
	EndpointZ *string `path:"config/endpoint-z" module:"topology-v1"`
	IpPrefix  *string `path:"config/ip-prefix|ip-prefix" module:"topology-v1"`
}

Topology_Link represents the /topology-v1/topology/links/link YANG schema element.

func (*Topology_Link) IsYANGGoStruct

func (*Topology_Link) IsYANGGoStruct()

IsYANGGoStruct ensures that Topology_Link implements the yang.GoStruct interface. This allows functions that need to handle this struct to identify it as being generated by ygen.

func (*Topology_Link) Validate

func (t *Topology_Link) Validate(opts ...ygot.ValidationOption) error

Validate validates s against the YANG schema corresponding to its type.

func (*Topology_Link) ΛEnumTypeMap

func (t *Topology_Link) ΛEnumTypeMap() map[string][]reflect.Type

ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types that are included in the generated code.

func (*Topology_Link) ΛListKeyMap

func (t *Topology_Link) ΛListKeyMap() (map[string]interface{}, error)

ΛListKeyMap returns the keys of the Topology_Link struct, which is a YANG list entry.

type Topology_Node

type Topology_Node struct {
	Hostname *string `path:"config/hostname|hostname" module:"topology-v1"`
}

Topology_Node represents the /topology-v1/topology/nodes/node YANG schema element.

func (*Topology_Node) IsYANGGoStruct

func (*Topology_Node) IsYANGGoStruct()

IsYANGGoStruct ensures that Topology_Node implements the yang.GoStruct interface. This allows functions that need to handle this struct to identify it as being generated by ygen.

func (*Topology_Node) Validate

func (t *Topology_Node) Validate(opts ...ygot.ValidationOption) error

Validate validates s against the YANG schema corresponding to its type.

func (*Topology_Node) ΛEnumTypeMap

func (t *Topology_Node) ΛEnumTypeMap() map[string][]reflect.Type

ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types that are included in the generated code.

func (*Topology_Node) ΛListKeyMap

func (t *Topology_Node) ΛListKeyMap() (map[string]interface{}, error)

ΛListKeyMap returns the keys of the Topology_Node struct, which is a YANG list entry.

type YANGEmpty

type YANGEmpty bool

YANGEmpty is a type that is used for fields that have a YANG type of empty. It is used such that empty fields can be distinguished from boolean fields in the generated code.

Jump to

Keyboard shortcuts

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