mutators

package
v0.0.0-...-ab87cb8 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropTask

func DropTask(cng DropChange)

Types

type AlterTable

type AlterTable struct {
	BaseChange
}

func (*AlterTable) GetArtifact

func (cng *AlterTable) GetArtifact() string

func (*AlterTable) GetCluster

func (cng *AlterTable) GetCluster() string

func (*AlterTable) GetDB

func (cng *AlterTable) GetDB() string

func (*AlterTable) Immediate

func (cng *AlterTable) Immediate() bool

func (*AlterTable) PostSteps

func (cng *AlterTable) PostSteps() error

func (*AlterTable) RunChange

func (cng *AlterTable) RunChange() (string, error)

RunChange - Runs the alter table alter table - will be processed by GH-OST

func (*AlterTable) Validate

func (cng *AlterTable) Validate() error

type BaseChange

type BaseChange struct {
	Artifact     string        `json:artifact",omitempty"`
	Cluster      string        `json:cluster",omitempty"`
	DatabaseName string        `json:db_name",omitempty"`
	TableName    string        `json:table_name",omitempty"`
	ChangeType   string        `json:change_type",omitempty"`
	SQLCmd       string        `json:ddl",omitempty"`
	ASTNode      *ast.StmtNode `json:",omitempty"`
	Leaders      []*pb.Host    `json:"leaders,omitempty"`
	Groups       []*pb.GHosts  `json:"groups,omitempty"`
}

Change represents a transformation waiting to happen swagger:model Change

func (*BaseChange) EnrichChange

func (cng *BaseChange) EnrichChange()

EnrichChange tries to enrich the change with more details...

func (*BaseChange) InferFromAST

func (cng *BaseChange) InferFromAST()

func (*BaseChange) PostSteps

func (c *BaseChange) PostSteps() error

func (*BaseChange) ReadFromURL

func (c *BaseChange) ReadFromURL(fileURL string, httpClient *http.Client)

ReadFromURL drills the content url to get the actual file content

func (*BaseChange) RunChange

func (c *BaseChange) RunChange() (string, error)

func (*BaseChange) Validate

func (c *BaseChange) Validate() error

type Change

type Change interface {
	// Validate functions validates that the change is good to go - improving our success rate.
	Validate() error
	RunChange() (string, error)
	PostSteps() error
	GetArtifact() string
	GetCluster() string
	GetDB() string
	Immediate() bool
}

type CreateTable

type CreateTable struct {
	BaseChange
}

func (*CreateTable) GetArtifact

func (cng *CreateTable) GetArtifact() string

func (*CreateTable) GetCluster

func (cng *CreateTable) GetCluster() string

func (*CreateTable) GetDB

func (cng *CreateTable) GetDB() string

func (*CreateTable) Immediate

func (cng *CreateTable) Immediate() bool

func (*CreateTable) PostSteps

func (cng *CreateTable) PostSteps() error

func (*CreateTable) RunChange

func (cng *CreateTable) RunChange() (string, error)

* * RunTableCreate simply runs the given create statement - no validation yet. * TODO: // 1. use some connection class - nicer // 2. add validations: * a. table doesn't exist

func (*CreateTable) Validate

func (cng *CreateTable) Validate() error

type DropChange

type DropChange struct {
	BaseChange
}

func (*DropChange) GetArtifact

func (cng *DropChange) GetArtifact() string

func (*DropChange) GetCluster

func (cng *DropChange) GetCluster() string

func (*DropChange) GetDB

func (cng *DropChange) GetDB() string

func (*DropChange) Immediate

func (cng *DropChange) Immediate() bool

Immediate - drop change is never immediate as we want to give time and option to cancel.

func (*DropChange) PostSteps

func (cng *DropChange) PostSteps() error

func (*DropChange) RunChange

func (cng *DropChange) RunChange() (string, error)

func (*DropChange) Validate

func (cng *DropChange) Validate() error

type RenameTable

type RenameTable struct {
	BaseChange
}

func (*RenameTable) GetArtifact

func (cng *RenameTable) GetArtifact() string

func (*RenameTable) GetCluster

func (cng *RenameTable) GetCluster() string

func (*RenameTable) GetDB

func (cng *RenameTable) GetDB() string

func (*RenameTable) Immediate

func (cng *RenameTable) Immediate() bool

func (*RenameTable) PostSteps

func (cng *RenameTable) PostSteps() error

func (*RenameTable) RunChange

func (cng *RenameTable) RunChange() (string, error)

RunChange renames a table to keep it @todo: choose and implement cleanup policy @body: something will eventually need to remove these tables.

func (*RenameTable) Validate

func (cng *RenameTable) Validate() error

type Result

type Result string

Result is the output of DB calls - do we need this??

Jump to

Keyboard shortcuts

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