Documentation ¶
Index ¶
- type Alias
- type ConfigerNewer
- type Scanner
- type Storer
- func (s *Storer) Close() error
- func (s Storer) Delete(alias, domain string) error
- func (s Storer) Description() string
- func (s Storer) Get(alias, domain string) (*alias.Alias, error)
- func (s *Storer) Open(readOnly bool) error
- func (s Storer) Put(alias alias.Alias, updateModified bool) error
- func (s Storer) Search(f alias.Filter, matchAnyRegexp bool) (alias.Aliases, error)
- func (s Storer) Suspend(alias, domain string) error
- func (s Storer) Type() string
- func (s Storer) Unsuspend(alias, domain string) error
- func (s Storer) Update(alias alias.Alias, updateModified bool) error
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.
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 ¶
Close safely closes the database and returns the error result from the close call.
func (Storer) Delete ¶
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 ¶
Description returns the description of the provider this package implements
func (Storer) Get ¶
Get retrieves a single Alias from the database. A pointer to the Alias is returned with the error condition during retrieval.
func (*Storer) Open ¶
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 ¶
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 ¶
Search applies the filter to the database query results and returns a sorted list of aliases that match the filter criteria.
func (Storer) Suspend ¶
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) Unsuspend ¶
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.