controllers

package
v1.0.1-0...-5fb5fd8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallCommand

func CallCommand(args []string, flags []string) (bytes.Buffer, bytes.Buffer, bool)

func CheckForCommandErrors

func CheckForCommandErrors(stdout, stderr bytes.Buffer, exited bool) (bytes.Buffer, bool)

func ParseStdoutAsJSON

func ParseStdoutAsJSON(stdout bytes.Buffer) (interface{}, error)

func ParseStdoutAsMessage

func ParseStdoutAsMessage(stdout bytes.Buffer, message *APIMessage) error

func ParseStdoutAsMigrations

func ParseStdoutAsMigrations(stdout bytes.Buffer, data *APIMigrations) error

func StatefulExecutionStrategy

func StatefulExecutionStrategy(args, flags []string) (interface{}, error)

func StatelessExecutionStrategy

func StatelessExecutionStrategy(args, flags []string) (interface{}, error)

Types

type APIError

type APIError struct {
	Error string `json:"error"`
}

type APIMessage

type APIMessage struct {
	Message string `json:"message"`
}

type APIMigrations

type APIMigrations struct {
	Count      int         `json:"total"`
	Migrations []Migration `json:"migrations"`
}

type Controller

type Controller struct {
	Error   string
	Message string
	Data    interface{}
}

type Migration

type Migration struct {
	Id       int    `yaml:"-" json:"-"`
	FileName string `yaml:"-"`
	Version  string `yaml:"version"`
	Name     string `yaml:"name"`
}

type MigrationsController

type MigrationsController struct {
	Controller
}

func (*MigrationsController) Applied

func (controller *MigrationsController) Applied(ctx *gin.Context)

func (*MigrationsController) List

func (controller *MigrationsController) List(ctx *gin.Context)

func (*MigrationsController) Migrate

func (controller *MigrationsController) Migrate(ctx *gin.Context)

func (*MigrationsController) Pending

func (controller *MigrationsController) Pending(ctx *gin.Context)

func (*MigrationsController) Rollback

func (controller *MigrationsController) Rollback(ctx *gin.Context)

type RequestBody

type RequestBody struct {
	Migration string `json:"migration"`
}

type StaticController

type StaticController struct {
	Controller
}

func (StaticController) Documentation

func (StaticController) Documentation(ctx *gin.Context)

func (*StaticController) Health

func (controller *StaticController) Health(ctx *gin.Context)

func (StaticController) Ping

func (StaticController) Ping(ctx *gin.Context)

Jump to

Keyboard shortcuts

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