Documentation
¶
Overview ¶
Package store provides data storage for omnivore output.
Index ¶
- func NewStorageSession()
- type StorageSession
- func (s *StorageSession) InitBaseDir()
- func (s *StorageSession) InitHistoryDir()
- func (s *StorageSession) InitHostDir(name string)
- func (s *StorageSession) InitSessionDirectory()
- func (s *StorageSession) Read(name string) ([]byte, error)
- func (s *StorageSession) WriteOutputFileForHost(idp *group.IdentifyingPair)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStorageSession ¶
func NewStorageSession()
Types ¶
type StorageSession ¶
type StorageSession struct { Timestamp string UserHome string BaseDir string HistoryDir string SessionDir string }
StorageSession holds directory information about the current application run state.
var ( // Session is initalised with NewStorageSession, used for file operations. Session *StorageSession )
func (*StorageSession) InitBaseDir ¶
func (s *StorageSession) InitBaseDir()
InitBaseDir ensures the directory ~/.omnivore/ exists, creating it if necessary.
func (*StorageSession) InitHistoryDir ¶
func (s *StorageSession) InitHistoryDir()
InitHistoryDir ensures the directory ~/.omnivore/history exists, creating it if necessary.
func (*StorageSession) InitHostDir ¶
func (s *StorageSession) InitHostDir(name string)
InitHostDir creates host-named directory within ~/.omnivore/history.
func (*StorageSession) InitSessionDirectory ¶
func (s *StorageSession) InitSessionDirectory()
InitSessionDirectory creates a directory to hold session output in ~/.omnivore/history using the unix timestamp set by func setSessionTimestamp
func (*StorageSession) Read ¶
func (s *StorageSession) Read(name string) ([]byte, error)
Read reads the given file from a storage session.
func (*StorageSession) WriteOutputFileForHost ¶
func (s *StorageSession) WriteOutputFileForHost(idp *group.IdentifyingPair)
WriteOutputFileForHost writes the content of an identifying pair to a file, for future processing out of memory. The identifying pair's key should always be the hostname.