Documentation ¶
Index ¶
- type AppSystemInfo
- func NewAppSystemInfo(repo *AppSystemRepo, id int, appSystemName string, delFlag int, ...) *AppSystemInfo
- func NewAppSystemInfoWithDefault(appSystemName string, level int, ownerID int, ownerGroup string) *AppSystemInfo
- func NewAppSystemInfoWithGlobal(id int, appSystemName string, delFlag int, createTime time.Time, ...) *AppSystemInfo
- func NewEmptyAppSystemInfoWithGlobal() *AppSystemInfo
- func (asi *AppSystemInfo) Delete()
- func (asi *AppSystemInfo) Get(field string) (interface{}, error)
- func (asi *AppSystemInfo) GetCreateTime() time.Time
- func (asi *AppSystemInfo) GetLastUpdateTime() time.Time
- func (asi *AppSystemInfo) GetLevel() int
- func (asi *AppSystemInfo) GetOwnerGroup() string
- func (asi *AppSystemInfo) GetOwnerID() int
- func (asi *AppSystemInfo) Identity() string
- func (asi *AppSystemInfo) IsDeleted() bool
- func (asi *AppSystemInfo) MarshalJSON() ([]byte, error)
- func (asi *AppSystemInfo) MarshalJSONWithFields(fields ...string) ([]byte, error)
- func (asi *AppSystemInfo) Set(fields map[string]interface{}) error
- type AppSystemRepo
- func (asr *AppSystemRepo) Create(entity dependency.Entity) (dependency.Entity, error)
- func (asr *AppSystemRepo) Delete(id string) error
- func (asr *AppSystemRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
- func (asr *AppSystemRepo) GetAll() ([]dependency.Entity, error)
- func (asr *AppSystemRepo) GetByID(id string) (dependency.Entity, error)
- func (asr *AppSystemRepo) GetID(entity dependency.Entity) (string, error)
- func (asr *AppSystemRepo) Transaction() (middleware.Transaction, error)
- func (asr *AppSystemRepo) Update(entity dependency.Entity) error
- type AppSystemService
- func (ass *AppSystemService) Create(fields map[string]interface{}) error
- func (ass *AppSystemService) Delete(id string) error
- func (ass *AppSystemService) GetAll() error
- func (ass *AppSystemService) GetByID(id string) error
- func (ass *AppSystemService) GetEntities() []dependency.Entity
- func (ass *AppSystemService) Marshal() ([]byte, error)
- func (ass *AppSystemService) MarshalWithFields(fields ...string) ([]byte, error)
- func (ass *AppSystemService) Update(id string, fields map[string]interface{}) error
- type DbInfo
- func NewDbInfo(repo *DbRepo, id int, dbName string, clusterId int, clusterType int, ...) *DbInfo
- func NewDbInfoWithDefault(dbName, ownerId, envId string) *DbInfo
- func NewDbInfoWithGlobal(id int, dbName string, clusterId int, clusterType int, ownerId string, ...) *DbInfo
- func NewEmptyDbInfoWithGlobal() *DbInfo
- func (ei *DbInfo) Delete()
- func (ei *DbInfo) Get(field string) (interface{}, error)
- func (ei *DbInfo) GetCreateTime() time.Time
- func (ei *DbInfo) GetLastUpdateTime() time.Time
- func (ei *DbInfo) Identity() string
- func (ei *DbInfo) IsDeleted() bool
- func (ei *DbInfo) MarshalJSON() ([]byte, error)
- func (ei *DbInfo) MarshalJSONWithFields(fields ...string) ([]byte, error)
- func (ei *DbInfo) Set(fields map[string]interface{}) error
- type DbRepo
- func (er *DbRepo) Create(entity dependency.Entity) (dependency.Entity, error)
- func (er *DbRepo) Delete(id string) error
- func (er *DbRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
- func (er *DbRepo) GetAll() ([]dependency.Entity, error)
- func (er *DbRepo) GetByID(id string) (dependency.Entity, error)
- func (er *DbRepo) GetID(entity dependency.Entity) (string, error)
- func (er *DbRepo) Transaction() (middleware.Transaction, error)
- func (er *DbRepo) Update(entity dependency.Entity) error
- type DbService
- func (es *DbService) Create(fields map[string]interface{}) error
- func (es *DbService) Delete(id string) error
- func (es *DbService) GetAll() error
- func (es *DbService) GetByID(id string) error
- func (es *DbService) GetEntities() []dependency.Entity
- func (es *DbService) Marshal() ([]byte, error)
- func (es *DbService) MarshalWithFields(fields ...string) ([]byte, error)
- func (es *DbService) Update(id string, fields map[string]interface{}) error
- type EnvInfo
- func NewEmptyEnvInfoWithGlobal() *EnvInfo
- func NewEnvInfo(repo *EnvRepo, id int, envName string, delFlag int, createTime time.Time, ...) *EnvInfo
- func NewEnvInfoWithDefault(envName string) *EnvInfo
- func NewEnvInfoWithGlobal(id int, envName string, delFlag int, createTime time.Time, ...) *EnvInfo
- func NewEnvInfoWithMapAndRandom(fields map[string]interface{}) (*EnvInfo, error)
- func (ei *EnvInfo) Delete()
- func (ei *EnvInfo) Get(field string) (interface{}, error)
- func (ei *EnvInfo) GetCreateTime() time.Time
- func (ei *EnvInfo) GetLastUpdateTime() time.Time
- func (ei *EnvInfo) Identity() string
- func (ei *EnvInfo) IsDeleted() bool
- func (ei *EnvInfo) MarshalJSON() ([]byte, error)
- func (ei *EnvInfo) MarshalJSONWithFields(fields ...string) ([]byte, error)
- func (ei *EnvInfo) Set(fields map[string]interface{}) error
- type EnvRepo
- func (er *EnvRepo) Create(entity dependency.Entity) (dependency.Entity, error)
- func (er *EnvRepo) Delete(id string) error
- func (er *EnvRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
- func (er *EnvRepo) GetAll() ([]dependency.Entity, error)
- func (er *EnvRepo) GetByID(id string) (dependency.Entity, error)
- func (er *EnvRepo) GetID(entity dependency.Entity) (string, error)
- func (er *EnvRepo) Transaction() (middleware.Transaction, error)
- func (er *EnvRepo) Update(entity dependency.Entity) error
- type EnvService
- func (es *EnvService) Create(fields map[string]interface{}) error
- func (es *EnvService) Delete(id string) error
- func (es *EnvService) GetAll() error
- func (es *EnvService) GetByID(id string) error
- func (es *EnvService) GetEntities() []dependency.Entity
- func (es *EnvService) Marshal() ([]byte, error)
- func (es *EnvService) MarshalWithFields(fields ...string) ([]byte, error)
- func (es *EnvService) Update(id string, fields map[string]interface{}) error
- type MSInfo
- func NewEmptyMSInfoWithGlobal() *MSInfo
- func NewMSInfo(repo *MSRepo, id int, systemName string, systemType string, hostIp string, ...) *MSInfo
- func NewMSInfoWithDefault(mSName, systemType, hostIp, portNum, portNumSlow, baseUrl string) *MSInfo
- func NewMSInfoWithGlobal(id int, mSName, systemType, hostIp, portNum, portNumSlow, baseUrl string, ...) *MSInfo
- func (ei *MSInfo) Delete()
- func (ei *MSInfo) Get(field string) (interface{}, error)
- func (ei *MSInfo) GetCreateTime() time.Time
- func (ei *MSInfo) GetLastUpdateTime() time.Time
- func (ei *MSInfo) Identity() string
- func (ei *MSInfo) IsDeleted() bool
- func (ei *MSInfo) MarshalJSON() ([]byte, error)
- func (ei *MSInfo) MarshalJSONWithFields(fields ...string) ([]byte, error)
- func (ei *MSInfo) Set(fields map[string]interface{}) error
- type MSRepo
- func (er *MSRepo) Create(entity dependency.Entity) (dependency.Entity, error)
- func (er *MSRepo) Delete(id string) error
- func (er *MSRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
- func (er *MSRepo) GetAll() ([]dependency.Entity, error)
- func (er *MSRepo) GetByID(id string) (dependency.Entity, error)
- func (er *MSRepo) GetID(entity dependency.Entity) (string, error)
- func (er *MSRepo) Transaction() (middleware.Transaction, error)
- func (er *MSRepo) Update(entity dependency.Entity) error
- type MSService
- func (es *MSService) Create(fields map[string]interface{}) error
- func (es *MSService) Delete(id string) error
- func (es *MSService) GetAll() error
- func (es *MSService) GetByID(id string) error
- func (es *MSService) GetEntities() []dependency.Entity
- func (es *MSService) Marshal() ([]byte, error)
- func (es *MSService) MarshalWithFields(fields ...string) ([]byte, error)
- func (es *MSService) Update(id string, fields map[string]interface{}) error
- type MYSQLClusterInfo
- func NewEmptyMYSQLClusterInfoWithGlobal() *MYSQLClusterInfo
- func NewMYSQLClusterInfo(repo *MYSQLClusterRepo, id int, clusterName string, middlewareClusterID int, ...) *MYSQLClusterInfo
- func NewMYSQLClusterInfoWithDefault(clusterName string) *MYSQLClusterInfo
- func NewMYSQLClusterInfoWithGlobal(id int, clusterName string, middlewareClusterID int, monitorSystemID int, ...) *MYSQLClusterInfo
- func (mci *MYSQLClusterInfo) Delete()
- func (mci *MYSQLClusterInfo) Get(field string) (interface{}, error)
- func (mci *MYSQLClusterInfo) GetCreateTime() time.Time
- func (mci *MYSQLClusterInfo) GetLastUpdateTime() time.Time
- func (mci *MYSQLClusterInfo) Identity() string
- func (mci *MYSQLClusterInfo) IsDeleted() bool
- func (mci *MYSQLClusterInfo) MarshalJSON() ([]byte, error)
- func (mci *MYSQLClusterInfo) MarshalJSONWithFields(fields ...string) ([]byte, error)
- func (mci *MYSQLClusterInfo) Set(fields map[string]interface{}) error
- type MYSQLClusterRepo
- func (er *MYSQLClusterRepo) Create(entity dependency.Entity) (dependency.Entity, error)
- func (er *MYSQLClusterRepo) Delete(id string) error
- func (er *MYSQLClusterRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
- func (er *MYSQLClusterRepo) GetAll() ([]dependency.Entity, error)
- func (er *MYSQLClusterRepo) GetByID(id string) (dependency.Entity, error)
- func (er *MYSQLClusterRepo) GetID(entity dependency.Entity) (string, error)
- func (er *MYSQLClusterRepo) Transaction() (middleware.Transaction, error)
- func (er *MYSQLClusterRepo) Update(entity dependency.Entity) error
- type MYSQLClusterService
- func (es *MYSQLClusterService) Create(fields map[string]interface{}) error
- func (es *MYSQLClusterService) Delete(id string) error
- func (es *MYSQLClusterService) GetAll() error
- func (es *MYSQLClusterService) GetByID(id string) error
- func (es *MYSQLClusterService) GetEntities() []dependency.Entity
- func (es *MYSQLClusterService) Marshal() ([]byte, error)
- func (es *MYSQLClusterService) MarshalWithFields(fields ...string) ([]byte, error)
- func (es *MYSQLClusterService) Update(id string, fields map[string]interface{}) error
- type MYSQLServerInfo
- func NewEmptyMYSQLServerInfoWithGlobal() *MYSQLServerInfo
- func NewMYSQLServerInfo(repo *MYSQLServerRepo, id int, clusterID int, hostIP string, portNum int, ...) *MYSQLServerInfo
- func NewMYSQLServerInfoWithDefault(hostIP string, portNum int) *MYSQLServerInfo
- func NewMYSQLServerInfoWithGlobal(id int, clusterID int, hostIP string, portNum int, deploymentType int, ...) *MYSQLServerInfo
- func (mci *MYSQLServerInfo) Delete()
- func (mci *MYSQLServerInfo) Get(field string) (interface{}, error)
- func (mci *MYSQLServerInfo) GetCreateTime() time.Time
- func (mci *MYSQLServerInfo) GetLastUpdateTime() time.Time
- func (mci *MYSQLServerInfo) Identity() string
- func (mci *MYSQLServerInfo) IsDeleted() bool
- func (mci *MYSQLServerInfo) MarshalJSON() ([]byte, error)
- func (mci *MYSQLServerInfo) MarshalJSONWithFields(fields ...string) ([]byte, error)
- func (mci *MYSQLServerInfo) Set(fields map[string]interface{}) error
- type MYSQLServerRepo
- func (er *MYSQLServerRepo) Create(entity dependency.Entity) (dependency.Entity, error)
- func (er *MYSQLServerRepo) Delete(id string) error
- func (er *MYSQLServerRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
- func (er *MYSQLServerRepo) GetAll() ([]dependency.Entity, error)
- func (er *MYSQLServerRepo) GetByID(id string) (dependency.Entity, error)
- func (er *MYSQLServerRepo) GetID(entity dependency.Entity) (string, error)
- func (er *MYSQLServerRepo) Transaction() (middleware.Transaction, error)
- func (er *MYSQLServerRepo) Update(entity dependency.Entity) error
- type MYSQLServerService
- func (es *MYSQLServerService) Create(fields map[string]interface{}) error
- func (es *MYSQLServerService) Delete(id string) error
- func (es *MYSQLServerService) GetAll() error
- func (es *MYSQLServerService) GetByID(id string) error
- func (es *MYSQLServerService) GetEntities() []dependency.Entity
- func (es *MYSQLServerService) Marshal() ([]byte, error)
- func (es *MYSQLServerService) MarshalWithFields(fields ...string) ([]byte, error)
- func (es *MYSQLServerService) Update(id string, fields map[string]interface{}) error
- type MiddlewareClusterInfo
- func NewEmptyMiddlewareClusterInfoWithGlobal() *MiddlewareClusterInfo
- func NewMiddlewareClusterInfo(repo *MiddlewareClusterRepo, id int, middlewareClusterName string, envID int, ...) *MiddlewareClusterInfo
- func NewMiddlewareClusterInfoWithDefault(middlewareClusterName string, envID int) *MiddlewareClusterInfo
- func NewMiddlewareClusterInfoWithGlobal(id int, middlewareClusterName string, envID int, delFlag int, ...) *MiddlewareClusterInfo
- func NewMiddlewareClusterInfoWithMapAndRandom(fields map[string]interface{}) (*MiddlewareClusterInfo, error)
- func (mci *MiddlewareClusterInfo) Delete()
- func (mci *MiddlewareClusterInfo) Get(field string) (interface{}, error)
- func (mci *MiddlewareClusterInfo) GetCreateTime() time.Time
- func (mci *MiddlewareClusterInfo) GetLastUpdateTime() time.Time
- func (mci *MiddlewareClusterInfo) Identity() string
- func (mci *MiddlewareClusterInfo) IsDeleted() bool
- func (mci *MiddlewareClusterInfo) MarshalJSON() ([]byte, error)
- func (mci *MiddlewareClusterInfo) MarshalJSONWithFields(fields ...string) ([]byte, error)
- func (mci *MiddlewareClusterInfo) Set(fields map[string]interface{}) error
- type MiddlewareClusterRepo
- func (mcr *MiddlewareClusterRepo) Create(entity dependency.Entity) (dependency.Entity, error)
- func (mcr *MiddlewareClusterRepo) Delete(id string) error
- func (mcr *MiddlewareClusterRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
- func (mcr *MiddlewareClusterRepo) GetAll() ([]dependency.Entity, error)
- func (mcr *MiddlewareClusterRepo) GetByID(id string) (dependency.Entity, error)
- func (mcr *MiddlewareClusterRepo) GetID(entity dependency.Entity) (string, error)
- func (mcr *MiddlewareClusterRepo) Transaction() (middleware.Transaction, error)
- func (mcr *MiddlewareClusterRepo) Update(entity dependency.Entity) error
- type MiddlewareClusterService
- func (mcs *MiddlewareClusterService) Create(fields map[string]interface{}) error
- func (mcs *MiddlewareClusterService) Delete(id string) error
- func (mcs *MiddlewareClusterService) GetAll() error
- func (mcs *MiddlewareClusterService) GetByID(id string) error
- func (mcs *MiddlewareClusterService) GetEntities() []dependency.Entity
- func (mcs *MiddlewareClusterService) Marshal() ([]byte, error)
- func (mcs *MiddlewareClusterService) MarshalWithFields(fields ...string) ([]byte, error)
- func (mcs *MiddlewareClusterService) Update(id string, fields map[string]interface{}) error
- type MiddlewareServerInfo
- func NewEmptyMiddlewareServerInfoWithGlobal() *MiddlewareServerInfo
- func NewMiddlewareServerInfo(repo *MiddlewareServerRepo, id int, clusterID int, serverName string, ...) *MiddlewareServerInfo
- func NewMiddlewareServerInfoWithDefault(clusterID int, serverName string, middlewareRole int, hostIP string, ...) *MiddlewareServerInfo
- func NewMiddlewareServerInfoWithGlobal(id int, clusterID int, serverName string, middlewareRole int, hostIP string, ...) *MiddlewareServerInfo
- func NewMiddlewareServerInfoWithMapAndRandom(fields map[string]interface{}) (*MiddlewareServerInfo, error)
- func (msi *MiddlewareServerInfo) Delete()
- func (msi *MiddlewareServerInfo) Get(field string) (interface{}, error)
- func (msi *MiddlewareServerInfo) GetCreateTime() time.Time
- func (msi *MiddlewareServerInfo) GetLastUpdateTime() time.Time
- func (msi *MiddlewareServerInfo) Identity() string
- func (msi *MiddlewareServerInfo) IsDeleted() bool
- func (msi *MiddlewareServerInfo) MarshalJSON() ([]byte, error)
- func (msi *MiddlewareServerInfo) MarshalJSONWithFields(fields ...string) ([]byte, error)
- func (msi *MiddlewareServerInfo) Set(fields map[string]interface{}) error
- type MiddlewareServerRepo
- func (msr *MiddlewareServerRepo) Create(entity dependency.Entity) (dependency.Entity, error)
- func (msr *MiddlewareServerRepo) Delete(id string) error
- func (msr *MiddlewareServerRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
- func (msr *MiddlewareServerRepo) GetAll() ([]dependency.Entity, error)
- func (msr *MiddlewareServerRepo) GetByID(id string) (dependency.Entity, error)
- func (msr *MiddlewareServerRepo) GetID(entity dependency.Entity) (string, error)
- func (msr *MiddlewareServerRepo) Transaction() (middleware.Transaction, error)
- func (msr *MiddlewareServerRepo) Update(entity dependency.Entity) error
- type MiddlewareServerService
- func (mss *MiddlewareServerService) Create(fields map[string]interface{}) error
- func (mss *MiddlewareServerService) Delete(id string) error
- func (mss *MiddlewareServerService) GetAll() error
- func (mss *MiddlewareServerService) GetByID(id string) error
- func (mss *MiddlewareServerService) GetEntities() []dependency.Entity
- func (mss *MiddlewareServerService) Marshal() ([]byte, error)
- func (mss *MiddlewareServerService) MarshalWithFields(fields ...string) ([]byte, error)
- func (mss *MiddlewareServerService) Update(id string, fields map[string]interface{}) error
- type UserInfo
- func NewEmptyUserInfoWithGlobal() *UserInfo
- func NewUserInfo(repo *UserRepo, id int, userName string, delFlag int, createTime time.Time, ...) *UserInfo
- func NewUserInfoWithDefault(userName string, departmentName string, employeeID int, domainAccount string, ...) *UserInfo
- func NewUserInfoWithGlobal(id int, userName string, delFlag int, createTime time.Time, ...) *UserInfo
- func (ui *UserInfo) Delete()
- func (ui *UserInfo) Get(field string) (interface{}, error)
- func (ui *UserInfo) GetCreateTime() time.Time
- func (ui *UserInfo) GetDepartmentName() string
- func (ui *UserInfo) GetDomainAccount() string
- func (ui *UserInfo) GetEmail() string
- func (ui *UserInfo) GetEmployeeID() int
- func (ui *UserInfo) GetLastUpdateTime() time.Time
- func (ui *UserInfo) GetRole() int
- func (ui *UserInfo) GetTelephone() string
- func (ui *UserInfo) Identity() string
- func (ui *UserInfo) IsDeleted() bool
- func (ui *UserInfo) MarshalJSON() ([]byte, error)
- func (ui *UserInfo) MarshalJSONWithFields(fields ...string) ([]byte, error)
- func (ui *UserInfo) Set(fields map[string]interface{}) error
- type UserRepo
- func (ur *UserRepo) Create(entity dependency.Entity) (dependency.Entity, error)
- func (ur *UserRepo) Delete(id string) error
- func (ur *UserRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
- func (ur *UserRepo) GetAll() ([]dependency.Entity, error)
- func (ur *UserRepo) GetByID(id string) (dependency.Entity, error)
- func (ur *UserRepo) GetID(entity dependency.Entity) (string, error)
- func (ur *UserRepo) Transaction() (middleware.Transaction, error)
- func (ur *UserRepo) Update(entity dependency.Entity) error
- type UserService
- func (us *UserService) Create(fields map[string]interface{}) error
- func (us *UserService) Delete(id string) error
- func (us *UserService) GetAll() error
- func (us *UserService) GetByID(id string) error
- func (us *UserService) GetEntities() []dependency.Entity
- func (us *UserService) Marshal() ([]byte, error)
- func (us *UserService) MarshalWithFields(fields ...string) ([]byte, error)
- func (us *UserService) Update(id string, fields map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppSystemInfo ¶
type AppSystemInfo struct { dependency.Repository ID int `middleware:"id" json:"id"` AppSystemName string `middleware:"system_name" json:"system_name"` DelFlag int `middleware:"del_flag" json:"del_flag"` CreateTime time.Time `middleware:"create_time" json:"create_time"` LastUpdateTime time.Time `middleware:"last_update_time" json:"last_update_time"` Level int `middleware:"level" json:"level"` OwnerID int `middleware:"owner_id" json:"owner_id"` OwnerGroup string `middleware:"owner_group" json:"owner_group"` }
func NewAppSystemInfo ¶
func NewAppSystemInfo(repo *AppSystemRepo, id int, appSystemName string, delFlag int, createTime time.Time, lastUpdateTime time.Time, level int, ownerID int, ownerGroup string) *AppSystemInfo
NewAppSystemInfo returns a new AppSystemInfo
func NewAppSystemInfoWithDefault ¶
func NewAppSystemInfoWithDefault(appSystemName string, level int, ownerID int, ownerGroup string) *AppSystemInfo
NewAppSystemInfoWithDefault returns a new AppSystemInfo with default AppSystemRepo
func NewAppSystemInfoWithGlobal ¶
func NewAppSystemInfoWithGlobal(id int, appSystemName string, delFlag int, createTime time.Time, lastUpdateTime time.Time, level int, ownerID int, ownerGroup string) *AppSystemInfo
NewAppSystemInfo returns a new AppSystemInfo with default AppSystemRepo
func NewEmptyAppSystemInfoWithGlobal ¶
func NewEmptyAppSystemInfoWithGlobal() *AppSystemInfo
func (*AppSystemInfo) Delete ¶
func (asi *AppSystemInfo) Delete()
Delete sets DelFlag to true, need to use Save to write to the middleware
func (*AppSystemInfo) Get ¶
func (asi *AppSystemInfo) Get(field string) (interface{}, error)
Get returns value of given field
func (*AppSystemInfo) GetCreateTime ¶
func (asi *AppSystemInfo) GetCreateTime() time.Time
GetCreateTime returns created time of entity
func (*AppSystemInfo) GetLastUpdateTime ¶
func (asi *AppSystemInfo) GetLastUpdateTime() time.Time
GetLastUpdateTime returns last updated time of entity
func (*AppSystemInfo) GetLevel ¶
func (asi *AppSystemInfo) GetLevel() int
GetLevel returns last updated time of entity
func (*AppSystemInfo) GetOwnerGroup ¶
func (asi *AppSystemInfo) GetOwnerGroup() string
GetOwnerGroup returns last updated time of entity
func (*AppSystemInfo) GetOwnerID ¶
func (asi *AppSystemInfo) GetOwnerID() int
GetOwnerID returns last updated time of entity
func (*AppSystemInfo) Identity ¶
func (asi *AppSystemInfo) Identity() string
Identity returns ID of entity
func (*AppSystemInfo) IsDeleted ¶
func (asi *AppSystemInfo) IsDeleted() bool
IsDeleted checks if delete flag had been set
func (*AppSystemInfo) MarshalJSON ¶
func (asi *AppSystemInfo) MarshalJSON() ([]byte, error)
MarshalJSON marshals entity to json string, it only marshals fields that has default tag
func (*AppSystemInfo) MarshalJSONWithFields ¶
func (asi *AppSystemInfo) MarshalJSONWithFields(fields ...string) ([]byte, error)
MarshalJSONWithFields marshals only with specified fields of entity to json string
func (*AppSystemInfo) Set ¶
func (asi *AppSystemInfo) Set(fields map[string]interface{}) error
Set sets entity with given fields, key is the field name and value is the relevant value of the key
type AppSystemRepo ¶
type AppSystemRepo struct {
Database middleware.Pool
}
func NewAppSystemRepo ¶
func NewAppSystemRepo(db middleware.Pool) *AppSystemRepo
NewAppSystemRepo returns *AppSystemRepo with given middleware.Pool
func NewAppSystemRepoWithGlobal ¶
func NewAppSystemRepoWithGlobal() *AppSystemRepo
NewAppSystemRepoWithGlobal returns *AppSystemRepo with global mysql pool
func (*AppSystemRepo) Create ¶
func (asr *AppSystemRepo) Create(entity dependency.Entity) (dependency.Entity, error)
Create creates data with given entity in the middleware
func (*AppSystemRepo) Delete ¶
func (asr *AppSystemRepo) Delete(id string) error
Delete deletes data in the middleware, it is recommended to use soft deletion, therefore use update instead of delete
func (*AppSystemRepo) Execute ¶
func (asr *AppSystemRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
Execute implements dependency.Repository interface, it executes command with arguments on database
func (*AppSystemRepo) GetAll ¶
func (asr *AppSystemRepo) GetAll() ([]dependency.Entity, error)
GetAll returns all available entities
func (*AppSystemRepo) GetByID ¶
func (asr *AppSystemRepo) GetByID(id string) (dependency.Entity, error)
func (*AppSystemRepo) GetID ¶
func (asr *AppSystemRepo) GetID(entity dependency.Entity) (string, error)
GetID checks identity of given entity from the middleware
func (*AppSystemRepo) Transaction ¶
func (asr *AppSystemRepo) Transaction() (middleware.Transaction, error)
func (*AppSystemRepo) Update ¶
func (asr *AppSystemRepo) Update(entity dependency.Entity) error
Update updates data with given entity in the middleware
type AppSystemService ¶
type AppSystemService struct { dependency.Repository Entities []dependency.Entity }
func NewAppSystemService ¶
func NewAppSystemService(repo dependency.Repository) *AppSystemService
NewAppSystemService returns a new *AppSystemService
func NewAppSystemServiceWithDefault ¶
func NewAppSystemServiceWithDefault() *AppSystemService
NewAppSystemServiceWithDefault returns a new *AppSystemService with default repository
func (*AppSystemService) Create ¶
func (ass *AppSystemService) Create(fields map[string]interface{}) error
Create creates entity and insert it into the middleware
func (*AppSystemService) Delete ¶
func (ass *AppSystemService) Delete(id string) error
Delete delet entity that contains the given id in the middleware
func (*AppSystemService) GetAll ¶
func (ass *AppSystemService) GetAll() error
GetAll ge entities from the middleware
func (*AppSystemService) GetByID ¶
func (ass *AppSystemService) GetByID(id string) error
GetByID g entity that contains the given id from the middleware
func (*AppSystemService) GetEntities ¶
func (ass *AppSystemService) GetEntities() []dependency.Entity
GetEntities returns entities of the service
func (*AppSystemService) Marshal ¶
func (ass *AppSystemService) Marshal() ([]byte, error)
Marshal marshals service.Entities
func (*AppSystemService) MarshalWithFields ¶
func (ass *AppSystemService) MarshalWithFields(fields ...string) ([]byte, error)
Marshal marshals service.Entities with given fields
func (*AppSystemService) Update ¶
func (ass *AppSystemService) Update(id string, fields map[string]interface{}) error
Update gets an AppSystem entity that contains the given id from the middleware, and then update its fields that was specified in fields argument, key is the filed name and value is the new field value, it saves the changes to the middleware
type DbInfo ¶
type DbInfo struct { dependency.Repository ID int `middleware:"id" json:"id"` DbName string `middleware:"db_name" json:"db_name"` ClusterId int `middleware:"cluster_id" json:"cluster_id"` ClusterType int `middleware:"cluster_type" json:"cluster_type"` OwnerId string `middleware:"owner_id" json:"owner_id"` OwnerGroup string `middleware:"owner_group" json:"owner_group"` EnvId string `middleware:"env_id" json:"env_id"` DelFlag int `middleware:"del_flag" json:"del_flag"` CreateTime time.Time `middleware:"create_time" json:"create_time"` LastUpdateTime time.Time `middleware:"last_update_time" json:"last_update_time"` }
func NewDbInfo ¶
func NewDbInfo(repo *DbRepo, id int, dbName string, clusterId int, clusterType int, ownerId string, ownerGroup string, envId string, delFlag int, createTime time.Time, lastUpdateTime time.Time) *DbInfo
NewDbInfo returns a new DbInfo
func NewDbInfoWithDefault ¶
NewDbInfoWithDefault returns a new DbInfo with default DbRepo
func NewDbInfoWithGlobal ¶
func NewDbInfoWithGlobal(id int, dbName string, clusterId int, clusterType int, ownerId string, ownerGroup string, envId string, delFlag int, createTime time.Time, lastUpdateTime time.Time) *DbInfo
NewDbInfo returns a new DbInfo with default DbRepo
func NewEmptyDbInfoWithGlobal ¶
func NewEmptyDbInfoWithGlobal() *DbInfo
func (*DbInfo) Delete ¶
func (ei *DbInfo) Delete()
Delete sets DelFlag to true, need to use Save to write to the middleware
func (*DbInfo) GetCreateTime ¶
GetCreateTime returns created time of entity
func (*DbInfo) GetLastUpdateTime ¶
GetLastUpdateTime returns last updated time of entity
func (*DbInfo) MarshalJSON ¶
MarshalJSON marshals entity to json string, it only marshals fields that has default tag
func (*DbInfo) MarshalJSONWithFields ¶
MarshalJSONWithFields marshals only with specified fields of entity to json string
type DbRepo ¶
type DbRepo struct {
Database middleware.Pool
}
func NewDbRepo ¶
func NewDbRepo(db middleware.Pool) *DbRepo
NewDbRepo returns *DbRepo with given middleware.Pool
func NewDbRepoWithGlobal ¶
func NewDbRepoWithGlobal() *DbRepo
NewDbRepo returns *DbRepo with global mysql pool
func (*DbRepo) Create ¶
func (er *DbRepo) Create(entity dependency.Entity) (dependency.Entity, error)
Create creates data with given entity in the middleware
func (*DbRepo) Delete ¶
Delete deletes data in the middleware, it is recommended to use soft deletion, therefore use update instead of delete
func (*DbRepo) Execute ¶
func (er *DbRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
Execute implements dependency.Repository interface, it executes command with arguments on database
func (*DbRepo) GetAll ¶
func (er *DbRepo) GetAll() ([]dependency.Entity, error)
GetAll returns all available entities
func (*DbRepo) GetID ¶
func (er *DbRepo) GetID(entity dependency.Entity) (string, error)
GetID checks identity of given entity from the middleware
func (*DbRepo) Transaction ¶
func (er *DbRepo) Transaction() (middleware.Transaction, error)
type DbService ¶
type DbService struct { dependency.Repository Entities []dependency.Entity }
func NewDbService ¶
func NewDbService(repo dependency.Repository) *DbService
NewDbService returns a new *DbService
func NewDbServiceWithDefault ¶
func NewDbServiceWithDefault() *DbService
NewDbServiceWithDefault returns a new *DbService with default repository
func (*DbService) Delete ¶
Delete deletes the database entity that contains the given id in the middleware
func (*DbService) GetByID ¶
GetByID gets an database entity that contains the given id from the middleware
func (*DbService) GetEntities ¶
func (es *DbService) GetEntities() []dependency.Entity
GetEntities returns entities of the service
func (*DbService) MarshalWithFields ¶
Marshal marshals service.Entities with given fields
type EnvInfo ¶
type EnvInfo struct { dependency.Repository ID int `middleware:"id" json:"id"` EnvName string `middleware:"env_name" json:"env_name"` DelFlag int `middleware:"del_flag" json:"del_flag"` CreateTime time.Time `middleware:"create_time" json:"create_time"` LastUpdateTime time.Time `middleware:"last_update_time" json:"last_update_time"` }
func NewEmptyEnvInfoWithGlobal ¶
func NewEmptyEnvInfoWithGlobal() *EnvInfo
NewEmptyEnvInfoWithGlobal returns a new *EnvInfo with global repository
func NewEnvInfo ¶
func NewEnvInfo(repo *EnvRepo, id int, envName string, delFlag int, createTime time.Time, lastUpdateTime time.Time) *EnvInfo
NewEnvInfo returns a new *EnvInfo
func NewEnvInfoWithDefault ¶
NewEnvInfoWithDefault returns a new *EnvInfo with default EnvRepo
func NewEnvInfoWithGlobal ¶
func NewEnvInfoWithGlobal(id int, envName string, delFlag int, createTime time.Time, lastUpdateTime time.Time) *EnvInfo
NewEnvInfo returns a new *EnvInfo with default EnvRepo
func NewEnvInfoWithMapAndRandom ¶
NewEnvInfoWithMapAndRandom returns a new *EnvInfo with given map
func (*EnvInfo) Delete ¶
func (ei *EnvInfo) Delete()
Delete sets DelFlag to true, need to use Save to write to the middleware
func (*EnvInfo) GetCreateTime ¶
GetCreateTime returns created time of entity
func (*EnvInfo) GetLastUpdateTime ¶
GetLastUpdateTime returns last updated time of entity
func (*EnvInfo) MarshalJSON ¶
MarshalJSON marshals entity to json string, it only marshals fields that has default tag
func (*EnvInfo) MarshalJSONWithFields ¶
MarshalJSONWithFields marshals only with specified fields of entity to json string
type EnvRepo ¶
type EnvRepo struct {
Database middleware.Pool
}
func NewEnvRepo ¶
func NewEnvRepo(db middleware.Pool) *EnvRepo
NewEnvRepo returns *EnvRepo with given middleware.Pool
func NewEnvRepoWithGlobal ¶
func NewEnvRepoWithGlobal() *EnvRepo
NewEnvRepoWithGlobal returns *EnvRepo with global mysql pool
func (*EnvRepo) Create ¶
func (er *EnvRepo) Create(entity dependency.Entity) (dependency.Entity, error)
Create creates data with given entity in the middleware
func (*EnvRepo) Delete ¶
Delete deletes data in the middleware, it is recommended to use soft deletion, therefore use update instead of delete
func (*EnvRepo) Execute ¶
func (er *EnvRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
Execute implements dependency.Repository interface, it executes command with arguments on database
func (*EnvRepo) GetAll ¶
func (er *EnvRepo) GetAll() ([]dependency.Entity, error)
GetAll returns all available entities
func (*EnvRepo) GetID ¶
func (er *EnvRepo) GetID(entity dependency.Entity) (string, error)
GetID checks identity of given entity from the middleware
func (*EnvRepo) Transaction ¶
func (er *EnvRepo) Transaction() (middleware.Transaction, error)
Transaction implements dependency.Repository interface
type EnvService ¶
type EnvService struct { dependency.Repository Entities []dependency.Entity }
EnvService implements Service interface
func NewEnvService ¶
func NewEnvService(repo dependency.Repository) *EnvService
NewEnvService returns a new *EnvService
func NewEnvServiceWithDefault ¶
func NewEnvServiceWithDefault() *EnvService
NewEnvServiceWithDefault returns a new *EnvService with default repository
func (*EnvService) Create ¶
func (es *EnvService) Create(fields map[string]interface{}) error
Create creates a new environment entity and insert it into the middleware
func (*EnvService) Delete ¶
func (es *EnvService) Delete(id string) error
Delete deletes the environment entity that contains the given id in the middleware
func (*EnvService) GetAll ¶
func (es *EnvService) GetAll() error
GetAll gets all environment entities from the middleware
func (*EnvService) GetByID ¶
func (es *EnvService) GetByID(id string) error
GetByID gets an environment entity that contains the given id from the middleware
func (*EnvService) GetEntities ¶
func (es *EnvService) GetEntities() []dependency.Entity
GetEntities returns entities of the service
func (*EnvService) Marshal ¶
func (es *EnvService) Marshal() ([]byte, error)
Marshal marshals service.Entities
func (*EnvService) MarshalWithFields ¶
func (es *EnvService) MarshalWithFields(fields ...string) ([]byte, error)
MarshalWithFields marshals service.Entities with given fields
func (*EnvService) Update ¶
func (es *EnvService) Update(id string, fields map[string]interface{}) error
Update gets an environment entity that contains the given id from the middleware, and then update its fields that was specified in fields argument, key is the filed name and value is the new field value, it saves the changes to the middleware
type MSInfo ¶
type MSInfo struct { dependency.Repository ID int `middleware:"id" json:"id"` MSName string `middleware:"system_name" json:"system_name"` SystemType string `middleware:"system_type" json:"system_type"` HostIp string `middleware:"host_ip" json:"host_ip"` PortNum string `middleware:"port_num" json:"port_num"` PortNumSlow string `middleware:"port_num_slow" json:"port_num_slow"` BaseUrl string `middleware:"base_url" json:"base_url"` DelFlag int `middleware:"del_flag" json:"del_flag"` CreateTime time.Time `middleware:"create_time" json:"create_time"` LastUpdateTime time.Time `middleware:"last_update_time" json:"last_update_time"` }
func NewEmptyMSInfoWithGlobal ¶
func NewEmptyMSInfoWithGlobal() *MSInfo
func NewMSInfo ¶
func NewMSInfo(repo *MSRepo, id int, systemName string, systemType string, hostIp string, portNum string, portNumSlow string, baseUrl string, delFlag int, createTime time.Time, lastUpdateTime time.Time) *MSInfo
NewMSInfo returns a new MSInfo
func NewMSInfoWithDefault ¶
NewMSInfoWithDefault returns a new MSInfo with default MSRepo
func NewMSInfoWithGlobal ¶
func NewMSInfoWithGlobal(id int, mSName, systemType, hostIp, portNum, portNumSlow, baseUrl string, delFlag int, createTime time.Time, lastUpdateTime time.Time) *MSInfo
NewMSInfo returns a new MSInfo with default MSRepo
func (*MSInfo) Delete ¶
func (ei *MSInfo) Delete()
Delete sets DelFlag to true, need to use Save to write to the middleware
func (*MSInfo) GetCreateTime ¶
GetCreateTime returns created time of entity
func (*MSInfo) GetLastUpdateTime ¶
GetLastUpdateTime returns last updated time of entity
func (*MSInfo) MarshalJSON ¶
MarshalJSON marshals entity to json string, it only marshals fields that has default tag
func (*MSInfo) MarshalJSONWithFields ¶
MarshalJSONWithFields marshals only with specified fields of entity to json string
type MSRepo ¶
type MSRepo struct {
Database middleware.Pool
}
func NewMSRepo ¶
func NewMSRepo(db middleware.Pool) *MSRepo
NewMSRepo returns *MSRepo with given middleware.Pool
func NewMSRepoWithGlobal ¶
func NewMSRepoWithGlobal() *MSRepo
NewMSRepo returns *MSRepo with global mysql pool
func (*MSRepo) Create ¶
func (er *MSRepo) Create(entity dependency.Entity) (dependency.Entity, error)
Create creates data with given entity in the middleware
func (*MSRepo) Delete ¶
Delete deletes data in the middleware, it is recommended to use soft deletion, therefore use update instead of delete
func (*MSRepo) Execute ¶
func (er *MSRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
Execute implements dependency.Repository interface, it executes command with arguments on database
func (*MSRepo) GetAll ¶
func (er *MSRepo) GetAll() ([]dependency.Entity, error)
GetAll returns all available entities
func (*MSRepo) GetID ¶
func (er *MSRepo) GetID(entity dependency.Entity) (string, error)
GetID checks identity of given entity from the middleware
func (*MSRepo) Transaction ¶
func (er *MSRepo) Transaction() (middleware.Transaction, error)
type MSService ¶
type MSService struct { dependency.Repository Entities []dependency.Entity }
func NewMSService ¶
func NewMSService(repo dependency.Repository) *MSService
NewMSService returns a new *MSService
func NewMSServiceWithDefault ¶
func NewMSServiceWithDefault() *MSService
NewMSServiceWithDefault returns a new *MSService with default repository
func (*MSService) Create ¶
Create creates a new monitor system entity and insert it into the middleware
func (*MSService) Delete ¶
Delete deletes the monitor system entity that contains the given id in the middleware
func (*MSService) GetByID ¶
GetByID gets an monitor system entity that contains the given id from the middleware
func (*MSService) GetEntities ¶
func (es *MSService) GetEntities() []dependency.Entity
GetEntities returns entities of the service
func (*MSService) MarshalWithFields ¶
Marshal marshals service.Entities with given fields
type MYSQLClusterInfo ¶
type MYSQLClusterInfo struct { dependency.Repository ID int `middleware:"id" json:"id"` ClusterName string `middleware:"cluster_name" json:"cluster_name"` MiddlewareClusterID int `middleware:"middleware_cluster_id" json:"middleware_cluster_id"` MonitorSystemID int `middleware:"monitor_system_id" json:"monitor_system_id"` OwnerID int `middleware:"owner_id" json:"owner_id"` OwnerGroup string `middleware:"owner_group" json:"owner_group"` EnvID int `middleware:"env_id" json:"env_id"` DelFlag int `middleware:"del_flag" json:"del_flag"` CreateTime time.Time `middleware:"create_time" json:"create_time"` LastUpdateTime time.Time `middleware:"last_update_time" json:"last_update_time"` }
MYSQLClusterInfo is a struct map to table in the database
func NewEmptyMYSQLClusterInfoWithGlobal ¶
func NewEmptyMYSQLClusterInfoWithGlobal() *MYSQLClusterInfo
NewEmptyMYSQLClusterInfoWithGlobal returns a new MYSQLClusterInfo with default MYSQLClusterRepo
func NewMYSQLClusterInfo ¶
func NewMYSQLClusterInfo(repo *MYSQLClusterRepo, id int, clusterName string, middlewareClusterID int, monitorSystemID int, ownerID int, ownerGroup string, envID int, delFlag int, createTime, lastUpdateTime time.Time) *MYSQLClusterInfo
NewMYSQLClusterInfo returns a new MYSQLClusterInfo
func NewMYSQLClusterInfoWithDefault ¶
func NewMYSQLClusterInfoWithDefault(clusterName string) *MYSQLClusterInfo
NewMYSQLClusterInfoWithDefault returns a new MYSQLClusterInfo with default MYSQLClusterRepo
func NewMYSQLClusterInfoWithGlobal ¶
func NewMYSQLClusterInfoWithGlobal( id int, clusterName string, middlewareClusterID int, monitorSystemID int, ownerID int, ownerGroup string, envID int, delFlag int, createTime, lastUpdateTime time.Time) *MYSQLClusterInfo
NewMYSQLClusterInfoWithGlobal returns a new MYSQLClusterInfo with default MYSQLClusterRepo
func (*MYSQLClusterInfo) Delete ¶
func (mci *MYSQLClusterInfo) Delete()
Delete sets DelFlag to true, need to use Save to write to the middleware
func (*MYSQLClusterInfo) Get ¶
func (mci *MYSQLClusterInfo) Get(field string) (interface{}, error)
Get returns value of given field
func (*MYSQLClusterInfo) GetCreateTime ¶
func (mci *MYSQLClusterInfo) GetCreateTime() time.Time
GetCreateTime returns created time of entity
func (*MYSQLClusterInfo) GetLastUpdateTime ¶
func (mci *MYSQLClusterInfo) GetLastUpdateTime() time.Time
GetLastUpdateTime returns last updated time of entity
func (*MYSQLClusterInfo) Identity ¶
func (mci *MYSQLClusterInfo) Identity() string
Identity returns ID of entity
func (*MYSQLClusterInfo) IsDeleted ¶
func (mci *MYSQLClusterInfo) IsDeleted() bool
IsDeleted checks if delete flag had been set
func (*MYSQLClusterInfo) MarshalJSON ¶
func (mci *MYSQLClusterInfo) MarshalJSON() ([]byte, error)
MarshalJSON marshals entity to json string, it only marshals fields that has default tag
func (*MYSQLClusterInfo) MarshalJSONWithFields ¶
func (mci *MYSQLClusterInfo) MarshalJSONWithFields(fields ...string) ([]byte, error)
MarshalJSONWithFields marshals only with specified fields of entity to json string
func (*MYSQLClusterInfo) Set ¶
func (mci *MYSQLClusterInfo) Set(fields map[string]interface{}) error
Set sets entity with given fields, key is the field name and value is the relevant value of the key
type MYSQLClusterRepo ¶
type MYSQLClusterRepo struct {
Database middleware.Pool
}
MYSQLClusterRepo implements Repository interface
func NewMYSQLClusterRepo ¶
func NewMYSQLClusterRepo(db middleware.Pool) *MYSQLClusterRepo
NewMYSQLClusterRepo returns *MYSQLClusterRepo with given middleware.Pool
func NewMYSQLClusterRepoWithGlobal ¶
func NewMYSQLClusterRepoWithGlobal() *MYSQLClusterRepo
NewMYSQLClusterRepoWithGlobal returns *MYSQLClusterRepo with global mysql pool
func (*MYSQLClusterRepo) Create ¶
func (er *MYSQLClusterRepo) Create(entity dependency.Entity) (dependency.Entity, error)
Create creates data with given entity in the middleware
func (*MYSQLClusterRepo) Delete ¶
func (er *MYSQLClusterRepo) Delete(id string) error
Delete deletes data in the middleware, it is recommended to use soft deletion, therefore use update instead of delete
func (*MYSQLClusterRepo) Execute ¶
func (er *MYSQLClusterRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
Execute implements dependency.Repository interface, it executes command with arguments on database
func (*MYSQLClusterRepo) GetAll ¶
func (er *MYSQLClusterRepo) GetAll() ([]dependency.Entity, error)
GetAll returns all available entities
func (*MYSQLClusterRepo) GetByID ¶
func (er *MYSQLClusterRepo) GetByID(id string) (dependency.Entity, error)
GetByID Select returns an available entity of the given id
func (*MYSQLClusterRepo) GetID ¶
func (er *MYSQLClusterRepo) GetID(entity dependency.Entity) (string, error)
GetID checks identity of given entity from the middleware
func (*MYSQLClusterRepo) Transaction ¶
func (er *MYSQLClusterRepo) Transaction() (middleware.Transaction, error)
Transaction returns middleware.PoolConn
func (*MYSQLClusterRepo) Update ¶
func (er *MYSQLClusterRepo) Update(entity dependency.Entity) error
Update updates data with given entity in the middleware
type MYSQLClusterService ¶
type MYSQLClusterService struct { dependency.Repository Entities []dependency.Entity }
MYSQLClusterService implements Service interface
func NewMYSQLClusterService ¶
func NewMYSQLClusterService(repo dependency.Repository) *MYSQLClusterService
NewMYSQLClusterService returns a new *MYSQLClusterService
func NewMYSQLClusterServiceWithDefault ¶
func NewMYSQLClusterServiceWithDefault() *MYSQLClusterService
NewMYSQLClusterServiceWithDefault returns a new *MYSQLClusterService with default repository
func (*MYSQLClusterService) Create ¶
func (es *MYSQLClusterService) Create(fields map[string]interface{}) error
Create creates a new environment entity and insert it into the middleware
func (*MYSQLClusterService) Delete ¶
func (es *MYSQLClusterService) Delete(id string) error
Delete deletes the environment entity that contains the given id in the middleware
func (*MYSQLClusterService) GetAll ¶
func (es *MYSQLClusterService) GetAll() error
GetAll gets all environment entities from the middleware
func (*MYSQLClusterService) GetByID ¶
func (es *MYSQLClusterService) GetByID(id string) error
GetByID gets an environment entity that contains the given id from the middleware
func (*MYSQLClusterService) GetEntities ¶
func (es *MYSQLClusterService) GetEntities() []dependency.Entity
GetEntities returns entities of the service
func (*MYSQLClusterService) Marshal ¶
func (es *MYSQLClusterService) Marshal() ([]byte, error)
Marshal marshals service.Entities
func (*MYSQLClusterService) MarshalWithFields ¶
func (es *MYSQLClusterService) MarshalWithFields(fields ...string) ([]byte, error)
MarshalWithFields marshals service.Entities with given fields
func (*MYSQLClusterService) Update ¶
func (es *MYSQLClusterService) Update(id string, fields map[string]interface{}) error
Update gets an environment entity that contains the given id from the middleware, and then update its fields that was specified in fields argument, key is the filed name and value is the new field value, it saves the changes to the middleware
type MYSQLServerInfo ¶
type MYSQLServerInfo struct { dependency.Repository ID int `middleware:"id" json:"id"` ClusterID int `middleware:"cluster_id" json:"cluster_id"` HostIP string `middleware:"host_ip" json:"host_ip"` PortNum int `middleware:"port_num" json:"port_num"` DeploymentType int `middleware:"deployment_type" json:"deployment_type"` Version string `middleware:"version" json:"version"` DelFlag int `middleware:"del_flag" json:"del_flag"` CreateTime time.Time `middleware:"create_time" json:"create_time"` LastUpdateTime time.Time `middleware:"last_update_time" json:"last_update_time"` }
MYSQLServerInfo is a struct map to table in the database
func NewEmptyMYSQLServerInfoWithGlobal ¶
func NewEmptyMYSQLServerInfoWithGlobal() *MYSQLServerInfo
NewEmptyMYSQLServerInfoWithGlobal returns a new MYSQLServerInfo with default MYSQLServerRepo
func NewMYSQLServerInfo ¶
func NewMYSQLServerInfo(repo *MYSQLServerRepo, id int, clusterID int, hostIP string, portNum int, deploymentType int, version string, delFlag int, createTime, lastUpdateTime time.Time) *MYSQLServerInfo
NewMYSQLServerInfo returns a new MYSQLServerInfo
func NewMYSQLServerInfoWithDefault ¶
func NewMYSQLServerInfoWithDefault(hostIP string, portNum int) *MYSQLServerInfo
NewMYSQLServerInfoWithDefault returns a new MYSQLServerInfo with default MYSQLServerRepo
func NewMYSQLServerInfoWithGlobal ¶
func NewMYSQLServerInfoWithGlobal( id int, clusterID int, hostIP string, portNum int, deploymentType int, version string, delFlag int, createTime, lastUpdateTime time.Time) *MYSQLServerInfo
NewMYSQLServerInfoWithGlobal returns a new MYSQLServerInfo with default MYSQLServerRepo
func (*MYSQLServerInfo) Delete ¶
func (mci *MYSQLServerInfo) Delete()
Delete sets DelFlag to true, need to use Save to write to the middleware
func (*MYSQLServerInfo) Get ¶
func (mci *MYSQLServerInfo) Get(field string) (interface{}, error)
Get returns value of given field
func (*MYSQLServerInfo) GetCreateTime ¶
func (mci *MYSQLServerInfo) GetCreateTime() time.Time
GetCreateTime returns created time of entity
func (*MYSQLServerInfo) GetLastUpdateTime ¶
func (mci *MYSQLServerInfo) GetLastUpdateTime() time.Time
GetLastUpdateTime returns last updated time of entity
func (*MYSQLServerInfo) Identity ¶
func (mci *MYSQLServerInfo) Identity() string
Identity returns ID of entity
func (*MYSQLServerInfo) IsDeleted ¶
func (mci *MYSQLServerInfo) IsDeleted() bool
IsDeleted checks if delete flag had been set
func (*MYSQLServerInfo) MarshalJSON ¶
func (mci *MYSQLServerInfo) MarshalJSON() ([]byte, error)
MarshalJSON marshals entity to json string, it only marshals fields that has default tag
func (*MYSQLServerInfo) MarshalJSONWithFields ¶
func (mci *MYSQLServerInfo) MarshalJSONWithFields(fields ...string) ([]byte, error)
MarshalJSONWithFields marshals only with specified fields of entity to json string
func (*MYSQLServerInfo) Set ¶
func (mci *MYSQLServerInfo) Set(fields map[string]interface{}) error
Set sets entity with given fields, key is the field name and value is the relevant value of the key
type MYSQLServerRepo ¶
type MYSQLServerRepo struct {
Database middleware.Pool
}
MYSQLServerRepo implements Repository interface
func NewMYSQLServerRepo ¶
func NewMYSQLServerRepo(db middleware.Pool) *MYSQLServerRepo
NewMYSQLServerRepo returns *MYSQLServerRepo with given middleware.Pool
func NewMYSQLServerRepoWithGlobal ¶
func NewMYSQLServerRepoWithGlobal() *MYSQLServerRepo
NewMYSQLServerRepoWithGlobal returns *MYSQLServerRepo with global mysql pool
func (*MYSQLServerRepo) Create ¶
func (er *MYSQLServerRepo) Create(entity dependency.Entity) (dependency.Entity, error)
Create creates data with given entity in the middleware
func (*MYSQLServerRepo) Delete ¶
func (er *MYSQLServerRepo) Delete(id string) error
Delete deletes data in the middleware, it is recommended to use soft deletion, therefore use update instead of delete
func (*MYSQLServerRepo) Execute ¶
func (er *MYSQLServerRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
Execute implements dependency.Repository interface, it executes command with arguments on database
func (*MYSQLServerRepo) GetAll ¶
func (er *MYSQLServerRepo) GetAll() ([]dependency.Entity, error)
GetAll returns all available entities
func (*MYSQLServerRepo) GetByID ¶
func (er *MYSQLServerRepo) GetByID(id string) (dependency.Entity, error)
GetByID Select returns an available entity of the given id
func (*MYSQLServerRepo) GetID ¶
func (er *MYSQLServerRepo) GetID(entity dependency.Entity) (string, error)
GetID checks identity of given entity from the middleware
func (*MYSQLServerRepo) Transaction ¶
func (er *MYSQLServerRepo) Transaction() (middleware.Transaction, error)
Transaction returns middleware.PoolConn
func (*MYSQLServerRepo) Update ¶
func (er *MYSQLServerRepo) Update(entity dependency.Entity) error
Update updates data with given entity in the middleware
type MYSQLServerService ¶
type MYSQLServerService struct { dependency.Repository Entities []dependency.Entity }
MYSQLServerService implements Service interface
func NewMYSQLServerService ¶
func NewMYSQLServerService(repo dependency.Repository) *MYSQLServerService
NewMYSQLServerService returns a new *MYSQLServerService
func NewMYSQLServerServiceWithDefault ¶
func NewMYSQLServerServiceWithDefault() *MYSQLServerService
NewMYSQLServerServiceWithDefault returns a new *MYSQLServerService with default repository
func (*MYSQLServerService) Create ¶
func (es *MYSQLServerService) Create(fields map[string]interface{}) error
Create creates a new environment entity and insert it into the middleware
func (*MYSQLServerService) Delete ¶
func (es *MYSQLServerService) Delete(id string) error
Delete deletes the environment entity that contains the given id in the middleware
func (*MYSQLServerService) GetAll ¶
func (es *MYSQLServerService) GetAll() error
GetAll gets all environment entities from the middleware
func (*MYSQLServerService) GetByID ¶
func (es *MYSQLServerService) GetByID(id string) error
GetByID gets an environment entity that contains the given id from the middleware
func (*MYSQLServerService) GetEntities ¶
func (es *MYSQLServerService) GetEntities() []dependency.Entity
GetEntities returns entities of the service
func (*MYSQLServerService) Marshal ¶
func (es *MYSQLServerService) Marshal() ([]byte, error)
Marshal marshals service.Entities
func (*MYSQLServerService) MarshalWithFields ¶
func (es *MYSQLServerService) MarshalWithFields(fields ...string) ([]byte, error)
MarshalWithFields marshals service.Entities with given fields
func (*MYSQLServerService) Update ¶
func (es *MYSQLServerService) Update(id string, fields map[string]interface{}) error
Update gets an environment entity that contains the given id from the middleware, and then update its fields that was specified in fields argument, key is the filed name and value is the new field value, it saves the changes to the middleware
type MiddlewareClusterInfo ¶
type MiddlewareClusterInfo struct { dependency.Repository ID int `middleware:"id" json:"id"` ClusterName string `middleware:"cluster_name" json:"cluster_name"` EnvID int `middleware:"env_id" json:"env_id"` DelFlag int `middleware:"del_flag" json:"del_flag"` CreateTime time.Time `middleware:"create_time" json:"create_time"` LastUpdateTime time.Time `middleware:"last_update_time" json:"last_update_time"` }
func NewEmptyMiddlewareClusterInfoWithGlobal ¶
func NewEmptyMiddlewareClusterInfoWithGlobal() *MiddlewareClusterInfo
func NewMiddlewareClusterInfo ¶
func NewMiddlewareClusterInfo(repo *MiddlewareClusterRepo, id int, middlewareClusterName string, envID int, delFlag int, createTime time.Time, lastUpdateTime time.Time) *MiddlewareClusterInfo
NewMiddlewareClusterInfo returns a new MiddlewareClusterInfo
func NewMiddlewareClusterInfoWithDefault ¶
func NewMiddlewareClusterInfoWithDefault(middlewareClusterName string, envID int) *MiddlewareClusterInfo
NewMiddlewareClusterInfoWithDefault returns a new MiddlewareClusterInfo with default MiddlewareClusterRepo
func NewMiddlewareClusterInfoWithGlobal ¶
func NewMiddlewareClusterInfoWithGlobal(id int, middlewareClusterName string, envID int, delFlag int, createTime time.Time, lastUpdateTime time.Time) *MiddlewareClusterInfo
NewMiddlewareClusterInfo returns a new MiddlewareClusterInfo with default MiddlewareClusterRepo
func NewMiddlewareClusterInfoWithMapAndRandom ¶
func NewMiddlewareClusterInfoWithMapAndRandom(fields map[string]interface{}) (*MiddlewareClusterInfo, error)
NewMiddlewareClusterInfoWithMapAndRandom returns a new *MiddlewareClusterInfoInfo with given map
func (*MiddlewareClusterInfo) Delete ¶
func (mci *MiddlewareClusterInfo) Delete()
Delete sets DelFlag to true, need to use Save to write to the middleware
func (*MiddlewareClusterInfo) Get ¶
func (mci *MiddlewareClusterInfo) Get(field string) (interface{}, error)
Get returns value of given field
func (*MiddlewareClusterInfo) GetCreateTime ¶
func (mci *MiddlewareClusterInfo) GetCreateTime() time.Time
GetCreateTime returns created time of entity
func (*MiddlewareClusterInfo) GetLastUpdateTime ¶
func (mci *MiddlewareClusterInfo) GetLastUpdateTime() time.Time
GetLastUpdateTime returns last updated time of entity
func (*MiddlewareClusterInfo) Identity ¶
func (mci *MiddlewareClusterInfo) Identity() string
Identity returns ID of entity
func (*MiddlewareClusterInfo) IsDeleted ¶
func (mci *MiddlewareClusterInfo) IsDeleted() bool
IsDeleted checks if delete flag had been set
func (*MiddlewareClusterInfo) MarshalJSON ¶
func (mci *MiddlewareClusterInfo) MarshalJSON() ([]byte, error)
MarshalJSON marshals entity to json string, it only marshals fields that has default tag
func (*MiddlewareClusterInfo) MarshalJSONWithFields ¶
func (mci *MiddlewareClusterInfo) MarshalJSONWithFields(fields ...string) ([]byte, error)
MarshalJSONWithFields marshals only with specified fields of entity to json string
func (*MiddlewareClusterInfo) Set ¶
func (mci *MiddlewareClusterInfo) Set(fields map[string]interface{}) error
Set sets entity with given fields, key is the field name and value is the relevant value of the key
type MiddlewareClusterRepo ¶
type MiddlewareClusterRepo struct {
Database middleware.Pool
}
func NewMiddlewareClusterRepo ¶
func NewMiddlewareClusterRepo(db middleware.Pool) *MiddlewareClusterRepo
NewMiddlewareClusterRepo returns *MiddlewareClusterRepo with given middleware.Pool
func NewMiddlewareClusterRepoWithGlobal ¶
func NewMiddlewareClusterRepoWithGlobal() *MiddlewareClusterRepo
NewMiddlewareClusterRepo returns *MiddlewareClusterRepo with global mysql pool
func (*MiddlewareClusterRepo) Create ¶
func (mcr *MiddlewareClusterRepo) Create(entity dependency.Entity) (dependency.Entity, error)
Create creates data with given entity in the middleware
func (*MiddlewareClusterRepo) Delete ¶
func (mcr *MiddlewareClusterRepo) Delete(id string) error
Delete deletes data in the middleware, it is recommended to use soft deletion, therefore use update instead of delete
func (*MiddlewareClusterRepo) Execute ¶
func (mcr *MiddlewareClusterRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
Execute implements dependency.Repository interface, it executes command with arguments on database
func (*MiddlewareClusterRepo) GetAll ¶
func (mcr *MiddlewareClusterRepo) GetAll() ([]dependency.Entity, error)
GetAll returns all available entities
func (*MiddlewareClusterRepo) GetByID ¶
func (mcr *MiddlewareClusterRepo) GetByID(id string) (dependency.Entity, error)
func (*MiddlewareClusterRepo) GetID ¶
func (mcr *MiddlewareClusterRepo) GetID(entity dependency.Entity) (string, error)
GetID checks identity of given entity from the middleware
func (*MiddlewareClusterRepo) Transaction ¶
func (mcr *MiddlewareClusterRepo) Transaction() (middleware.Transaction, error)
func (*MiddlewareClusterRepo) Update ¶
func (mcr *MiddlewareClusterRepo) Update(entity dependency.Entity) error
Update updates data with given entity in the middleware
type MiddlewareClusterService ¶
type MiddlewareClusterService struct { dependency.Repository Entities []dependency.Entity }
func NewMiddlewareClusterService ¶
func NewMiddlewareClusterService(repo dependency.Repository) *MiddlewareClusterService
NewMiddlewareClusterService returns a new *MiddlewareClusterService
func NewMiddlewareClusterServiceWithDefault ¶
func NewMiddlewareClusterServiceWithDefault() *MiddlewareClusterService
NewMiddlewareClusterServiceWithDefault returns a new *MiddlewareClusterService with default repository
func (*MiddlewareClusterService) Create ¶
func (mcs *MiddlewareClusterService) Create(fields map[string]interface{}) error
Create creates a new middleware cluster entity and insert it into the middleware
func (*MiddlewareClusterService) Delete ¶
func (mcs *MiddlewareClusterService) Delete(id string) error
Delete deletes the middleware cluster entity that contains the given id in the middleware
func (*MiddlewareClusterService) GetAll ¶
func (mcs *MiddlewareClusterService) GetAll() error
GetAll gets all middleware cluster entities from the middleware
func (*MiddlewareClusterService) GetByID ¶
func (mcs *MiddlewareClusterService) GetByID(id string) error
GetByID gets an middleware cluster entity that contains the given id from the middleware
func (*MiddlewareClusterService) GetEntities ¶
func (mcs *MiddlewareClusterService) GetEntities() []dependency.Entity
GetEntities returns entities of the service
func (*MiddlewareClusterService) Marshal ¶
func (mcs *MiddlewareClusterService) Marshal() ([]byte, error)
Marshal marshals service.Entities
func (*MiddlewareClusterService) MarshalWithFields ¶
func (mcs *MiddlewareClusterService) MarshalWithFields(fields ...string) ([]byte, error)
Marshal marshals service.Entities with given fields
func (*MiddlewareClusterService) Update ¶
func (mcs *MiddlewareClusterService) Update(id string, fields map[string]interface{}) error
Update gets an middleware cluster entity that contains the given id from the middleware, and then update its fields that was specified in fields argument, key is the filed name and value is the new field value, it saves the changes to the middleware
type MiddlewareServerInfo ¶
type MiddlewareServerInfo struct { dependency.Repository ID int `middleware:"id" json:"id"` ClusterID int `middleware:"cluster_id" json:"cluster_id"` ServerName string `middleware:"server_name" json:"server_name"` MiddlewareRole int `middleware:"middleware_role" json:"middleware_role"` HostIP string `middleware:"host_ip" json:"host_ip"` PortNum int `middleware:"port_num" json:"port_num"` DelFlag int `middleware:"del_flag" json:"del_flag"` CreateTime time.Time `middleware:"create_time" json:"create_time"` LastUpdateTime time.Time `middleware:"last_update_time" json:"last_update_time"` }
func NewEmptyMiddlewareServerInfoWithGlobal ¶
func NewEmptyMiddlewareServerInfoWithGlobal() *MiddlewareServerInfo
func NewMiddlewareServerInfo ¶
func NewMiddlewareServerInfo(repo *MiddlewareServerRepo, id int, clusterID int, serverName string, middlewareRole int, hostIP string, portNum int, delFlag int, createTime time.Time, lastUpdateTime time.Time) *MiddlewareServerInfo
NewMiddlewareServerInfo returns a new MiddlewareServerInfo
func NewMiddlewareServerInfoWithDefault ¶
func NewMiddlewareServerInfoWithDefault(clusterID int, serverName string, middlewareRole int, hostIP string, portNum int) *MiddlewareServerInfo
NewMiddlewareServerInfoWithDefault returns a new MiddlewareServerInfo with default MiddlewareServerRepo
func NewMiddlewareServerInfoWithGlobal ¶
func NewMiddlewareServerInfoWithGlobal(id int, clusterID int, serverName string, middlewareRole int, hostIP string, portNum int, delFlag int, createTime time.Time, lastUpdateTime time.Time) *MiddlewareServerInfo
NewMiddlewareServerInfo returns a new MiddlewareServerInfo with default MiddlewareServerRepo
func NewMiddlewareServerInfoWithMapAndRandom ¶
func NewMiddlewareServerInfoWithMapAndRandom(fields map[string]interface{}) (*MiddlewareServerInfo, error)
NewMiddlewareServerInfoWithMapAndRandom returns a new *MiddlewareServerInfo with given map
func (*MiddlewareServerInfo) Delete ¶
func (msi *MiddlewareServerInfo) Delete()
Delete sets DelFlag to true, need to use Save to write to the middleware
func (*MiddlewareServerInfo) Get ¶
func (msi *MiddlewareServerInfo) Get(field string) (interface{}, error)
Get returns value of given field
func (*MiddlewareServerInfo) GetCreateTime ¶
func (msi *MiddlewareServerInfo) GetCreateTime() time.Time
GetCreateTime returns created time of entity
func (*MiddlewareServerInfo) GetLastUpdateTime ¶
func (msi *MiddlewareServerInfo) GetLastUpdateTime() time.Time
GetLastUpdateTime returns last updated time of entity
func (*MiddlewareServerInfo) Identity ¶
func (msi *MiddlewareServerInfo) Identity() string
Identity returns ID of entity
func (*MiddlewareServerInfo) IsDeleted ¶
func (msi *MiddlewareServerInfo) IsDeleted() bool
IsDeleted checks if delete flag had been set
func (*MiddlewareServerInfo) MarshalJSON ¶
func (msi *MiddlewareServerInfo) MarshalJSON() ([]byte, error)
MarshalJSON marshals entity to json string, it only marshals fields that has default tag
func (*MiddlewareServerInfo) MarshalJSONWithFields ¶
func (msi *MiddlewareServerInfo) MarshalJSONWithFields(fields ...string) ([]byte, error)
MarshalJSONWithFields marshals only with specified fields of entity to json string
func (*MiddlewareServerInfo) Set ¶
func (msi *MiddlewareServerInfo) Set(fields map[string]interface{}) error
Set sets entity with given fields, key is the field name and value is the relevant value of the key
type MiddlewareServerRepo ¶
type MiddlewareServerRepo struct {
Database middleware.Pool
}
func NewMiddlewareServerRepo ¶
func NewMiddlewareServerRepo(db middleware.Pool) *MiddlewareServerRepo
NewMiddlewareServerRepo returns *MiddlewareServerRepo with given middleware.Pool
func NewMiddlewareServerRepoWithGlobal ¶
func NewMiddlewareServerRepoWithGlobal() *MiddlewareServerRepo
NewMiddlewareServerRepo returns *MiddlewareServerRepo with global mysql pool
func (*MiddlewareServerRepo) Create ¶
func (msr *MiddlewareServerRepo) Create(entity dependency.Entity) (dependency.Entity, error)
Create creates data with given entity in the middleware
func (*MiddlewareServerRepo) Delete ¶
func (msr *MiddlewareServerRepo) Delete(id string) error
Delete deletes data in the middleware, it is recommended to use soft deletion, therefore use update instead of delete
func (*MiddlewareServerRepo) Execute ¶
func (msr *MiddlewareServerRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
Execute implements dependency.Repository interface, it executes command with arguments on database
func (*MiddlewareServerRepo) GetAll ¶
func (msr *MiddlewareServerRepo) GetAll() ([]dependency.Entity, error)
GetAll returns all available entities
func (*MiddlewareServerRepo) GetByID ¶
func (msr *MiddlewareServerRepo) GetByID(id string) (dependency.Entity, error)
func (*MiddlewareServerRepo) GetID ¶
func (msr *MiddlewareServerRepo) GetID(entity dependency.Entity) (string, error)
GetID checks identity of given entity from the middleware
func (*MiddlewareServerRepo) Transaction ¶
func (msr *MiddlewareServerRepo) Transaction() (middleware.Transaction, error)
func (*MiddlewareServerRepo) Update ¶
func (msr *MiddlewareServerRepo) Update(entity dependency.Entity) error
Update updates data with given entity in the middleware
type MiddlewareServerService ¶
type MiddlewareServerService struct { dependency.Repository Entities []dependency.Entity }
func NewMiddlewareServerService ¶
func NewMiddlewareServerService(repo dependency.Repository) *MiddlewareServerService
NewMiddlewareServerService returns a new *MiddlewareServerService
func NewMiddlewareServerServiceWithDefault ¶
func NewMiddlewareServerServiceWithDefault() *MiddlewareServerService
NewMiddlewareServerServiceWithDefault returns a new *MiddlewareServerService with default repository
func (*MiddlewareServerService) Create ¶
func (mss *MiddlewareServerService) Create(fields map[string]interface{}) error
Create creates a new middlewareServerEnvironment entity and insert it into the middleware
func (*MiddlewareServerService) Delete ¶
func (mss *MiddlewareServerService) Delete(id string) error
Delete deletes the middlewareServerEnvironment entity that contains the given id in the middleware
func (*MiddlewareServerService) GetAll ¶
func (mss *MiddlewareServerService) GetAll() error
GetAll gets all middlewareServerEnvironment entities from the middleware
func (*MiddlewareServerService) GetByID ¶
func (mss *MiddlewareServerService) GetByID(id string) error
GetByID gets an middlewareServerEnvironment entity that contains the given id from the middleware
func (*MiddlewareServerService) GetEntities ¶
func (mss *MiddlewareServerService) GetEntities() []dependency.Entity
GetEntities returns entities of the service
func (*MiddlewareServerService) Marshal ¶
func (mss *MiddlewareServerService) Marshal() ([]byte, error)
Marshal marshals service.Entities
func (*MiddlewareServerService) MarshalWithFields ¶
func (mss *MiddlewareServerService) MarshalWithFields(fields ...string) ([]byte, error)
Marshal marshals service.Entities with given fields
func (*MiddlewareServerService) Update ¶
func (mss *MiddlewareServerService) Update(id string, fields map[string]interface{}) error
Update gets an middleware ServerEnvironment entity that contains the given id from the middleware, and then update its fields that was specified in fields argument, key is the filed name and value is the new field value, it saves the changes to the middleware
type UserInfo ¶
type UserInfo struct { dependency.Repository ID int `middleware:"id" json:"id"` UserName string `middleware:"user_name" json:"user_name"` DelFlag int `middleware:"del_flag" json:"del_flag"` CreateTime time.Time `middleware:"create_time" json:"create_time"` LastUpdateTime time.Time `middleware:"last_update_time" json:"last_update_time"` DepartmentName string `middleware:"department_name" json:"department_name"` EmployeeID int `middleware:"employee_id" json:"employee_id"` DomainAccount string `middleware:"domain_account" json:"domain_account"` Email string `middleware:"email" json:"email"` Telephone string `middleware:"telephone" json:"telephone"` Mobile string `middleware:"mobile" json:"mobile"` Role int `middleware:"role" json:"role"` }
func NewEmptyUserInfoWithGlobal ¶
func NewEmptyUserInfoWithGlobal() *UserInfo
func NewUserInfo ¶
func NewUserInfo(repo *UserRepo, id int, userName string, delFlag int, createTime time.Time, lastUpdateTime time.Time, departmentName string, employeeID int, domainAccount string, email string, telephone string, mobile string, role int) *UserInfo
NewUserInfo returns a new UserInfo
func NewUserInfoWithDefault ¶
func NewUserInfoWithDefault(userName string, departmentName string, employeeID int, domainAccount string, email string, telephone string, mobile string, role int) *UserInfo
NewUserInfoWithDefault returns a new UserInfo with default UserRepo
func NewUserInfoWithGlobal ¶
func NewUserInfoWithGlobal(id int, userName string, delFlag int, createTime time.Time, lastUpdateTime time.Time, departmentName string, employeeID int, domainAccount string, email string, telephone string, mobile string, role int) *UserInfo
NewUserInfo returns a new UserInfo with default UserRepo
func (*UserInfo) Delete ¶
func (ui *UserInfo) Delete()
Delete sets DelFlag to true, need to use Save to write to the middleware
func (*UserInfo) GetCreateTime ¶
GetCreateTime returns created time of entity
func (*UserInfo) GetDepartmentName ¶
GetDepartmentName returns last updated time of entity
func (*UserInfo) GetDomainAccount ¶
GetDomainAccount returns last updated time of entity
func (*UserInfo) GetEmployeeID ¶
GetEmployeeID returns last updated time of entity
func (*UserInfo) GetLastUpdateTime ¶
GetLastUpdateTime returns last updated time of entity
func (*UserInfo) GetTelephone ¶
GetTelephone returns last updated time of entity
func (*UserInfo) MarshalJSON ¶
MarshalJSON marshals entity to json string, it only marshals fields that has default tag
func (*UserInfo) MarshalJSONWithFields ¶
MarshalJSONWithFields marshals only with specified fields of entity to json string
type UserRepo ¶
type UserRepo struct {
Database middleware.Pool
}
func NewUserRepo ¶
func NewUserRepo(db middleware.Pool) *UserRepo
NewUserRepo returns *UserRepo with given middleware.Pool
func NewUserRepoWithGlobal ¶
func NewUserRepoWithGlobal() *UserRepo
NewUserRepo returns *UserRepo with global mysql pool
func (*UserRepo) Create ¶
func (ur *UserRepo) Create(entity dependency.Entity) (dependency.Entity, error)
Create creates data with given entity in the middleware
func (*UserRepo) Delete ¶
Delete deletes data in the middleware, it is recommended to use soft deletion, therefore use update instead of delete
func (*UserRepo) Execute ¶
func (ur *UserRepo) Execute(command string, args ...interface{}) (middleware.Result, error)
Execute implements dependency.Repository interface, it executes command with arguments on database
func (*UserRepo) GetAll ¶
func (ur *UserRepo) GetAll() ([]dependency.Entity, error)
GetAll returns all available entities
func (*UserRepo) GetID ¶
func (ur *UserRepo) GetID(entity dependency.Entity) (string, error)
GetID checks identity of given entity from the middleware
func (*UserRepo) Transaction ¶
func (ur *UserRepo) Transaction() (middleware.Transaction, error)
type UserService ¶
type UserService struct { dependency.Repository Entities []dependency.Entity }
func NewUserService ¶
func NewUserService(repo dependency.Repository) *UserService
NewUserService returns a new *UserService
func NewUserServiceWithDefault ¶
func NewUserServiceWithDefault() *UserService
NewUserServiceWithDefault returns a new *UserService with default repository
func (*UserService) Create ¶
func (us *UserService) Create(fields map[string]interface{}) error
Create creates a new Userironment entity and insert it into the middleware
func (*UserService) Delete ¶
func (us *UserService) Delete(id string) error
Delete deletes the Userironment entity that contains the given id in the middleware
func (*UserService) GetAll ¶
func (us *UserService) GetAll() error
GetAll gets all Userironment entities from the middleware
func (*UserService) GetByID ¶
func (us *UserService) GetByID(id string) error
GetByID gets an Userironment entity that contains the given id from the middleware
func (*UserService) GetEntities ¶
func (us *UserService) GetEntities() []dependency.Entity
GetEntities returns entities of the service
func (*UserService) Marshal ¶
func (us *UserService) Marshal() ([]byte, error)
Marshal marshals service.Entities
func (*UserService) MarshalWithFields ¶
func (us *UserService) MarshalWithFields(fields ...string) ([]byte, error)
Marshal marshals service.Entities with given fields
func (*UserService) Update ¶
func (us *UserService) Update(id string, fields map[string]interface{}) error
Update gets an Userironment entity that contains the given id from the middleware, and then update its fields that was specified in fields argument, key is the filed name and value is the new field value, it saves the changes to the middleware
Source Files ¶
- app_system_entity.go
- app_system_repository.go
- app_system_service.go
- db_entity.go
- db_repository.go
- db_service.go
- env_entity.go
- env_repository.go
- env_service.go
- mS_entity.go
- mS_repository.go
- mS_service.go
- middleware_cluster_entity.go
- middleware_cluster_repository.go
- middleware_cluster_service.go
- middleware_server_entity.go
- middleware_server_repository.go
- middleware_server_service.go
- mysql_cluster_entity.go
- mysql_cluster_repository.go
- mysql_cluster_service.go
- mysql_server_entity.go
- mysql_server_repository.go
- mysql_server_service.go
- user_entity.go
- user_repository.go
- user_service.go