dal

package
v0.0.0-...-acc84cd Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Count

func Count(dest interface{}, table string, where string) error

func CreateBackup

func CreateBackup(backup *Backup) (int, error)

CreateBackup create a backup entry in the backup's table

func CreateJob

func CreateJob(job *Job) (sql.Result, error)

CreateJob create a job entry in the job's table

func CreateMigration

func CreateMigration(migration *Migration) (int, error)

func CreateOption

func CreateOption(option *Option) (sql.Result, error)

CreateOption create a option entry in the option's table

func CreateOrUpdateOption

func CreateOrUpdateOption(option *Option) (sql.Result, error)

func CreateQueue

func CreateQueue(queue *Queue) (int, error)

CreateQueue create a queue entry in the queue's table

func CreateUser

func CreateUser(user *User) (sql.Result, error)

CreateUser create a user entry in the user's table

func DeleteAllQueues

func DeleteAllQueues() (sql.Result, error)

func DeleteBackup

func DeleteBackup(backupIden interface{}) (sql.Result, error)

func DeleteJob

func DeleteJob(jobIden interface{}) (sql.Result, error)

func DeleteMigration

func DeleteMigration(migrationIden interface{}) (sql.Result, error)

func DeleteQueue

func DeleteQueue(queueIden interface{}) (sql.Result, error)

func DeleteUser

func DeleteUser(userIden interface{}) (sql.Result, error)

func FindAllBackups

func FindAllBackups(dest interface{}) error

func FindAllJobsByBackup

func FindAllJobsByBackup(dest interface{}, backupIden interface{}, order string) error

func FindAllMigrations

func FindAllMigrations(dest interface{}) error

func FindAllOptions

func FindAllOptions(dest interface{}) error

func FindAllUsers

func FindAllUsers(dest interface{}) error

func FindBackupById

func FindBackupById(dest interface{}, backupIden interface{}) error

func FindBackups

func FindBackups(dest interface{}, order string, p *paginator.Paginator) error

func FindJobById

func FindJobById(dest interface{}, jobIden interface{}) error

func FindJobsByBackup

func FindJobsByBackup(dest interface{}, backupIden interface{}, order string, p *paginator.Paginator) error

func FindJobsIDByBackup

func FindJobsIDByBackup(dest interface{}, backupIden interface{}, order string) error

func FindMigrationById

func FindMigrationById(dest interface{}, migrationIden interface{}) error

func FindMigrations

func FindMigrations(dest interface{}, order string, p *paginator.Paginator) error

func FindMigrationsStatuses

func FindMigrationsStatuses(dest interface{}, order string, p *paginator.Paginator) error

func FindOptionByName

func FindOptionByName(dest interface{}, optionName interface{}) error

func FindQueueByTypeAndObject

func FindQueueByTypeAndObject(dest interface{}, t interface{}, o interface{}) error

func FindQueuesByObjectsIdsAndType

func FindQueuesByObjectsIdsAndType(dest interface{}, ids interface{}, t string, order string) error

func FindUserByEmail

func FindUserByEmail(dest interface{}, email string) error

FindUserByEmail searches the user's table with the email given

func FindUserById

func FindUserById(dest interface{}, userIden interface{}) error

func FindUsers

func FindUsers(dest interface{}, order string, p *paginator.Paginator) error

func SelectLatestJobForEachBackup

func SelectLatestJobForEachBackup(backupsIds []int) ([]types.SmallJob, error)

func SelectPaginatedJobsByBackup

func SelectPaginatedJobsByBackup(dest interface{}, backupIden interface{}, order string) error

func UpdateBackup

func UpdateBackup(data interface{}) (sql.Result, error)

func UpdateMigration

func UpdateMigration(data interface{}) (sql.Result, error)

func UpdateMigrationDatesAndStatuses

func UpdateMigrationDatesAndStatuses(migration *Migration, uf string, pf string) (sql.Result, error)

func UpdateMigrationHelper

func UpdateMigrationHelper(id int, status string, SetStartedAt bool, SetCompletedAt bool, nullValues bool, output string)

func UpdateUser

func UpdateUser(data *User) (sql.Result, error)

Types

type Backup

type Backup struct {
	ID               int            `db:"id"`
	CreatedAt        sql.NullTime   `db:"created_at"`
	UpdatedAt        sql.NullTime   `db:"updated_at"`
	DeletedAt        sql.NullTime   `db:"deleted_at"`
	Name             string         `db:"name"`
	Enable           bool           `db:"enable"`
	Frequency        string         `db:"frequency"`
	Timezone         string         `db:"timezone"`
	CustomFrequency  string         `db:"custom_frequency"`
	Type             string         `db:"type"`
	Bucket           string         `db:"bucket"`
	Region           string         `db:"region"`
	DbName           string         `db:"db_name"`
	DbUser           string         `db:"db_user"`
	DbPassword       string         `db:"db_password"`
	DbHost           string         `db:"db_host"`
	DbPort           string         `db:"db_port"`
	PodLabel         string         `db:"pod_label"`
	PodName          string         `db:"pod_name"`
	DayOfWeek        int            `db:"day_of_week"`
	DayOfMonth       int            `db:"day_of_month"`
	Month            int            `db:"month"`
	Time             string         `db:"time"`
	Container        string         `db:"container"`
	FilesPath        string         `db:"files_path"`
	S3AccessKey      string         `db:"s3_access_key"`
	S3SecretKey      string         `db:"s3_secret_key"`
	StorageDirectory string         `db:"storage_directory"`
	Retention        int            `db:"retention"`
	Emails           string         `db:"emails"`
	URI              sql.NullString `db:"uri"`
	User             int            `db:"user"`
}

