gotypes

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package gotypes is a playground package for demonstrating types that are used in the generated Go code.

Index

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

AppendNewStatement appends a new policy statement with the given key.

func (*RoutingPolicy_PolicyDefinition) AppendStatement

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

GetOrCreateStatementMap returns the ordered map field Statement from RoutingPolicy_PolicyDefinition.

It initializes the field if not already initialized.

func (*RoutingPolicy_PolicyDefinition) GetStatement

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

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

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

Delete deletes an element -- this is O(n) to keep the simple implementation.

func (*RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Get

Get returns the value corresponding to the key. If the key is not found, nil is returned.

func (*RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Keys

Keys returns a copy of the list's keys.

func (*RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Len

Len returns a size of RoutingPolicy_PolicyDefinition_Statement_OrderedMap

func (*RoutingPolicy_PolicyDefinition_Statement_OrderedMap) Values

Values returns the current set of the list's values in order.

Jump to

Keyboard shortcuts

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