Documentation
¶
Index ¶
- Constants
- func CleanForChecksum(raw []byte) []byte
- func CleanNormalizeNewlines(raw []byte) []byte
- func CleanTrim(raw []byte) []byte
- func CleanTrimLineEnds(raw []byte) []byte
- func Dir() (string, error)
- type Args
- type Checksum
- type Config
- type Driver
- type DriverConfig
- type DriverSpec
- type Errors
- type Filesystem
- type Header
- type Metadata
- type Migration
- type MigrationRun
- type MigrationSet
- type MigrationSetNamespace
- type MigrationSetSpec
- type MigrationSpec
- type ParsedChunk
- type ParsedConfig
- type ParsedFile
- type Parser
- type Resource
Constants ¶
View Source
const (
FileExt = ".fyml"
)
Variables ¶
This section is empty.
Functions ¶
func CleanForChecksum ¶
func CleanNormalizeNewlines ¶
func CleanTrimLineEnds ¶
Types ¶
type Config ¶
type Config struct {
MigrationSets map[string]*MigrationSet
Migrations map[string]*Migration
Drivers map[string]*Driver
}
func (*Config) AddMigration ¶
func (*Config) AddMigrationSet ¶
func (c *Config) AddMigrationSet(migrationSet *MigrationSet) error
type Driver ¶
type Driver struct {
Path string `yaml:"-"`
Metadata Metadata `yaml:"metadata"`
Spec DriverSpec `yaml:"spec"`
}
func (*Driver) EnforceDefaults ¶
func (d *Driver) EnforceDefaults()
type DriverConfig ¶
func (DriverConfig) Bool ¶
func (c DriverConfig) Bool(key string) bool
func (DriverConfig) Float ¶
func (c DriverConfig) Float(key string) float64
func (DriverConfig) Has ¶
func (c DriverConfig) Has(key string) bool
func (DriverConfig) Int ¶
func (c DriverConfig) Int(key string) int
func (DriverConfig) String ¶
func (c DriverConfig) String(key string) string
type DriverSpec ¶
type DriverSpec struct {
Driver string `yaml:"driver"`
Config DriverConfig `yaml:"config"`
}
type Filesystem ¶
type Filesystem struct {
Dir string
}
func NewFilesystem ¶
func NewFilesystem(dir string) *Filesystem
func (*Filesystem) DirFiles ¶
func (f *Filesystem) DirFiles() ([]string, error)
func (*Filesystem) Exists ¶
func (f *Filesystem) Exists(path string) bool
func (*Filesystem) LoadFiles ¶
func (f *Filesystem) LoadFiles(paths []string) ([]*ParsedFile, error)
func (*Filesystem) MkdirAll ¶
func (f *Filesystem) MkdirAll(paths []string) error
type Migration ¶
type Migration struct {
Path string `yaml:"-"`
Metadata Metadata `yaml:"metadata"`
Spec MigrationSpec `yaml:"spec"`
Checksum Checksum `yaml:"-"`
}
func (*Migration) EnforceDefaults ¶
func (m *Migration) EnforceDefaults()
func (*Migration) ResolveFiles ¶
type MigrationRun ¶
type MigrationSet ¶
type MigrationSet struct {
Path string `yaml:"-"`
Metadata Metadata `yaml:"metadata"`
Spec MigrationSetSpec `yaml:"spec"`
}
func (*MigrationSet) EnforceDefaults ¶
func (m *MigrationSet) EnforceDefaults()
func (*MigrationSet) Validate ¶
func (m *MigrationSet) Validate() *Errors
type MigrationSetNamespace ¶
type MigrationSetSpec ¶
type MigrationSetSpec struct {
Namespace MigrationSetNamespace `yaml:"namespace"`
Migrations []string `yaml:"migrations"`
}
type MigrationSpec ¶
type MigrationSpec struct {
Version string `yaml:"version"`
Transaction *bool `yaml:"transaction,omitempty"`
Run MigrationRun `yaml:"run"`
}
type ParsedChunk ¶
type ParsedConfig ¶
type ParsedConfig struct {
Files []*ParsedFile
}
type ParsedFile ¶
type ParsedFile struct {
Path string
Chunks []*ParsedChunk
Migrations []*Migration
MigrationSets []*MigrationSet
Drivers []*Driver
}
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func NewParser ¶
func NewParser(fs *Filesystem, logger *fmtx.Logger) *Parser
New initializes parser and default file system.
func (*Parser) LoadAndParse ¶
func (p *Parser) LoadAndParse() (*ParsedConfig, error)
LoadAndParse parses files in a dir and returns ParsedConfig.
Click to show internal directories.
Click to hide internal directories.