Documentation
¶
Index ¶
- type ConfigerNewer
- type FileAlias
- type Storer
- func (s *Storer) Close() error
- func (s Storer) Delete(a, d 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(a 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(a alias.Alias, updateModified bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigerNewer ¶
type ConfigerNewer struct{}
ConfigerNewer implements the factory methods for the files provider.
func (*ConfigerNewer) Config ¶
func (cn *ConfigerNewer) Config() error
Config takes input from the user to configure the sqlite3 provider.
type FileAlias ¶
type FileAlias struct {
Alias string `json:"alias"`
Domain string `json:"domain"`
EmailAddresses []string `json:"email_addresses"`
Description string `json:"description"`
Suspended bool `json:"suspended"`
CreatedTS time.Time `json:"created_ts"`
ModifiedTS time.Time `json:"modified_ts"`
SuspendedTS time.Time `json:"suspended_ts"`
}
FileAlias represents the state necessary for a file alias.
type Storer ¶
type Storer struct {
// contains filtered or unexported fields
}
Storer implements the storage provder methods and state for the files provider.
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 file on disk. A pointer to the Alias is returned with any error condition during retrieval.
func (*Storer) Open ¶
Open reads the JSON files from the path set in the files_path configuration key. The readOnly argument determines if mutating functions can operate on the files. If the storage directory does not exist, it is created (assuming the files were not opened with readOnly set). An error is returned if there is a problem opening the files.
func (Storer) Put ¶
Put stores the Alias in a file. If the updateModified flag is set, the modified timestamp field 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.