sqlite

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLiteStorage

type SQLiteStorage struct {
	DB *sql.DB
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage(ctx context.Context, path string) (*SQLiteStorage, error)

func (*SQLiteStorage) Cleanup

func (s *SQLiteStorage) Cleanup(module string)

Cleanup removes the table for the given module

func (*SQLiteStorage) Read

func (s *SQLiteStorage) Read(ctx context.Context, module string) (data []model.Data, err error)

Read reads records for the given module from the database

func (*SQLiteStorage) View

func (s *SQLiteStorage) View(ctx context.Context, module string) (data map[string]map[string]string, err error)

View returns a map of topics and their values for the given module The map is sorted by DateTime and structured as follows: map[Topic]map[DateTime]Value

func (*SQLiteStorage) Write

func (s *SQLiteStorage) Write(ctx context.Context, d model.Data) error

Jump to

Keyboard shortcuts

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