Documentation ¶
Overview ¶
This file contains LockMap struct definition and methods. A LockMap holds a mapping of client -> locks so that locks can be unlocked when a client disconnects
Index ¶
- type LockMap
- func (l *LockMap) Add(name string, key string)
- func (l *LockMap) AddSession(sessionKey string)
- func (l *LockMap) Load() ([]cl.ClientLock, error)
- func (l *LockMap) Locks() map[string][]cl.ClientLock
- func (l *LockMap) Remove(name string, sessionKey string)
- func (l *LockMap) RemoveSession(sessionKey string) []cl.ClientLock
- func (l *LockMap) Save() error
- func (l *LockMap) SetReadWriter(rw ReadWriter)
- type LockMapConfig
- type ReadWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LockMap ¶
type LockMap struct {
// contains filtered or unexported fields
}
LockMap defines the server's clientLocks map
func New ¶
func New(c *LockMapConfig) *LockMap
New creates a new LockMap instance.
Parameter(s): c *Config Returns: *LockMap
func (*LockMap) AddSession ¶
AddSession adds a session to the clientLocks map
func (*LockMap) Load ¶
func (l *LockMap) Load() ([]cl.ClientLock, error)
Load loads the server's clientLocks map from the ReadWriter's state file
func (*LockMap) Locks ¶
func (l *LockMap) Locks() map[string][]cl.ClientLock
Locks returns the server's clientLocks map
func (*LockMap) RemoveSession ¶
func (l *LockMap) RemoveSession(sessionKey string) []cl.ClientLock
RemoveSession deletes the session and returns all locks associated with it
func (*LockMap) SetReadWriter ¶
func (l *LockMap) SetReadWriter(rw ReadWriter)
SetReadWriter sets the lockmap readwriter
type LockMapConfig ¶
Config defines the configuration for a LockMap instance
type ReadWriter ¶
type ReadWriter interface { Write(map[string][]cl.ClientLock) error Read() (map[string][]cl.ClientLock, error) }
ReadWriter defines the readWriter interface
Directories ¶
Path | Synopsis |
---|---|
This file contains the ClientLock struct definition and methods.
|
This file contains the ClientLock struct definition and methods. |
This file contains the readWriter struct, its methods, and some helper functions related to serialization.
|
This file contains the readWriter struct, its methods, and some helper functions related to serialization. |