memory

package
v0.0.0-...-501dce0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend implements server.Backend

func New

func New() *Backend

New creates an initialized empty Backend

func (*Backend) AckNotification

func (m *Backend) AckNotification(id string) error

AckNotification acks a notification

func (*Backend) AddClient

func (m *Backend) AddClient(id string) error

AddClient adds a Client to the backend if it doesn't already exist

func (*Backend) AddLease

func (m *Backend) AddLease(lease *lease.Lease) error

AddLease adds a Lease to the backend

func (*Backend) AddLeaseRequest

func (m *Backend) AddLeaseRequest(request *lease.LeaseRequest) error

AddLeaseRequest adds a LeaseRequest to the backend

func (*Backend) AddVolume

func (m *Backend) AddVolume(volume *server.Volume) error

AddVolume satisfies server.Backend

func (*Backend) Clients

Clients returns a list of server.ClientInfo

func (*Backend) DeleteLease

func (m *Backend) DeleteLease(leaseID string) error

DeleteLease removes a Lease from the backend

func (*Backend) DeleteLeaseRequest

func (m *Backend) DeleteLeaseRequest(leaseRequestID string) error

DeleteLeaseRequest removes a LeaseRequest from the backend

func (*Backend) DeleteVolume

func (m *Backend) DeleteVolume(id string) error

DeleteVolume satisfies server.Backend

func (*Backend) GetClient

func (m *Backend) GetClient(id string) (server.ClientInfo, error)

GetClient returns a ClientInfo for a given client id

func (*Backend) GetVolume

func (m *Backend) GetVolume(id string) (*server.Volume, error)

GetVolume satisfies server.Backend

func (*Backend) ListLeaseRequests

func (m *Backend) ListLeaseRequests(f lease.LeaseRequestFilterFunc) ([]*lease.LeaseRequest, error)

ListLeaseRequests returns a list of lease.LeaseRequest

func (*Backend) ListLeases

func (m *Backend) ListLeases(f lease.LeaseFilterFunc) ([]*lease.Lease, error)

ListLeases returns a list of lease.Lease

func (*Backend) ListVolumes

func (m *Backend) ListVolumes(f server.VolumeFilterFunc) ([]*server.Volume, error)

ListVolumes satisfies server.Backend

func (*Backend) RemoveClient

func (m *Backend) RemoveClient(id string) error

RemoveClient deletes a given client from the ClientMap

func (*Backend) UpdateClient

func (m *Backend) UpdateClient(id string, status server.ClientStatus) error

UpdateClient updates the client info for a given client

func (*Backend) UpdateLease

func (m *Backend) UpdateLease(lease *lease.Lease) error

UpdateLease updates a Lease in the backend

func (*Backend) UpdateLeaseRequest

func (m *Backend) UpdateLeaseRequest(request *lease.LeaseRequest) error

UpdateLeaseRequest updates a LeaseRequest in the backend

func (*Backend) UpdateVolume

func (m *Backend) UpdateVolume(volume *server.Volume) error

UpdateVolume satisfies server.Backend

func (*Backend) WatchNotification

func (m *Backend) WatchNotification(id string) (chan struct{}, error)

WatchNotification returns a channel that will be closed when the notification is acked

func (*Backend) WatchNotifications

func (m *Backend) WatchNotifications(id string, ch chan<- server.Notification) error

WatchNotifications writes notifications to a given channel

func (*Backend) WriteNotification

func (m *Backend) WriteNotification(id string, n server.Notification) error

WriteNotification writes a Notification into a channel in a blocking manner

type ClientMap

type ClientMap struct {
	// contains filtered or unexported fields
}

ClientMap maps clients to their info

func NewClientMap

func NewClientMap() *ClientMap

NewClientMap returns an initialized ClientMap

type LeaseMap

type LeaseMap struct {
	// contains filtered or unexported fields
}

LeaseMap holds information about leases

func NewLeaseMap

func NewLeaseMap() *LeaseMap

NewLeaseMap returns an initialized LeaseMap

type LeaseRequestMap

type LeaseRequestMap struct {
	// contains filtered or unexported fields
}

LeaseRequestMap holds information about LeaseRequests

func NewLeaseRequestMap

func NewLeaseRequestMap() *LeaseRequestMap

NewLeaseRequestMap returns an initialized LeaseRequestMap

type VolumeMap

type VolumeMap struct {
	// contains filtered or unexported fields
}

VolumeMap holds information about registered volumes

func NewVolumeMap

func NewVolumeMap() *VolumeMap

NewVolumeMap returns an initialized VolumeMap

Jump to

Keyboard shortcuts

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