Documentation
¶
Index ¶
- Constants
- func ReleaseStateResourceManager()
- type AutoVLANCfgResource
- func (r *AutoVLANCfgResource) Allocate(reqVal interface{}) (interface{}, error)
- func (r *AutoVLANCfgResource) Clear() error
- func (r *AutoVLANCfgResource) Deallocate(value interface{}) error
- func (r *AutoVLANCfgResource) Deinit()
- func (r *AutoVLANCfgResource) Description() string
- func (r *AutoVLANCfgResource) GetList() (uint, string)
- func (r *AutoVLANCfgResource) Init(rsrcCfg interface{}) error
- func (r *AutoVLANCfgResource) Read(id string) error
- func (r *AutoVLANCfgResource) ReadAll() ([]core.State, error)
- func (r *AutoVLANCfgResource) Reinit(rsrcCfg interface{}) error
- func (r *AutoVLANCfgResource) Write() error
- type AutoVLANOperResource
- type AutoVXLANCfgResource
- func (r *AutoVXLANCfgResource) Allocate(reqVal interface{}) (interface{}, error)
- func (r *AutoVXLANCfgResource) Clear() error
- func (r *AutoVXLANCfgResource) Deallocate(value interface{}) error
- func (r *AutoVXLANCfgResource) Deinit()
- func (r *AutoVXLANCfgResource) Description() string
- func (r *AutoVXLANCfgResource) GetList() (uint, string)
- func (r *AutoVXLANCfgResource) Init(rsrcCfg interface{}) error
- func (r *AutoVXLANCfgResource) Read(id string) error
- func (r *AutoVXLANCfgResource) ReadAll() ([]core.State, error)
- func (r *AutoVXLANCfgResource) Reinit(rsrcCfg interface{}) error
- func (r *AutoVXLANCfgResource) Write() error
- type AutoVXLANOperResource
- type StateResourceManager
- func (rm *StateResourceManager) AllocateResourceVal(id, desc string, reqValue interface{}) (interface{}, error)
- func (rm *StateResourceManager) DeallocateResourceVal(id, desc string, value interface{}) error
- func (rm *StateResourceManager) DefineResource(id, desc string, rsrcCfg interface{}) error
- func (rm *StateResourceManager) Deinit()
- func (rm *StateResourceManager) GetResourceList(id, desc string) (uint, string)
- func (rm *StateResourceManager) Init() error
- func (rm *StateResourceManager) RedefineResource(id, desc string, rsrcCfg interface{}) error
- func (rm *StateResourceManager) UndefineResource(id, desc string) error
- type VXLANVLANPair
Constants ¶
const (
// AutoVLANResource is the name of the resource, for storing state.
AutoVLANResource = "auto-vlan"
)
const (
// AutoVXLANResource is a string description of the type of resource.
AutoVXLANResource = "auto-vxlan"
)
Variables ¶
This section is empty.
Functions ¶
func ReleaseStateResourceManager ¶
func ReleaseStateResourceManager()
ReleaseStateResourceManager releases the singleton instance of the state based resource manager
Types ¶
type AutoVLANCfgResource ¶
type AutoVLANCfgResource struct { core.CommonState VLANs *bitset.BitSet `json:"vlans"` }
AutoVLANCfgResource implements the Resource interface for an 'auto-vlan' resource. 'auto-vlan' resource allocates a vlan from a range of vlan encaps specified at time of resource instantiation
func (*AutoVLANCfgResource) Allocate ¶
func (r *AutoVLANCfgResource) Allocate(reqVal interface{}) (interface{}, error)
Allocate a resource.
func (*AutoVLANCfgResource) Deallocate ¶
func (r *AutoVLANCfgResource) Deallocate(value interface{}) error
Deallocate the resource.
func (*AutoVLANCfgResource) Description ¶
func (r *AutoVLANCfgResource) Description() string
Description is a description of this resource. returns AutoVLANResource.
func (*AutoVLANCfgResource) GetList ¶
func (r *AutoVLANCfgResource) GetList() (uint, string)
GetList returns number of vlans and stringified list of vlans in use.
func (*AutoVLANCfgResource) Init ¶
func (r *AutoVLANCfgResource) Init(rsrcCfg interface{}) error
Init the Resource. Requires a *bitset.BitSet.
func (*AutoVLANCfgResource) Read ¶
func (r *AutoVLANCfgResource) Read(id string) error
Read the state.
func (*AutoVLANCfgResource) ReadAll ¶
func (r *AutoVLANCfgResource) ReadAll() ([]core.State, error)
ReadAll the state for this resource.
func (*AutoVLANCfgResource) Reinit ¶
func (r *AutoVLANCfgResource) Reinit(rsrcCfg interface{}) error
Reinit the Resource. Requires a *bitset.BitSet.
type AutoVLANOperResource ¶
type AutoVLANOperResource struct { core.CommonState FreeVLANs *bitset.BitSet `json:"freeVLANs"` }
AutoVLANOperResource is an implementation of core.State.
func (*AutoVLANOperResource) Read ¶
func (r *AutoVLANOperResource) Read(id string) error
Read the state.
type AutoVXLANCfgResource ¶
type AutoVXLANCfgResource struct { core.CommonState VXLANs *bitset.BitSet `json:"vxlans"` LocalVLANs *bitset.BitSet `json:"LocalVLANs"` FreeVXLANsStart uint `json:"FreeVXLANsStart"` }
AutoVXLANCfgResource implements the Resource interface for an 'auto-vxlan' resource. 'auto-vxlan' resource allocates a vxlan from a range of vxlan encaps specified at time of resource instantiation
func (*AutoVXLANCfgResource) Allocate ¶
func (r *AutoVXLANCfgResource) Allocate(reqVal interface{}) (interface{}, error)
Allocate allocates a new resource.
func (*AutoVXLANCfgResource) Deallocate ¶
func (r *AutoVXLANCfgResource) Deallocate(value interface{}) error
Deallocate removes and cleans up a resource.
func (*AutoVXLANCfgResource) Description ¶
func (r *AutoVXLANCfgResource) Description() string
Description is a string description of the resource. Returns AutoVXLANResource.
func (*AutoVXLANCfgResource) GetList ¶
func (r *AutoVXLANCfgResource) GetList() (uint, string)
GetList returns number of vlans and stringified list of vlans in use.
func (*AutoVXLANCfgResource) Init ¶
func (r *AutoVXLANCfgResource) Init(rsrcCfg interface{}) error
Init the resource.
func (*AutoVXLANCfgResource) Read ¶
func (r *AutoVXLANCfgResource) Read(id string) error
Read the state.
func (*AutoVXLANCfgResource) ReadAll ¶
func (r *AutoVXLANCfgResource) ReadAll() ([]core.State, error)
ReadAll reads all the state from the resource.
func (*AutoVXLANCfgResource) Reinit ¶
func (r *AutoVXLANCfgResource) Reinit(rsrcCfg interface{}) error
Reinit the resource.
type AutoVXLANOperResource ¶
type AutoVXLANOperResource struct { core.CommonState FreeVXLANs *bitset.BitSet `json:"freeVXLANs"` FreeLocalVLANs *bitset.BitSet `json:"freeLocalVLANs"` }
AutoVXLANOperResource is an implementation of core.State
func (*AutoVXLANOperResource) Clear ¶
func (r *AutoVXLANOperResource) Clear() error
Clear the state.
func (*AutoVXLANOperResource) Read ¶
func (r *AutoVXLANOperResource) Read(id string) error
Read the state.
func (*AutoVXLANOperResource) ReadAll ¶
func (r *AutoVXLANOperResource) ReadAll() ([]core.State, error)
ReadAll the state for the given type.
func (*AutoVXLANOperResource) Write ¶
func (r *AutoVXLANOperResource) Write() error
Write the state.
type StateResourceManager ¶
type StateResourceManager struct {
// contains filtered or unexported fields
}
StateResourceManager implements the core.ResourceManager interface. It manages the resources in a logically centralized manner using serialized writes to underlying state store.
func GetStateResourceManager ¶
func GetStateResourceManager() (*StateResourceManager, error)
GetStateResourceManager returns the singleton instance of the state based resource manager
func NewStateResourceManager ¶
func NewStateResourceManager(sd core.StateDriver) (*StateResourceManager, error)
NewStateResourceManager instantiates a state based resource manager
func (*StateResourceManager) AllocateResourceVal ¶
func (rm *StateResourceManager) AllocateResourceVal(id, desc string, reqValue interface{}) (interface{}, error)
AllocateResourceVal yields the core.Resource for the id and description.
func (*StateResourceManager) DeallocateResourceVal ¶
func (rm *StateResourceManager) DeallocateResourceVal(id, desc string, value interface{}) error
DeallocateResourceVal removes a value from the resource.
func (*StateResourceManager) DefineResource ¶
func (rm *StateResourceManager) DefineResource(id, desc string, rsrcCfg interface{}) error
DefineResource initializes a new resource.
func (*StateResourceManager) Deinit ¶
func (rm *StateResourceManager) Deinit()
Deinit cleans up the resource manager
func (*StateResourceManager) GetResourceList ¶
func (rm *StateResourceManager) GetResourceList(id, desc string) (uint, string)
GetResourceList get the list of allocated as string for inspection
func (*StateResourceManager) Init ¶
func (rm *StateResourceManager) Init() error
Init initializes the resource manager
func (*StateResourceManager) RedefineResource ¶
func (rm *StateResourceManager) RedefineResource(id, desc string, rsrcCfg interface{}) error
RedefineResource deinitializes a resource.
func (*StateResourceManager) UndefineResource ¶
func (rm *StateResourceManager) UndefineResource(id, desc string) error
UndefineResource deinitializes a resource.
type VXLANVLANPair ¶
VXLANVLANPair Pairs a VXLAN tag with a VLAN tag.