Documentation ¶
Index ¶
- type Source
- func (source *Source) GenerateDirectory(dirname string) error
- func (source *Source) GenerateSrcfile(filename string) error
- func (source *Source) ReadConfigFile() (*schema.Conf, error)
- func (source *Source) ReadFromSrcDir() ([]string, error)
- func (source *Source) ReadSrcfileContent(filename string) (*schema.Srcfile, error)
- type SourceFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Source ¶
type Source struct{}
Source is the one and only implementation for SourceFormat interface It fully handles the handling to OS R/W operation
func (*Source) GenerateDirectory ¶
GenerateDirectory creates a directory with given `dirname` includes the src subfolder in it and generates dummy conf.yaml file
func (*Source) GenerateSrcfile ¶
GenerateSrcfile creates skeleton file that user can fill later with `up` and `down` queries
func (*Source) ReadConfigFile ¶
ReadConfigFile reads conf.yaml file to get the database connection settings
func (*Source) ReadFromSrcDir ¶
ReadFromSrcDir returns all sourcefile names in the src directory
func (*Source) ReadSrcfileContent ¶
ReadSrcfileContent reads the yaml file specified by filename umarshal the yaml and returns the Srcfile structs taken from https://stackoverflow.com/questions/30947534/how-to-read-a-yaml-file
type SourceFormat ¶
type SourceFormat interface { GenerateDirectory(dirname string) error GenerateSrcfile(filename string) error ReadSrcfileContent(filename string) (*schema.Srcfile, error) ReadFromSrcDir() ([]string, error) ReadConfigFile() (*schema.Conf, error) }
SourceFormat is the main interface for OS R/W operation split into interface mainly for testing purpose