Documentation ¶
Index ¶
- Constants
- func NewLocalManager(config *EtcdConfig) (Manager, error)
- func NewMockManager(registry *MockSubnetRegistry) subnet.Manager
- type EtcdConfig
- type LocalManager
- func (m *LocalManager) AcquireLease(ctx context.Context, attrs *LeaseAttrs) (*Lease, error)
- func (m *LocalManager) AddReservation(ctx context.Context, r *Reservation) error
- func (m *LocalManager) GetNetworkConfig(ctx context.Context) (*Config, error)
- func (m *LocalManager) ListReservations(ctx context.Context) ([]Reservation, error)
- func (m *LocalManager) RemoveReservation(ctx context.Context, subnet ip.IP4Net) error
- func (m *LocalManager) RenewLease(ctx context.Context, lease *Lease) error
- func (m *LocalManager) RevokeLease(ctx context.Context, sn ip.IP4Net) error
- func (m *LocalManager) WatchLease(ctx context.Context, sn ip.IP4Net, cursor interface{}) (LeaseWatchResult, error)
- func (m *LocalManager) WatchLeases(ctx context.Context, cursor interface{}) (LeaseWatchResult, error)
- type MockSubnetRegistry
- type Registry
Constants ¶
View Source
const DEFAULT_TTL time.Duration = 8760 * time.Hour // one year
Variables ¶
This section is empty.
Functions ¶
func NewLocalManager ¶
func NewLocalManager(config *EtcdConfig) (Manager, error)
func NewMockManager ¶
func NewMockManager(registry *MockSubnetRegistry) subnet.Manager
Types ¶
type EtcdConfig ¶
type LocalManager ¶
type LocalManager struct {
// contains filtered or unexported fields
}
func (*LocalManager) AcquireLease ¶
func (m *LocalManager) AcquireLease(ctx context.Context, attrs *LeaseAttrs) (*Lease, error)
func (*LocalManager) AddReservation ¶
func (m *LocalManager) AddReservation(ctx context.Context, r *Reservation) error
func (*LocalManager) GetNetworkConfig ¶
func (m *LocalManager) GetNetworkConfig(ctx context.Context) (*Config, error)
func (*LocalManager) ListReservations ¶
func (m *LocalManager) ListReservations(ctx context.Context) ([]Reservation, error)
func (*LocalManager) RemoveReservation ¶
RemoveReservation removes the subnet by setting TTL back to subnetTTL (24hours)
func (*LocalManager) RenewLease ¶
func (m *LocalManager) RenewLease(ctx context.Context, lease *Lease) error
func (*LocalManager) RevokeLease ¶
func (*LocalManager) WatchLease ¶
func (*LocalManager) WatchLeases ¶
func (m *LocalManager) WatchLeases(ctx context.Context, cursor interface{}) (LeaseWatchResult, error)
type MockSubnetRegistry ¶
type MockSubnetRegistry struct {
// contains filtered or unexported fields
}
func NewMockRegistry ¶
func NewMockRegistry(config string, initialSubnets []Lease) *MockSubnetRegistry
Click to show internal directories.
Click to hide internal directories.