models

package
v0.0.0-...-329f2e7 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddApiSystem

func AddApiSystem(m *ApiSystem) (id int64, err error)

AddApiSystem insert a new ApiSystem into database and returns last inserted Id on success.

func AddGroup

func AddGroup(m *Group) (id int64, err error)

AddGroup insert a new Group into database and returns last inserted Id on success.

func AddMigration

func AddMigration(m *Migration) (id int64, err error)

AddMigration insert a new Migration into database and returns last inserted Id on success.

func AddProject

func AddProject(m *Project) (id int64, err error)

AddProject insert a new Project into database and returns last inserted Id on success.

func AddRecord

func AddRecord(m *Record) (id int64, err error)

AddRecord insert a new Record into database and returns last inserted Id on success.

func AddSession

func AddSession(m *Session) (id int64, err error)

AddSession insert a new Session into database and returns last inserted Id on success.

func AddTask

func AddTask(m *Task) (id int64, err error)

AddTask insert a new Task into database and returns last inserted Id on success.

func AddTaskErrLog

func AddTaskErrLog(m *TaskErrLog) (id int64, err error)

AddTaskErrLog insert a new TaskErrLog into database and returns last inserted Id on success.

func AddUser

func AddUser(m *User) (id int64, err error)

AddUser insert a new User into database and returns last inserted Id on success.

func Connect

func Connect()

数据库连接

func DeleteApiSystem

func DeleteApiSystem(id int) (err error)

DeleteApiSystem deletes ApiSystem by Id and returns error if the record to be deleted doesn't exist

func DeleteGroup

func DeleteGroup(id int) (err error)

DeleteGroup deletes Group by Id and returns error if the record to be deleted doesn't exist

func DeleteMigration

func DeleteMigration(id int) (err error)

DeleteMigration deletes Migration by Id and returns error if the record to be deleted doesn't exist

func DeleteProject

func DeleteProject(id int) (err error)

DeleteProject deletes Project by Id and returns error if the record to be deleted doesn't exist

func DeleteRecord

func DeleteRecord(id int) (err error)

DeleteRecord deletes Record by Id and returns error if the record to be deleted doesn't exist

func DeleteSession

func DeleteSession(id int) (err error)

DeleteSession deletes Session by Id and returns error if the record to be deleted doesn't exist

func DeleteTask

func DeleteTask(id int) (err error)

DeleteTask deletes Task by Id and returns error if the record to be deleted doesn't exist

func DeleteTaskErrLog

func DeleteTaskErrLog(id int) (err error)

DeleteTaskErrLog deletes TaskErrLog by Id and returns error if the record to be deleted doesn't exist

func DeleteUser

func DeleteUser(id int) (err error)

DeleteUser deletes User by Id and returns error if the record to be deleted doesn't exist

func GetAllApiSystem