Backup struct defines the Backup Model

type Job

type Job struct {
	ID          int          `db:"id"`
	CreatedAt   time.Time    `db:"created_at"`
	UpdatedAt   time.Time    `db:"updated_at"`
	CompletedAt sql.NullTime `db:"completed_at"`
	File        string       `db:"file"`
	Status      string       `db:"status"`
	Backup      int          `db:"backup"`
}

Job struct defines the Job Model

type Migration

type Migration struct {
	ID                   int            `db:"id"`
	CreatedAt            sql.NullTime   `db:"created_at"`
	UpdatedAt            sql.NullTime   `db:"updated_at"`
	DeletedAt            sql.NullTime   `db:"deleted_at"`
	StartedAt            sql.NullTime   `db:"started_at"`
	CompletedAt          sql.NullTime   `db:"completed_at"`
	Name                 string         `db:"name"`
	User                 int            `db:"user"`
	Timezone             string         `db:"timezone"`
	Emails               string         `db:"emails"`
	SrcType              string         `db:"src_type"`
	SrcAccess            string         `db:"src_access"`
	SrcBucket            string         `db:"src_bucket"`
	SrcRegion            string         `db:"src_region"`
	SrcDbName            string         `db:"src_db_name"`
	SrcDbUser            string         `db:"src_db_user"`
	SrcDbPassword        string         `db:"src_db_password"`
	SrcDbHost            string         `db:"src_db_host"`
	SrcDbPort            string         `db:"src_db_port"`
	SrcPodLabel          string         `db:"src_pod_label"`
	SrcPodName           string         `db:"src_pod_name"`
	SrcContainer         string         `db:"src_container"`
	SrcFilesPath         string         `db:"src_files_path"`
	SrcS3AccessKey       string         `db:"src_s3_access_key"`
	SrcS3SecretKey       string         `db:"src_s3_secret_key"`
	SrcS3File            string         `db:"src_s3_file"`
	SrcURI               string         `db:"src_uri"`
	SrcSshHost           string         `db:"src_ssh_host"`
	SrcSshPort           string         `db:"src_ssh_port"`
	SrcSshUser           string         `db:"src_ssh_user"`
	SrcSshKey            string         `db:"src_ssh_key"`
	SrcKubeconfig        string         `db:"src_kubeconfig"`
	DestType             string         `db:"dest_type"`
	DestAccess           string         `db:"dest_access"`
	DestBucket           string         `db:"dest_bucket"`
	DestRegion           string         `db:"dest_region"`
	DestDbName           string         `db:"dest_db_name"`
	DestDbUser           string         `db:"dest_db_user"`
	DestDbPassword       string         `db:"dest_db_password"`
	DestDbHost           string         `db:"dest_db_host"`
	DestDbPort           string         `db:"dest_db_port"`
	DestPodLabel         string         `db:"dest_pod_label"`
	DestPodName          string         `db:"dest_pod_name"`
	DestContainer        string         `db:"dest_container"`
	DestFilesPath        string         `db:"dest_files_path"`
	DestS3AccessKey      string         `db:"dest_s3_access_key"`
	DestS3SecretKey      string         `db:"dest_s3_secret_key"`
	DestStorageDirectory string         `db:"dest_storage_directory"`
	DestURI              string         `db:"dest_uri"`
	DestSshHost          string         `db:"dest_ssh_host"`
	DestSshPort          string         `db:"dest_ssh_port"`
	DestSshUser          string         `db:"dest_ssh_user"`
	DestSshKey           string         `db:"dest_ssh_key"`
	DestKubeconfig       string         `db:"dest_kubeconfig"`
	Status               sql.NullString `db:"status"`
	Output               sql.NullString `db:"output"`
}

type Option

type Option struct {
	ID        int       `db:"id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
	Name      string    `db:"name"`
	Value     string    `db:"value"`
}

Option struct defines the Option Model

type Queue

type Queue struct {
	ID        int          `db:"id"`
	CreatedAt time.Time    `db:"created_at"`
	UpdatedAt time.Time    `db:"updated_at"`
	DeletedAt sql.NullTime `db:"deleted_at"`
	Type      string       `db:"type"`
	Object    int          `db:"object"`
}

Queue struct defines the Queue Model

type User

type User struct {
	ID        int          `db:"id"`
	CreatedAt time.Time    `db:"created_at"`
	UpdatedAt time.Time    `db:"updated_at"`
	DeletedAt sql.NullTime `db:"deleted_at"`
	Name      string       `db:"name"`
	Email     string       `db:"email"`
	Password  string       `db:"password"`
}

User struct defines the user

Jump to

Keyboard shortcuts

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