Documentation ¶
Index ¶
- type Store
- func (s *Store) Delete(id uint16) error
- func (s *Store) Get(packetID uint16) (io.ReadCloser, error)
- func (s *Store) List() ([]uint16, error)
- func (s *Store) Put(packetID uint16, packetType byte, w io.WriterTo) error
- func (s *Store) Quarantine(id uint16) error
- func (s *Store) Reset() error
- func (s *Store) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct { // server store - holds packets where the message ID was generated on the server sync.Mutex // Is this needed? // contains filtered or unexported fields }
Store is an implementation of a Store that stores the data on disk
func New ¶
New creates a file Store. Note that a file is written, read and deleted as part of this process to check that the path is usable. NOTE: Order is maintained using file ModTime, so there may be issues if the interval between messages is less than the file system ModTime resolution.
func (*Store) Get ¶
func (s *Store) Get(packetID uint16) (io.ReadCloser, error)
Get retrieves the requested packet Note that callers MUST close the returned ReadCloser
func (*Store) Put ¶
Put stores the packet The store is performed via a temporary file to reduce the chance that a partially written file will cause issues.
func (*Store) Quarantine ¶
Quarantine is called if a corrupt packet is detected. There is little we can do other than deleting the packet.