sqlite

package
v0.0.0-...-660a5ed Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(path string) (sqldb io.WriteCloser, err error)

New function will take in a path to a .db file; and create a new instance of a SQLite3 object; returning an io.WriteCloser and an error.

func WithSQLite

func WithSQLite(path string) log.LoggerConfig

WithSQLite function takes in a path to a .db file, and a table name; and returns a LoggerConfig so that this type of writer is defined in a Logger

Types

type SQLite

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

SQLite struct is a wrapper for a SQLite database to be used as a Log Writer

func (*SQLite) Close

func (d *SQLite) Close() error

Close method is implemented for compatibility with the Database interface.

While this ORM doesn't force users to close the connection, MongoDB does, and the method should be available for use

func (*SQLite) Create

func (o *SQLite) Create(msg ...*event.Event) error

Create method will register any number of event.Event in the SQLite database, returning an error

func (*SQLite) Write

func (s *SQLite) Write(p []byte) (n int, err error)

Write method implements the io.Writer interface, for SQLite DBs to be used with Logger, as its writer.

The input message is expected to be a protobuf-marshalled event.Event, which is decoded

Jump to

Keyboard shortcuts

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