Documentation ¶
Index ¶
Constants ¶
const ( // ConfigFileName is the name of an index config file. ConfigFileName = "config.yml" // ProcessingFileName is the name of the processing index file. ProcessingFileName = ".processing" )
Variables ¶
This section is empty.
Functions ¶
func CreateProcessingFile ¶
CreateProcessingFile creates a file inside the directory saying whether the index is being created.
func ExistsProcessingFile ¶
ExistsProcessingFile returns whether the processing file exists inside an index directory.
func RemoveProcessingFile ¶
RemoveProcessingFile removes the file that says whether the index is still being created.
func WriteConfig ¶
WriteConfig writes the configuration to the passed writer (w).
func WriteConfigFile ¶
WriteConfigFile writes the configuration to dir/config.yml file.
Types ¶
type Config ¶
type Config struct { DB string Table string ID string Expressions []string Drivers map[string]map[string]string }
Config represents index configuration
func NewConfig ¶
func NewConfig(db, table, id string, expressionHashes []sql.ExpressionHash, driverID string, driverConfig map[string]string) *Config
NewConfig creates a new Config instance for given driver's configuration
func ReadConfig ¶
ReadConfig reads an configuration from the passed reader (r).
func ReadConfigFile ¶
ReadConfigFile reads an configuration from dir/config.yml file.
func (*Config) ExpressionHashes ¶
func (cfg *Config) ExpressionHashes() []sql.ExpressionHash
ExpressionHashes returns a slice of ExpressionHash for this configuration. Implementation decodes hex strings into byte slices.