types

package
v4.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateMigrationsModeType

func ValidateMigrationsModeType(fl validator.FieldLevel) bool

ValidateMigrationsModeType validates MigrationsModeType used by binding package

func ValidateMigrationsResponseType

func ValidateMigrationsResponseType(fl validator.FieldLevel) bool

ValidateMigrationsResponseType validates MigrationsResponseType used by binding package

Types

type Migration

type Migration struct {
	Name          string        `json:"name"`
	SourceDir     string        `json:"sourceDir"`
	File          string        `json:"file"`
	MigrationType MigrationType `json:"migrationType"`
	Contents      string        `json:"contents,omitempty"`
	CheckSum      string        `json:"checkSum"`
}

Migration contains basic information about migration

type MigrationDB

type MigrationDB struct {
	Migration
	Schema    string    `json:"schema"`
	AppliedAt time.Time `json:"appliedAt"`
}

MigrationDB embeds Migration and adds DB-specific fields

type MigrationResults

type MigrationResults struct {
	StartedAt             time.Time     `json:"startedAt"`
	Duration              time.Duration `json:"duration"`
	Tenants               int           `json:"tenants"`
	SingleMigrations      int           `json:"singleMigrations"`
	TenantMigrations      int           `json:"tenantMigrations"`
	TenantMigrationsTotal int           `json:"tenantMigrationsTotal"` // tenant migrations for all tenants
	MigrationsGrandTotal  int           `json:"migrationsGrandTotal"`  // total number of all migrations applied
	SingleScripts         int           `json:"singleScripts"`
	TenantScripts         int           `json:"tenantScripts"`
	TenantScriptsTotal    int           `json:"tenantScriptsTotal"` // tenant scripts for all tenants
	ScriptsGrandTotal     int           `json:"scriptsGrandTotal"`  // total number of all scripts applied
}

MigrationResults contains summary information about executed migrations

type MigrationType

type MigrationType uint32

MigrationType stores information about type of migration

const (
	// MigrationTypeSingleMigration is used to mark single migration
	MigrationTypeSingleMigration MigrationType = 1
	// MigrationTypeTenantMigration is used to mark tenant migrations
	MigrationTypeTenantMigration MigrationType = 2
	// MigrationTypeSingleScript is used to mark single SQL script which is executed always
	MigrationTypeSingleScript MigrationType = 3
	// MigrationTypeTenantScript is used to mark tenant SQL scripts which is executed always
	MigrationTypeTenantScript MigrationType = 4
)

type MigrationsModeType

type MigrationsModeType string

MigrationsModeType represents mode in which migrations should be applied

const (
	// ModeTypeApply instructs migrator to apply migrations
	ModeTypeApply MigrationsModeType = "apply"
	// ModeTypeDryRun instructs migrator to perform apply operation in dry-run mode, instead of committing transaction it is rollbacked
	ModeTypeDryRun MigrationsModeType = "dry-run"
	// ModeTypeSync instructs migrator to only synchronise migrations
	ModeTypeSync MigrationsModeType = "sync"
)

type MigrationsResponseType

type MigrationsResponseType string

MigrationsResponseType represents type of response either full or summary

const (
	// ResponseTypeSummary instructs migrator to only return JSON representation of Results struct
	ResponseTypeSummary MigrationsResponseType = "summary"
	// ResponseTypeFull instructs migrator to return JSON representation of both Results struct and all applied migrations/scripts
	ResponseTypeFull MigrationsResponseType = "full"
	// ResponseTypeList instructs migrator to return JSON representation of both Results struct and all applied migrations/scripts but without their contents
	ResponseTypeList MigrationsResponseType = "list"
)

type VersionInfo

type VersionInfo struct {
	Release     string   `json:"release"`
	CommitSha   string   `json:"commitSha"`
	CommitDate  string   `json:"commitDate"`
	APIVersions []string `json:"apiVersions"`
}

VersionInfo contains build information and supported API versions

Jump to

Keyboard shortcuts

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