syncd: github.com/dreamans/syncd/model Index | Files

package model

import "github.com/dreamans/syncd/model"

Index

Package Files

deploy_apply.go deploy_build.go deploy_task.go model.go project.go project_member.go project_space.go server.go server_group.go user.go user_role.go user_token.go

func Count Uses

func Count(model interface{}, count *int, query QueryParam) bool

func Create Uses

func Create(model interface{}) bool

func Delete Uses

func Delete(model interface{}, query QueryParam) bool

func DeleteByPk Uses

func DeleteByPk(model interface{}) bool

func GetByPk Uses

func GetByPk(model interface{}, id interface{}) bool

func GetMulti Uses

func GetMulti(model interface{}, query QueryParam) bool

func GetOne Uses

func GetOne(model interface{}, query QueryParam) bool

func Update Uses

func Update(model interface{}, data interface{}, query QueryParam) bool

func UpdateByPk Uses

func UpdateByPk(model interface{}) bool

type DeployApply Uses

type DeployApply struct {
    ID                  int    `gorm:"primary_key"`
    SpaceId             int    `gorm:"type:int(11);not null;default:0"`
    ProjectId           int    `gorm:"type:int(11);not null;default:0"`
    Name                string `gorm:"type:varchar(100);not null;default:''"`
    Description         string `gorm:"type:varchar(500);not null;default:''"`
    BranchName          string `gorm:"type:varchar(100);not null;default:''"`
    CommitVersion       string `gorm:"type:varchar(50);not null;default:''"`
    AuditStatus         int    `gorm:"type:int(11);not null;default:0"`
    AuditRefusalReasion string `gorm:"type:varchar(500);not null;default:''"`
    Status              int    `gorm:"type:int(11);not null;default:0"`
    UserId              int    `gorm:"type:int(11);not null;default:0"`
    RollbackId          int    `gorm:"type:int(11);not null;default:0"`
    RollbackApplyId     int    `gorm:"type:int(11);not null;default:0"`
    IsRollbackApply     int    `gorm:"type:int(11);not null;default:0"`
    Ctime               int    `gorm:"type:int(11);not null;default:0"`
}

func (*DeployApply) Count Uses

func (m *DeployApply) Count(query QueryParam) (int, bool)

func (*DeployApply) Create Uses

func (m *DeployApply) Create() bool

func (*DeployApply) Delete Uses

func (m *DeployApply) Delete() bool

func (*DeployApply) Get Uses

func (m *DeployApply) Get(id int) bool

func (*DeployApply) List Uses

func (m *DeployApply) List(query QueryParam) ([]DeployApply, bool)

func (*DeployApply) TableName Uses

func (m *DeployApply) TableName() string

func (*DeployApply) Update Uses

func (m *DeployApply) Update() bool

func (*DeployApply) UpdateByFields Uses

func (m *DeployApply) UpdateByFields(data map[string]interface{}, query QueryParam) bool

type DeployBuild Uses

type DeployBuild struct {
    ID         int    `gorm:"primary_key"`
    ApplyId    int    `gorm:"type:int(11);not null;default:0"`
    StartTime  int    `gorm:"type:int(11);not null;default:0"`
    FinishTime int    `gorm:"type:int(11);not null;default:0"`
    Status     int    `gorm:"type:int(11);not null;default:0"`
    Tar        string `gorm:"type:varchar(2000);not null;default:''"`
    Output     string `gorm:"type:text;not null"`
    Errmsg     string `gorm:"type:text;not null"`
    Ctime      int    `gorm:"type:int(11);not null;default:0"`
}

func (*DeployBuild) Create Uses

func (m *DeployBuild) Create() bool

func (*DeployBuild) Delete Uses

func (m *DeployBuild) Delete() bool

func (*DeployBuild) GetByApplyId Uses

func (m *DeployBuild) GetByApplyId(id int) bool

func (*DeployBuild) TableName Uses

func (m *DeployBuild) TableName() string

func (*DeployBuild) UpdateByFields Uses

func (m *DeployBuild) UpdateByFields(data map[string]interface{}, query QueryParam) bool

type DeployTask Uses

type DeployTask struct {
    ID      int    `gorm:"primary_key"`
    ApplyId int    `gorm:"type:int(11);not null;default:0"`
    GroupId int    `gorm:"type:int(11);not null;default:0"`
    Status  int    `gorm:"type:int(11);not null;default:0"`
    Content string `gorm:"type:text;not null"`
    Ctime   int    `gorm:"type:int(11);not null;default:0"`
}

func (*DeployTask) Create Uses

func (m *DeployTask) Create() bool

func (*DeployTask) Delete Uses

func (m *DeployTask) Delete(query QueryParam) bool

func (*DeployTask) GetByApplyId Uses

func (m *DeployTask) GetByApplyId(id int) bool

func (*DeployTask) List Uses

func (m *DeployTask) List(query QueryParam) ([]DeployTask, bool)

func (*DeployTask) TableName Uses

func (m *DeployTask) TableName() string

func (*DeployTask) UpdateByFields Uses

