config

package
v0.0.0-...-193f563 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnSchema

type ColumnSchema struct {
	ColumnName             string
	UdtName                string // data_type name
	CharacterMaximumLength string
	IsNullable             string
	Order                  string
	ColumnDefault          string
	IsPrimary              bool
}

ColumnSchema define of a column by database schema

func (*ColumnSchema) UpdateByColumnDefinition

func (c *ColumnSchema) UpdateByColumnDefinition(col database.Column)

UpdateByColumnDefinition update column by column definition

type ColumnSchemas

type ColumnSchemas []ColumnSchema

ColumnSchemas array of ColumnSchema

func (ColumnSchemas) GroupByColumnName

func (cols ColumnSchemas) GroupByColumnName() map[string][]ColumnSchema

GroupByColumnName group column schema by column name

type Config

type Config struct {
	SerectKey               string `yaml:"serect_key" json:"-"`
	VerifyConfig            bool   `yaml:"verify_config" json:"-"`
	database.ConnectionInfo `yaml:"database_connection_info" json:"database_connection_info"`
	ForceRecreate           bool                `yaml:"force_recreate" json:"force_recreate"`
	Databases               []database.Database `yaml:"databases_list" json:"databases_list"`
}

Config contain config for agent

func (Config) DBConnectionString

func (c Config) DBConnectionString(dbName string) string

DBConnectionString get pg connection string

type ExistingColumnByTableName

type ExistingColumnByTableName map[string][]ColumnSchema

ExistingColumnByTableName list of existing column_schema in database

type MissingColumns

type MissingColumns struct {
	TableName string
	Columns   []ColumnSchema
	IsCreate  bool
}

MissingColumns define missing columns and groupted by table name

func (MissingColumns) IsNeedMigrate

func (mcs MissingColumns) IsNeedMigrate() bool

IsNeedMigrate check missing column is needed to make a migrate

type Reader

type Reader interface {
	Read() (*Config, error)
}

Reader interface for reading config for agent

func ReadYAML

func ReadYAML(file string) Reader

ReadYAML to read .yaml file

type Writer

type Writer interface {
	Write(res *Config) error
}

Writer interface for reading config for agent

func WriteYAML

func WriteYAML(file string) Writer

WriteYAML to write data to .yaml file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL