Documentation
¶
Overview ¶
Package gotypes is a playground package for demonstrating types that are used in the generated Go code.
Index ¶
- type RoutingPolicy_PolicyDefinition
- func (s *RoutingPolicy_PolicyDefinition) AppendNewStatement(key string) (*RoutingPolicy_PolicyDefinition_Statement, error)
- func (s *RoutingPolicy_PolicyDefinition) AppendStatement(statement *RoutingPolicy_PolicyDefinition_Statement) error
- func (s *RoutingPolicy_PolicyDefinition) DeleteStatement(key string) bool
- func (s *RoutingPolicy_PolicyDefinition) GetOrCreateStatementMap() *RoutingPolicy_PolicyDefinition_Statement_OrderedMap
- func (s *RoutingPolicy_PolicyDefinition) GetStatement(key string) *RoutingPolicy_PolicyDefinition_Statement
- type RoutingPolicy_PolicyDefinition_Statement
- type RoutingPolicy_PolicyDefinition_Statement_OrderedMap
- func (o *RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Append(statement *RoutingPolicy_PolicyDefinition_Statement) error
- func (o *RoutingPolicy_PolicyDefinition_Statement_OrderedMap) AppendNew(key string) (*RoutingPolicy_PolicyDefinition_Statement, error)
- func (o *RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Delete(key string) bool
- func (o *RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Get(key string) *RoutingPolicy_PolicyDefinition_Statement
- func (o *RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Keys() []string
- func (o *RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Len() int
- func (o *RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Values() []*RoutingPolicy_PolicyDefinition_Statement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RoutingPolicy_PolicyDefinition ¶
type RoutingPolicy_PolicyDefinition struct {
// Statement is an ordered map of policy statements.
//
// Note that the design here is to not use a pointer so that the empty
// value is usable. This is unlike the regular unordered lists where
// the various helpers need to reside on the parent struct in order to
// avoid a nil pointer exception on the raw map type.
Statement *RoutingPolicy_PolicyDefinition_Statement_OrderedMap
}
RoutingPolicy_PolicyDefinition is the parent for the policy statement, used a demonstration of an ordered map (for an `ordered-by user` YANG list).
func (*RoutingPolicy_PolicyDefinition) AppendNewStatement ¶
func (s *RoutingPolicy_PolicyDefinition) AppendNewStatement(key string) (*RoutingPolicy_PolicyDefinition_Statement, error)
AppendNewStatement appends a new policy statement with the given key.
func (*RoutingPolicy_PolicyDefinition) AppendStatement ¶
func (s *RoutingPolicy_PolicyDefinition) AppendStatement(statement *RoutingPolicy_PolicyDefinition_Statement) error
AppendStatement appends the given statement, extracting the key from the value.
func (*RoutingPolicy_PolicyDefinition) DeleteStatement ¶
func (s *RoutingPolicy_PolicyDefinition) DeleteStatement(key string) bool
DeleteStatement deletes the statement with the given key.
func (*RoutingPolicy_PolicyDefinition) GetOrCreateStatementMap ¶ added in v0.29.19
func (s *RoutingPolicy_PolicyDefinition) GetOrCreateStatementMap() *RoutingPolicy_PolicyDefinition_Statement_OrderedMap
GetOrCreateStatementMap returns the ordered map field Statement from RoutingPolicy_PolicyDefinition.
It initializes the field if not already initialized.
func (*RoutingPolicy_PolicyDefinition) GetStatement ¶
func (s *RoutingPolicy_PolicyDefinition) GetStatement(key string) *RoutingPolicy_PolicyDefinition_Statement
GetStatement gets the statement with the given key.
type RoutingPolicy_PolicyDefinition_Statement ¶
type RoutingPolicy_PolicyDefinition_Statement struct {
// DummyActions are dummy BGP policy actions intended to represent that
// ordered maps can have values alongside keys.
DummyActions []string
Name *string
}
RoutingPolicy_PolicyDefinition_Statement represents an ordered-map element.
type RoutingPolicy_PolicyDefinition_Statement_OrderedMap ¶
type RoutingPolicy_PolicyDefinition_Statement_OrderedMap struct {
// contains filtered or unexported fields
}
RoutingPolicy_PolicyDefinition_Statement_OrderedMap is a candidate ordered-map implementation.
func (*RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Append ¶
func (o *RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Append(statement *RoutingPolicy_PolicyDefinition_Statement) error
Append appends a policy statement, returning an error if the statement already exists or if the key is unspecified.
func (*RoutingPolicy_PolicyDefinition_Statement_OrderedMap) AppendNew ¶
func (o *RoutingPolicy_PolicyDefinition_Statement_OrderedMap) AppendNew(key string) (*RoutingPolicy_PolicyDefinition_Statement, error)
AppendNew creates and appends a new policy statement, returning the newly-initialized statement. It returns an error if the statement already exists.
func (*RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Delete ¶
func (o *RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Delete(key string) bool
Delete deletes an element -- this is O(n) to keep the simple implementation.
func (*RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Get ¶
func (o *RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Get(key string) *RoutingPolicy_PolicyDefinition_Statement
Get returns the value corresponding to the key. If the key is not found, nil is returned.
func (*RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Keys ¶
func (o *RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Keys() []string
Keys returns a copy of the list's keys.
func (*RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Len ¶
func (o *RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Len() int
Len returns a size of RoutingPolicy_PolicyDefinition_Statement_OrderedMap
func (*RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Values ¶
func (o *RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Values() []*RoutingPolicy_PolicyDefinition_Statement
Values returns the current set of the list's values in order.