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 ¶
- Variables
- func Schema() (*ytypes.Schema, error)
- func Unmarshal(data []byte, destStruct ygot.GoStruct, opts ...ytypes.UnmarshalOpt) error
- func UnzipSchema() (map[string]*yang.Entry, error)
- type Binary
- type Root
- type Topology
- func (t *Topology) DeleteLink(IpPrefix string)
- func (t *Topology) DeleteNode(Hostname string)
- func (t *Topology) GetLink(IpPrefix string) *Topology_Link
- func (t *Topology) GetNode(Hostname string) *Topology_Node
- func (t *Topology) GetOrCreateLink(IpPrefix string) *Topology_Link
- func (t *Topology) GetOrCreateNode(Hostname string) *Topology_Node
- func (*Topology) IsYANGGoStruct()
- func (t *Topology) NewLink(IpPrefix string) (*Topology_Link, error)
- func (t *Topology) NewNode(Hostname string) (*Topology_Node, error)
- func (t *Topology) Validate(opts ...ygot.ValidationOption) error
- func (t *Topology) ΛEnumTypeMap() map[string][]reflect.Type
- type Topology_Link
- type Topology_Node
- type YANGEmpty
Constants ¶
This section is empty.
Variables ¶
var (
SchemaTree map[string]*yang.Entry
)
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 Unmarshal ¶
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.
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 ¶
GetOrCreateTopology retrieves the value of the Topology field or returns the existing field if it already exists.
func (*Root) GetTopology ¶
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.
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 (*Topology) DeleteLink ¶
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 ¶
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 (*Topology) GetLink ¶
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 (*Topology) GetOrCreateLink ¶
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 (*Topology) NewLink ¶
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.
type Topology_Link ¶
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.