func GetAllApiSystem(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllApiSystem retrieves all ApiSystem matches certain condition. Returns empty list if no records exist

func GetAllGroup

func GetAllGroup(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllGroup retrieves all Group matches certain condition. Returns empty list if no records exist

func GetAllMigration

func GetAllMigration(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllMigration retrieves all Migration matches certain condition. Returns empty list if no records exist

func GetAllProject

func GetAllProject(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllProject retrieves all Project matches certain condition. Returns empty list if no records exist

func GetAllRecord

func GetAllRecord(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllRecord retrieves all Record matches certain condition. Returns empty list if no records exist

func GetAllSession

func GetAllSession(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllSession retrieves all Session matches certain condition. Returns empty list if no records exist

func GetAllTask

func GetAllTask(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllTask retrieves all Task matches certain condition. Returns empty list if no records exist

func GetAllTaskAndPro

func GetAllTaskAndPro(pro_name string, startTime string, endTime string) ([]orm.Params, error)

func GetAllTaskErrLog

func GetAllTaskErrLog(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllTaskErrLog retrieves all TaskErrLog matches certain condition. Returns empty list if no records exist

func GetAllUser

func GetAllUser(query map[string]string, fields []string, sortby []string, order []string,
	offset int64, limit int64) (ml []interface{}, err error)

GetAllUser retrieves all User matches certain condition. Returns empty list if no records exist

func Syncdb

func Syncdb()

func UpdateApiSystemById

func UpdateApiSystemById(m *ApiSystem) (err error)

UpdateApiSystem updates ApiSystem by Id and returns error if the record to be updated doesn't exist

func UpdateGroupById

func UpdateGroupById(m *Group) (err error)

UpdateGroup updates Group by Id and returns error if the record to be updated doesn't exist

func UpdateMigrationById

func UpdateMigrationById(m *Migration) (err error)

UpdateMigration updates Migration by Id and returns error if the record to be updated doesn't exist

func UpdateProjectById

func UpdateProjectById(m *Project) (err error)

UpdateProject updates Project by Id and returns error if the record to be updated doesn't exist

func UpdateRecordById

func UpdateRecordById(m *Record) (err error)

UpdateRecord updates Record by Id and returns error if the record to be updated doesn't exist

func UpdateSessionById

func UpdateSessionById(m *Session) (err error)

UpdateSession updates Session by Id and returns error if the record to be updated doesn't exist

func UpdateTaskById

func UpdateTaskById(m *Task) (err error)

UpdateTask updates Task by Id and returns error if the record to be updated doesn't exist

func UpdateTaskErrLogById

func UpdateTaskErrLogById(m *TaskErrLog) (err error)

UpdateTaskErrLog updates TaskErrLog by Id and returns error if the record to be updated doesn't exist

func UpdateUserById

func UpdateUserById(m *User) (err error)

UpdateUser updates User by Id and returns error if the record to be updated doesn't exist

Types

type ApiSystem

type ApiSystem struct {
	Id         int    `orm:"column(AppId);pk"`
	AppSecret  string `orm:"column(AppSecret);size(255);null"`
	SystemName string `orm:"column(SystemName);size(255);null"`
	IP         string `orm:"column(IP);size(255);null"`
	Operator   string `orm:"column(Operator);size(255);null"`
}

func GetApiSystemById

func GetApiSystemById(id int) (v *ApiSystem, err error)

GetApiSystemById retrieves ApiSystem by Id. Returns error if Id doesn't exist

func (*ApiSystem) TableName

func (t *ApiSystem) TableName() string

type Group

type Group struct {
	Id        int   `orm:"column(id);auto"`
	ProjectId uint  `orm:"column(project_id)"`
	UserId    int   `orm:"column(user_id)"`
	Type      int16 `orm:"column(type);null"`
}

func GetGroupById

func GetGroupById(id int) (v *Group, err error)

GetGroupById retrieves Group by Id. Returns error if Id doesn't exist

func (*Group) TableName

func (t *Group) TableName() string

type Migration

type Migration struct {
	Id        int `orm:"column(version);pk"`
	ApplyTime int `orm:"column(apply_time);null"`
}

func GetMigrationById

func GetMigrationById(id int) (v *Migration, err error)

GetMigrationById retrieves Migration by Id. Returns error if Id doesn't exist

func (*Migration) TableName

func (t *Migration) TableName() string

type Project

type Project struct {
	Id             int       `orm:"column(id);auto"`
	UserId         uint      `orm:"column(user_id)"`
	Name           string    `orm:"column(name);size(100);null"`
	Level          int16     `orm:"column(level)"`
	Status         int16     `orm:"column(status)"`
	Version        string    `orm:"column(version);size(32);null"`
	RepoUrl        string    `orm:"column(repo_url);type(text);null"`
	RepoUsername   string    `orm:"column(repo_username);size(50);null"`
	RepoPassword   string    `orm:"column(repo_password);size(100);null"`
	RepoMode       string    `orm:"column(repo_mode);size(50);null"`
	RepoType       string    `orm:"column(repo_type);size(10);null"`
	DeployFrom     string    `orm:"column(deploy_from);size(200)"`
	Excludes       string    `orm:"column(excludes);type(text);null"`
	ReleaseUser    string    `orm:"column(release_user);size(50)"`
	ReleaseTo      string    `orm:"column(release_to);size(200)"`
	ReleaseLibrary string    `orm:"column(release_library);type(text);size(200)"`
	Hosts          string    `orm:"column(hosts);type(text);null"`
	PreDeploy      string    `orm:"column(pre_deploy);type(text);null"`
	PostDeploy     string    `orm:"column(post_deploy);type(text);null"`
	PreRelease     string    `orm:"column(pre_release);type(text);null"`
	PostRelease    string    `orm:"column(post_release);type(text);null"`
	LastDeploy     string    `orm:"column(last_deploy);type(text);null"`
	Audit          int16     `orm:"column(audit);null"`
	KeepVersionNum int       `orm:"column(keep_version_num)"`
	CreatedAt      time.Time `orm:"column(created_at);type(datetime);null"`
	UpdatedAt      time.Time `orm:"column(updated_at);type(datetime);null"`
	P2p            int16     `orm:"column(p2p)"`
	HostGroup      string    `orm:"column(host_group)"`
	Gzip           int16     `orm:"column(gzip)"`
	IsGroup        int16     `orm:"column(is_group)"`
	PmsProName     string    `orm:"column(pms_pro_name);size(200)"`
}

func GetProjectById

func GetProjectById(id int) (v *Project, err error)

GetProjectById retrieves Project by Id. Returns error if Id doesn't exist

func (*Project) TableName

func (t *Project) TableName() string

type Record

type Record struct {
	Id        int    `orm:"column(id);auto"`
	UserId    uint   `orm:"column(user_id)"`
	TaskId    int64  `orm:"column(task_id)"`
	Status    int16  `orm:"column(status)"`
	Action    uint   `orm:"column(action);null"`
	Command   string `orm:"column(command);type(text);null"`
	Duration  int    `orm:"column(duration);null"`
	Memo      string `orm:"column(memo);type(text);null"`
	CreatedAt int    `orm:"column(created_at);null"`
}

func GetRecordById

func GetRecordById(id int) (v *Record, err error)

GetRecordById retrieves Record by Id. Returns error if Id doesn't exist

func (*Record) TableName

func (t *Record) TableName() string

type Session

type Session struct {
	Id     int    `orm:"column(id);pk"`
	Expire uint   `orm:"column(expire);null"`
	Data   string `orm:"column(data);null"`
}

func GetSessionById

func GetSessionById(id int) (v *Session, err error)

GetSessionById retrieves Session by Id. Returns error if Id doesn't exist

func (*Session) TableName

func (t *Session) TableName() string

type Task

type Task struct {
	Id             int       `orm:"column(id);auto"`
	UserId         uint      `orm:"column(user_id)"`
	ProjectId      int       `orm:"column(project_id)"`
	Action         int16     `orm:"column(action)"`
	Status         int16     `orm:"column(status)"`
	Title          string    `orm:"column(title);size(100);null"`
	LinkId         string    `orm:"column(link_id);size(20);null"`
	ExLinkId       string    `orm:"column(ex_link_id);size(20);null"`
	CommitId       string    `orm:"column(commit_id);size(800);null"`
	CreatedAt      time.Time `orm:"column(created_at);type(datetime);null"`
	UpdatedAt      time.Time `orm:"column(updated_at);type(datetime);null"`
	Branch         string    `orm:"column(branch);size(100);null"`
	FileList       string    `orm:"column(file_list);null"`
	EnableRollback int       `orm:"column(enable_rollback)"`
	PmsBatchId     int       `orm:"column(pms_batch_id);null"`
	PmsUworkId     int       `orm:"column(pms_uwork_id);null"`
	IsRun          int       `orm:"column(is_run);null"`
	FileMd5        string    `orm:"column(file_md5);size(200);null"`
	Hosts          string    `orm:"column(hosts);null"`
}

func GetTaskById

func GetTaskById(id int) (v *Task, err error)

GetTaskById retrieves Task by Id. Returns error if Id doesn't exist

func (*Task) TableName

func (t *Task) TableName() string

type TaskErrLog

type TaskErrLog struct {
	Id         int       `orm:"column(id);auto"`
	TaskId     int       `orm:"column(task_id);null"`
	ErrInfo    string    `orm:"column(err_info);null"`
	CreateTime time.Time `orm:"column(create_time);type(timestamp);null;auto_now"`
}

func GetTaskErrLogById

func GetTaskErrLogById(id int) (v *TaskErrLog, err error)

GetTaskErrLogById retrieves TaskErrLog by Id. Returns error if Id doesn't exist

func (*TaskErrLog) TableName

func (t *TaskErrLog) TableName() string

type User

type User struct {
	Id                     int       `orm:"column(id);auto"`
	Username               string    `orm:"column(username);size(255)"`
	IsEmailVerified        int8      `orm:"column(is_email_verified)"`
	AuthKey                string    `orm:"column(auth_key);size(32)"`
	PasswordHash           string    `orm:"column(password_hash);size(255)"`
	PasswordResetToken     string    `orm:"column(password_reset_token);size(255);null"`
	EmailConfirmationToken string    `orm:"column(email_confirmation_token);size(255);null"`
	Email                  string    `orm:"column(email);size(255)"`
	Avatar                 string    `orm:"column(avatar);size(100);null"`
	Role                   int16     `orm:"column(role)"`
	Status                 int16     `orm:"column(status)"`
	CreatedAt              time.Time `orm:"column(created_at);type(datetime)"`
	UpdatedAt              time.Time `orm:"column(updated_at);type(datetime)"`
	Realname               string    `orm:"column(realname);size(32)"`
}

func GetUserById

func GetUserById(id int) (v *User, err error)

GetUserById retrieves User by Id. Returns error if Id doesn't exist

func (*User) TableName

func (t *User) TableName() string

Jump to

Keyboard shortcuts

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