db

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DELETE = iota
	TRUNCATE
	PERSIST
	MEMORY
	WAL
	OFF
)

https://www.sqlite.org/pragma.html#pragma_journal_mode

View Source
const (
	SHARED = iota
	PRIVATE
)

https://www.sqlite.org/sharedcache.html

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Close()
	Insert(msg string) error
	Start(startTime time.Time) error
	Stop(endTime time.Time) error
}

type Sqlite

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

Sqlite is the externed sqlite type

func NewSqlite

func NewSqlite(
	ctx context.Context,
	name string,
	uuid string,
	jmode int,
	cmode int,
	rcnt int,
	period int,
) (*Sqlite, error)

NewSqlite returns init. Sqlite instance

ctx: context.Context

name: actor name

uuid: actor uuid

jmode: journal mode

cmode: cache mode

rcnt: 0: no rotation, >0: preserve number of records then rotate.

func (*Sqlite) Close

func (s *Sqlite) Close()

func (*Sqlite) Insert

func (s *Sqlite) Insert(msg string) error

func (*Sqlite) Start

func (s *Sqlite) Start(startTime time.Time) error

func (*Sqlite) Stop

func (s *Sqlite) Stop(endTime time.Time) error

Jump to

Keyboard shortcuts

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