store

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package store provides data storage for omnivore output.

Index

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.

Jump to

Keyboard shortcuts

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