func (m *DeployTask) UpdateByFields(data map[string]interface{}, query QueryParam) bool

type Project Uses

type Project struct {
    ID               int    `gorm:"primary_key"`
    SpaceId          int    `gorm:"type:int(11);not null;default:0"`
    Name             string `gorm:"type:varchar(100);not null;default:''"`
    Description      string `gorm:"type:varchar(500);not null;default:''"`
    NeedAudit        int    `gorm:"type:int(11);not null;default:0"`
    Status           int    `gorm:"type:int(11);not null;default:0"`
    RepoUrl          string `gorm:"type:varchar(500);not null;default:''"`
    DeployMode       int    `gorm:"type:int(11);not null;default:0"`
    RepoBranch       string `gorm:"type:varchar(100);not null;default:''"`
    OnlineCluster    string `gorm:"type:varchar(1000);not null;default:''"`
    DeployUser       string `gorm:"type:varchar(100);not null;default:''"`
    DeployPath       string `gorm:"type:varchar(500);not null;default:''"`
    BuildScript      string `gorm:"type:text;not null"`
    BuildHookScript  string `gorm:"type:text;not null"`
    DeployHookScript string `gorm:"type:text;not null"`
    PreDeployCmd     string `gorm:"type:text;not null"`
    AfterDeployCmd   string `gorm:"type:text;not null"`
    AuditNotice      string `gorm:"type:varchar(2000);not null;default:''"`
    DeployNotice     string `gorm:"type:varchar(2000);not null;default:''"`
    Ctime            int    `gorm:"type:int(11);not null;default:0"`
}

func (*Project) Count Uses

func (m *Project) Count(query QueryParam) (int, bool)

func (*Project) Create Uses

func (m *Project) Create() bool

func (*Project) Delete Uses

func (m *Project) Delete() bool

func (*Project) Get Uses

func (m *Project) Get(id int) bool

func (*Project) List Uses

func (m *Project) List(query QueryParam) ([]Project, bool)

func (*Project) TableName Uses

func (m *Project) TableName() string

func (*Project) Update Uses

func (m *Project) Update() bool

func (*Project) UpdateByFields Uses

func (m *Project) UpdateByFields(data map[string]interface{}, query QueryParam) bool

type ProjectMember Uses

type ProjectMember struct {
    ID      int `gorm:"primary_key"`
    SpaceId int `gorm:"type:int(11);not null;default:0"`
    UserId  int `gorm:"type:int(11);not null;default:0"`
    Ctime   int `gorm:"type:int(11);not null;default:0"`
}

func (*ProjectMember) Count Uses

func (m *ProjectMember) Count(query QueryParam) (int, bool)

func (*ProjectMember) Create Uses

func (m *ProjectMember) Create() bool

func (*ProjectMember) Delete Uses

func (m *ProjectMember) Delete() bool

func (*ProjectMember) Get Uses

func (m *ProjectMember) Get(id int) bool

func (*ProjectMember) List Uses

func (m *ProjectMember) List(query QueryParam) ([]ProjectMember, bool)

func (*ProjectMember) TableName Uses

func (m *ProjectMember) TableName() string

func (*ProjectMember) Update Uses

func (m *ProjectMember) Update() bool

type ProjectSpace Uses

type ProjectSpace struct {
    ID          int    `gorm:"primary_key"`
    Name        string `gorm:"type:varchar(100);not null;default:''"`
    Description string `gorm:"type:varchar(2000);not null;default:''"`
    Ctime       int    `gorm:"type:int(11);not null;default:0"`
}

func (*ProjectSpace) Count Uses

func (m *ProjectSpace) Count(query QueryParam) (int, bool)

func (*ProjectSpace) Create Uses

func (m *ProjectSpace) Create() bool

func (*ProjectSpace) Delete Uses

func (m *ProjectSpace) Delete() bool

func (*ProjectSpace) Get Uses

func (m *ProjectSpace) Get(id int) bool

func (*ProjectSpace) List Uses

func (m *ProjectSpace) List(query QueryParam) ([]ProjectSpace, bool)

func (*ProjectSpace) TableName Uses

func (m *ProjectSpace) TableName() string

func (*ProjectSpace) Update Uses

func (m *ProjectSpace) Update() bool

type QueryParam Uses

type QueryParam struct {
    Fields string
    Offset int
    Limit  int
    Order  string
    Where  []WhereParam
}

type Server Uses

type Server struct {
    ID      int    `gorm:"primary_key"`
    GroupId int    `gorm:"type:int(11);not null;default:0"`
    Name    string `gorm:"type:varchar(100);not null;default:''"`
    Ip      string `gorm:"type:varchar(100);not null;default:''"`
    SSHPort int    `gorm:"type:int(11);not null;default:0"`
    Ctime   int    `gorm:"type:int(11);not null;default:0"`
}

func (*Server) Count Uses

func (m *Server) Count(query QueryParam) (int, bool)

func (*Server) Create Uses

func (m *Server) Create() bool

func (*Server) Delete Uses

func (m *Server) Delete() bool

func (*Server) Get Uses

func (m *Server) Get(id int) bool

func (*Server) List Uses

