Documentation
¶
Overview ¶
Package types implements migrate related interfaces and models.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DNSRecords ¶
type DNSRecords []*v1dns.ResourceRecordSet
DNSRecords represents an abstraction for dns record sets collection.
type Direction ¶
type Direction int
Direction defines the type of the migration direction.
func (Direction) MarshalJSON ¶
MarshalJSON marshals the enum as a quoted json string.
type Executable ¶
Executable defines an interface for the execute command of the root command executable method when it is passed through the chain of chained commands.
type Executor ¶
Executor is a wrapper class for passing a specialized executable root object across chained commands.
type Migration ¶
type Migration struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Tag semver.Version `json:"tag,omitempty" yaml:"tag,omitempty"` Up []Operation `json:"up,omitempty" yaml:"up,omitempty"` Down []Operation `json:"down,omitempty" yaml:"down,omitempty"` }
Migration defines a set of operations to run on the database.
type Migrations ¶
type Migrations []*Migration
Migrations represents multiple database migrations.
func (Migrations) Less ¶
func (r Migrations) Less(i, j int) bool
Less checks if migration at index i is less than migration at index j
func (Migrations) Swap ¶
func (r Migrations) Swap(i, j int)
Swap swaps two migrations inside the collection by its indices
type OpExecutor ¶
type OpExecutor interface { Exec(query string, args ...interface{}) (sql.Result, error) Insert(list ...interface{}) error Delete(list ...interface{}) (int64, error) }
OpExecutor describes an abstract database operations executor.
type Operation ¶
type Operation struct { Query string `json:"query,omitempty" yaml:"query,omitempty"` DisableTx bool `json:"disableTx,omitempty" yaml:"disableTx,omitempty"` }
Operation defines a single query operation to run on the database.
type Patch ¶
type Patch struct { Filters []string Func func(ctx context.Context, out io.Writer) error // contains filtered or unexported fields }
Patch defines an executable patch function and filters for which this function will run.
type Patches ¶
type Patches []*Patch
Patches implements a collection of patching elements each of which executes a pre-execution hook function.
type PsqlDSN ¶
type PsqlDSN struct { Host string `json:"host" yaml:"host"` Port string `json:"port" yaml:"port"` User string `json:"user" yaml:"user"` Password string `json:"password" yaml:"password"` DBName string `json:"dbName" yaml:"dbName"` SSLMode string `json:"sslMode" yaml:"sslMode"` FallbackApplicationName string `json:"fallbackApplicationName" yaml:"fallbackApplicationName"` ConnectTimeout int `json:"connectTimeout" yaml:"connectTimeout"` SSLCert string `json:"sslCert" yaml:"sslCert"` SSLKey string `json:"sslKey" yaml:"sslKey"` SSLRootCert string `json:"sslRootCert" yaml:"sslRootCert"` }
PsqlDSN config represents a parsed PostgreSQL connection string.
type RangeFunc ¶
type RangeFunc func(key, value interface{}) bool
RangeFunc is used to simplify syntax.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds stored changes of either database migrations or kubernetes releases.
func (*Registry) Collect ¶
Collect iterates over all registered cluster migrations and adds them to the specified migration.
func (*Registry) Load ¶
Load returns the change, or nil if no value is present. The ok result indicates whether value was found in the map.
type Release ¶
type Release struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Version semver.Version `json:"version,omitempty" yaml:"version,omitempty"` Manifests []runtime.Object `json:"manifests,omitempty" yaml:"manifests,omitempty"` }
Release defines a collection of kubernetes manifests which can be released together as a logical unit.
func (Release) MarshalYAML ¶
MarshalYAML implements custom yaml mashal method.
func (*Release) UnmarshalJSON ¶
UnmarshalJSON defines custom json unmarshalling procedure.