Documentation ¶
Index ¶
- Constants
- func ReleaseStateResourceManager()
- type AutoSubnetCfgResource
- func (r *AutoSubnetCfgResource) Allocate() (interface{}, error)
- func (r *AutoSubnetCfgResource) Clear() error
- func (r *AutoSubnetCfgResource) Deallocate(value interface{}) error
- func (r *AutoSubnetCfgResource) Deinit()
- func (r *AutoSubnetCfgResource) Description() string
- func (r *AutoSubnetCfgResource) Init(rsrcCfg interface{}) error
- func (r *AutoSubnetCfgResource) Read(id string) error
- func (r *AutoSubnetCfgResource) ReadAll() ([]core.State, error)
- func (r *AutoSubnetCfgResource) Write() error
- type AutoSubnetOperResource
- type AutoVLANCfgResource
- func (r *AutoVLANCfgResource) Allocate() (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) Init(rsrcCfg interface{}) error
- func (r *AutoVLANCfgResource) Read(id string) error
- func (r *AutoVLANCfgResource) ReadAll() ([]core.State, error)
- func (r *AutoVLANCfgResource) Write() error
- type AutoVLANOperResource
- type AutoVXLANCfgResource
- func (r *AutoVXLANCfgResource) Allocate() (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) Init(rsrcCfg interface{}) error
- func (r *AutoVXLANCfgResource) Read(id string) error
- func (r *AutoVXLANCfgResource) ReadAll() ([]core.State, error)
- func (r *AutoVXLANCfgResource) Write() error
- type AutoVXLANOperResource
- type StateResourceManager
- func (rm *StateResourceManager) AllocateResourceVal(id, desc string) (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) Init() error
- func (rm *StateResourceManager) UndefineResource(id, desc string) error
- type SubnetIPLenPair
- type VXLANVLANPair
Constants ¶
const (
// AutoSubnetResource is the name of the resource, for storing state.
AutoSubnetResource = "auto-subnet"
)
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 AutoSubnetCfgResource ¶
type AutoSubnetCfgResource struct { core.CommonState SubnetPool net.IP `json:"subnetPool"` SubnetPoolLen uint `json:"subnetPoolLen"` AllocSubnetLen uint `json:"allocSubnetLen"` }
AutoSubnetCfgResource is an implementation of core.State and core.Resource for configuration of the subnet.
func (*AutoSubnetCfgResource) Allocate ¶
func (r *AutoSubnetCfgResource) Allocate() (interface{}, error)
Allocate a new subnet. Returns an interface{} which for this method is always SubnetIPLenPair.
func (*AutoSubnetCfgResource) Deallocate ¶
func (r *AutoSubnetCfgResource) Deallocate(value interface{}) error
Deallocate the resource. Must be passed a SubnetIPLenPair.
func (*AutoSubnetCfgResource) Description ¶
func (r *AutoSubnetCfgResource) Description() string
Description returns a string that describe the type of state.
func (*AutoSubnetCfgResource) Init ¶
func (r *AutoSubnetCfgResource) Init(rsrcCfg interface{}) error
Init the state from configuration.
func (*AutoSubnetCfgResource) Read ¶
func (r *AutoSubnetCfgResource) Read(id string) error
Read the state
type AutoSubnetOperResource ¶
type AutoSubnetOperResource struct { core.CommonState FreeSubnets *bitset.BitSet `json:"freeSubnets"` }
AutoSubnetOperResource is an implementation of core.State relating to subnets.
func (*AutoSubnetOperResource) Clear ¶
func (r *AutoSubnetOperResource) Clear() error
Clear the state.
func (*AutoSubnetOperResource) Read ¶
func (r *AutoSubnetOperResource) Read(id string) error
Read the state.
func (*AutoSubnetOperResource) ReadAll ¶
func (r *AutoSubnetOperResource) ReadAll() ([]core.State, error)
ReadAll state under the prefix.
func (*AutoSubnetOperResource) Write ¶
func (r *AutoSubnetOperResource) Write() error
Write the state.
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() (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) 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.
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"` }
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() (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) Init ¶
func (r *AutoVXLANCfgResource) Init(rsrcCfg interface{}) error
Init the resource.
func (*AutoVXLANCfgResource) Read ¶
func (r *AutoVXLANCfgResource) Read(id string) error
Read the state.
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) (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) Init ¶
func (rm *StateResourceManager) Init() error
Init initializes the resource manager
func (*StateResourceManager) UndefineResource ¶
func (rm *StateResourceManager) UndefineResource(id, desc string) error
UndefineResource deinitializes a resource.
type SubnetIPLenPair ¶
SubnetIPLenPair structurally represents a CIDR notated address.
type VXLANVLANPair ¶
VXLANVLANPair Pairs a VXLAN tag with a VLAN tag.