Documentation
¶
Index ¶
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(n int) (string, error)
- func GenerateRandomStringURLSafe(n int) (string, error)
- type Models
- type Project
- type ProjectModel
- type ROToken
- type ROTokenModel
- type SQLMigration
- type SQLMigrationGroup
- type SQLMigrationGroupModel
- type SQLMigrationModel
- func (m SQLMigrationModel) Add(mig *SQLMigration) error
- func (m SQLMigrationModel) Get(id int) (*SQLMigration, error)
- func (m SQLMigrationModel) GetAll(table string) ([]*SQLMigration, error)
- func (m SQLMigrationModel) GetAllByDir(dir string, env string, table string) ([]*SQLMigration, error)
- func (m SQLMigrationModel) Remove(mig *SQLMigration) error
- func (m SQLMigrationModel) Update(mig *SQLMigration) error
- type SQLMigrationTable
- type SQLMigrationTables
- type SQLMigrationTablesModel
- type SQLMigrationsLatest
- type SQLMigrationsLatestModel
- type SQLScript
- type SQLScriptModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomBytes ¶
func GenerateRandomString ¶
Types ¶
type Models ¶
type Models struct {
SQLScript interface {
Register(script *SQLScript) error
Get(name string) (*SQLScript, error)
GetAll(projectName string) ([]*SQLScript, error)
}
SQLMigration interface {
Add(mig *SQLMigration) error
Update(mig *SQLMigration) error
Remove(mig *SQLMigration) error
GetAll(table string) ([]*SQLMigration, error)
GetAllByDir(dir string, env string, table string) ([]*SQLMigration, error)
}
SQLMigrationGroup interface {
Get(env string, table string) (*SQLMigrationGroup, error)
}
SQLMigrationsLatest interface {
Update(mig *SQLMigrationsLatest) error
AutoUpdateLatest(env string, table string) error
GetByEnv(env string, table string) ([]*SQLMigrationsLatest, error)
}
SQLMigrationTables interface {
Get(env string) (*SQLMigrationTables, error)
}
Project interface {
Get(name string) (*Project, error)
}
}
type ProjectModel ¶
type ROTokenModel ¶
func (ROTokenModel) IsValid ¶
func (m ROTokenModel) IsValid(token string) bool
func (ROTokenModel) Register ¶
func (m ROTokenModel) Register() (*ROToken, error)
func (ROTokenModel) Remove ¶
func (m ROTokenModel) Remove(token string) error
type SQLMigration ¶
type SQLMigration struct {
Env string `json:"env"`
FileID string `json:"file_id"`
File string `json:"file"`
FileOrder int `json:"file_order"`
SourceTable string `json:"source_table"`
MigratedAt *time.Time `json:"migrated_at"`
MigratedAtNull bool `json:"migrated_at_null"`
ID int `json:"id"`
Script string `json:"script"`
Status *string `json:"status"`
}
type SQLMigrationGroup ¶
type SQLMigrationGroup struct {
Env string `json:"env"`
SourceTable string `json:"source_table"`
MigrationsUp []*SQLMigration `json:"migrations_up"`
MigrationsDown []*SQLMigration `json:"migrations_down"`
}
type SQLMigrationGroupModel ¶
func (SQLMigrationGroupModel) Get ¶
func (m SQLMigrationGroupModel) Get(env string, table string) (*SQLMigrationGroup, error)
type SQLMigrationModel ¶
func (SQLMigrationModel) Add ¶
func (m SQLMigrationModel) Add(mig *SQLMigration) error
func (SQLMigrationModel) Get ¶
func (m SQLMigrationModel) Get(id int) (*SQLMigration, error)
func (SQLMigrationModel) GetAll ¶
func (m SQLMigrationModel) GetAll(table string) ([]*SQLMigration, error)
func (SQLMigrationModel) GetAllByDir ¶
func (m SQLMigrationModel) GetAllByDir(dir string, env string, table string) ([]*SQLMigration, error)
func (SQLMigrationModel) Remove ¶
func (m SQLMigrationModel) Remove(mig *SQLMigration) error
func (SQLMigrationModel) Update ¶
func (m SQLMigrationModel) Update(mig *SQLMigration) error
type SQLMigrationTable ¶
type SQLMigrationTable struct {
Table string `json:"table"`
Migrations []*SQLMigration `json:"migrations"`
}
type SQLMigrationTables ¶
type SQLMigrationTables struct {
Env string `json:"env"`
Tables []*SQLMigrationTable `json:"tables"`
}
type SQLMigrationTablesModel ¶
func (SQLMigrationTablesModel) Get ¶
func (m SQLMigrationTablesModel) Get(env string) (*SQLMigrationTables, error)
type SQLMigrationsLatest ¶
type SQLMigrationsLatestModel ¶
func (SQLMigrationsLatestModel) AutoUpdateLatest ¶
func (m SQLMigrationsLatestModel) AutoUpdateLatest(env string, table string) error
func (SQLMigrationsLatestModel) GetByEnv ¶
func (m SQLMigrationsLatestModel) GetByEnv(env string, table string) ([]*SQLMigrationsLatest, error)
func (SQLMigrationsLatestModel) Update ¶
func (m SQLMigrationsLatestModel) Update(mig *SQLMigrationsLatest) error
type SQLScript ¶
type SQLScript struct {
ProjectID int `json:"project_id"`
Project string `json:"project"`
FileLocation string `json:"file_location"`
FileID int `json:"file_id"`
SnippitID int `json:"snippit_id"`
SnippitName string `json:"snippit_name"`
SnippitLocation string `json:"snippit_location"`
Script string `json:"script"`
}
type SQLScriptModel ¶
func (SQLScriptModel) GetAll ¶
func (m SQLScriptModel) GetAll(projectName string) ([]*SQLScript, error)
func (SQLScriptModel) Register ¶
func (m SQLScriptModel) Register(script *SQLScript) error
Click to show internal directories.
Click to hide internal directories.