func (m *Server) List(query QueryParam) ([]Server, bool)

func (*Server) TableName Uses

func (m *Server) TableName() string

func (*Server) Update Uses

func (m *Server) Update() bool

type ServerGroup Uses

type ServerGroup struct {
    ID    int    `gorm:"primary_key"`
    Name  string `gorm:"type:varchar(100);not null;default:''"`
    Ctime int    `gorm:"type:int(11);not null;default:0"`
}

func (*ServerGroup) Count Uses

func (m *ServerGroup) Count(query QueryParam) (int, bool)

func (*ServerGroup) Create Uses

func (m *ServerGroup) Create() bool

func (*ServerGroup) Delete Uses

func (m *ServerGroup) Delete() bool

func (*ServerGroup) Get Uses

func (m *ServerGroup) Get(id int) bool

func (*ServerGroup) List Uses

func (m *ServerGroup) List(query QueryParam) ([]ServerGroup, bool)

func (*ServerGroup) TableName Uses

func (m *ServerGroup) TableName() string

func (*ServerGroup) Update Uses

func (m *ServerGroup) Update() bool

type User Uses

type User struct {
    ID            int    `gorm:"primary_key"`
    RoleId        int    `gorm:"type:int(11);not null;default:0"`
    Username      string `gorm:"type:varchar(20);not null;default:''"`
    Password      string `gorm:"type:char(32);not null;default:''"`
    Salt          string `gorm:"type:char(10);not null;default:''"`
    Truename      string `gorm:"type:varchar(20);not null;default:''"`
    Mobile        string `gorm:"type:varchar(20);not null;default:''"`
    Email         string `gorm:"type:varchar(500);not null;default:''"`
    Status        int    `gorm:"type:int(11);not null;default:0"`
    LastLoginTime int    `gorm:"type:int(11);not null;default:0"`
    LastLoginIp   string `gorm:"type:varchar(50);not null;default:''"`
    Ctime         int    `gorm:"type:int(11);not null;default:0"`
}

func (*User) Count Uses

func (m *User) Count(query QueryParam) (int, bool)

func (*User) Create Uses

func (m *User) Create() bool

func (*User) Delete Uses

func (m *User) Delete() bool

func (*User) Get Uses

func (m *User) Get(id int) bool

func (*User) GetOne Uses

func (m *User) GetOne(query QueryParam) bool

func (*User) List Uses

func (m *User) List(query QueryParam) ([]User, bool)

func (*User) TableName Uses

func (m *User) TableName() string

func (*User) UpdateByFields Uses

func (m *User) UpdateByFields(data map[string]interface{}, query QueryParam) bool

type UserRole Uses

type UserRole struct {
    ID        int    `gorm:"primary_key"`
    Name      string `gorm:"type:varchar(100);not null;default:''"`
    Privilege string `gorm:"type:varchar(2000);not null;default:''"`
    Ctime     int    `gorm:"type:int(11);not null;default:0"`
}

func (*UserRole) Count Uses

func (m *UserRole) Count(query QueryParam) (int, bool)

func (*UserRole) Create Uses

func (m *UserRole) Create() bool

func (*UserRole) Delete Uses

func (m *UserRole) Delete() bool

func (*UserRole) Get Uses

func (m *UserRole) Get(id int) bool

func (*UserRole) List Uses

func (m *UserRole) List(query QueryParam) ([]UserRole, bool)

func (*UserRole) TableName Uses

func (m *UserRole) TableName() string

func (*UserRole) Update Uses

func (m *UserRole) Update() bool

type UserToken Uses

type UserToken struct {
    ID     int    `gorm:"primary_key"`
    UserId int    `gorm:"type:int(11);not null;default:0"`
    Token  string `gorm:"type:varchar(100);not null;default:''"`
    Expire int    `gorm:"type:int(11);not null;default:0"`
    Ctime  int    `gorm:"type:int(11);not null;default:0"`
}

func (*UserToken) Count Uses

func (m *UserToken) Count(query QueryParam) (int, bool)

func (*UserToken) Create Uses

func (m *UserToken) Create() bool

func (*UserToken) Delete Uses

func (m *UserToken) Delete() bool

func (*UserToken) DeleteByFields Uses

func (m *UserToken) DeleteByFields(query QueryParam) bool

func (*UserToken) Get Uses

func (m *UserToken) Get(id int) bool

func (*UserToken) GetOne Uses

func (m *UserToken) GetOne(query QueryParam) bool

func (*UserToken) List Uses

func (m *UserToken) List(query QueryParam) ([]UserToken, bool)

func (*UserToken) TableName Uses

func (m *UserToken) TableName() string

func (*UserToken) Update Uses

func (m *UserToken) Update() bool

func (*UserToken) UpdateByFields Uses

func (m *UserToken) UpdateByFields(data map[string]interface{}, query QueryParam) bool

type WhereParam Uses

type WhereParam struct {
    Field   string
    Tag     string
    Prepare interface{}
}

Package model imports 5 packages (graph) and is imported by 4 packages. Updated 2019-04-30. Refresh now. Tools for package owners.