sqlite3

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alias

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

Alias represent an alias as stored in the SQLite database

type ConfigerNewer

type ConfigerNewer struct{}

ConfigerNewer implements the factory methods for the sqlite3 provider.

func (*ConfigerNewer) Config

func (cn *ConfigerNewer) Config() error

Config takes input from the user to configure the sqlite3 provider.

func (*ConfigerNewer) New

func (cn *ConfigerNewer) New() (storage.Provider, error)

New returns a usable instance of the sqlite3 provider.

type Scanner

type Scanner interface {
	Scan(...interface{}) error
}

Scanner is an interface for scanning an sql.Row or sql.Rows type.

type Storer

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

Storer implements the storage provder methods and state for the sqlite3 provider.

func (*Storer) Close

func (s *Storer) Close() error

Close safely closes the database and returns the error result from the close call.

func (Storer) Delete

func (s Storer) Delete(alias, domain string) error

Delete removes the row from the database representing the alias. An error is returned if there is a failure interacting with database.

func (Storer) Description

func (s Storer) Description() string

Description returns the description of the provider this package implements

func (Storer) Get

func (s Storer) Get(alias, domain string) (*alias.Alias, error)

Get retrieves a single Alias from the database. A pointer to the Alias is returned with the error condition during retrieval.

func (*Storer) Open

func (s *Storer) Open(readOnly bool) error

Open reads the sqlite3 database file from the value set in the sqlite3_db_path configuration key. The readOnly argument determines if mutating functions can operate on the database. If the table containing state does not exist, it is created (assuming the database was not opened with readOnly set. An error is returned if there is a problem opening the database.

func (Storer) Put

func (s Storer) Put(alias alias.Alias, updateModified bool) error

Put stores the Alias in the database. If the updateModified flag is set, the modified timestamp column is updated with the timestamp of when the Put call was made. The error condition of the Put operation is returned.

func (Storer) Search

func (s Storer) Search(f alias.Filter, matchAnyRegexp bool) (alias.Aliases, error)

Search applies the filter to the database query results and returns a sorted list of aliases that match the filter criteria.

func (Storer) Suspend

func (s Storer) Suspend(alias, domain string) error

Suspend updates the row in the database representing the alias with the suspended flag is true and updates the suspended timestamp. An error is returned if there is a failure interacting with the database.

func (Storer) Type

func (s Storer) Type() string

Type returns the type of provider this package implements

func (Storer) Unsuspend

func (s Storer) Unsuspend(alias, domain string) error

Unsuspend updates the row in the database representing the alias with the suspended flag is false and updates the suspended timestamp. An error is returned if there is a failure interacting with the database.

func (Storer) Update

func (s Storer) Update(alias alias.Alias, updateModified bool) error

Update stores the updated Alias in the database. If the updateModified flag is set, the modified timestamp column is updated with the timestamp of when the Update call was made. The error condition of the Update operation is returned.

Jump to

Keyboard shortcuts

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