data

package
v1.1.234 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKey

func GetKey(entityType string, keyPart ...string) string

GetKey returns a key to be used in the storage system

Types

type Event

type Event struct {
	ID        string    `json:"id"`        // Unique Event ID
	Created   time.Time `json:"created"`   // Event creation time
	SourceIP  string    `json:"ip"`        // Source IP address of the event
	EventType string    `json:"eventtype"` // One of: System startup, File found, File processed, File error, System shutdown
	MediaType string    `json:"mediatype"` // The type of media involved: TV / Movie / Music / System
	Details   string    `json:"details"`   // Additional information (like the files involved)
}

Event represents an event in the system. These events can be logged or passed (as meta information) to other systems

type File

type File struct {
	ID          string    `json:"id"`       // Unique File ID
	Created     time.Time `json:"created"`  // File create time
	FilePath    string    `json:"filepath"` // Full filepath to the file
	Description string    `json:"details"`  // Additional information (like the files involved)
}

File represents an uploaded file.

type Manager

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

Manager is the data manager

func NewManager

func NewManager(systemdbpath string) (*Manager, error)

NewManager creates a new instance of a Manager and returns it

func (Manager) AddEvent

func (store Manager) AddEvent(eventtype, mediatype, details string, ip string, expiresafter time.Duration) (Event, error)

AddEvent adds an event to the system

func (Manager) AddFile

func (store Manager) AddFile(filepath, description string) (File, error)

AddEvent adds an event to the system

func (Manager) Close

func (store Manager) Close() error

Close closes the data Manager

func (Manager) DeleteFile

func (store Manager) DeleteFile(id string) error

DeleteFile deletes a file from the system

func (Manager) GetAllEvents

func (store Manager) GetAllEvents() ([]Event, error)

GetAllEvents gets all events in the system

func (Manager) GetAllFiles

func (store Manager) GetAllFiles() ([]File, error)

GetAllFiles gets all files in the system

func (Manager) GetEvent

func (store Manager) GetEvent(id string) (Event, error)

GetEvent gets an event from the system

func (Manager) GetFile

func (store Manager) GetFile(id string) (File, error)

GetFile gets information about a single file in the system based on its id

Jump to

Keyboard shortcuts

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