Documentation ¶
Index ¶
- Constants
- Variables
- func AddSplitString(origin []string) string
- func AddSplitString1(origin []*string) string
- func AddUserCallback(args map[string]interface{}, result *results.AnsiblePlaybookJSONResults)
- func BuildProjectCallback(args map[string]interface{}, result *results.AnsiblePlaybookJSONResults)
- func CreateClient(accessKeyId, accessKeySecret, regionId string) (_result *ecs20140526.Client, _err error)
- func DeployGameCallback(args map[string]interface{}, result *results.AnsiblePlaybookJSONResults)
- func DescribeInstanceStatus(client *ecs20140526.Client, instanceIds []string) (...)
- func DoAttachKeyPair(client *ecs20140526.Client, KeyPairName string, instanceIds []string) error
- func DoDescibeInstances(client *ecs20140526.Client, regionId string, instanceIds []string) ([]ecs20140526.DescribeInstancesResponseBodyInstancesInstance, error)
- func DoDescribeSecurityGroups(client *ecs20140526.Client, regionId string) ([]ecs20140526.DescribeSecurityGroupsResponseBodySecurityGroupsSecurityGroup, ...)
- func DoJoinSecurityGroup(client *ecs20140526.Client, secureGroup, instanceId string) error
- func DoLeaveSecurityGroup(client *ecs20140526.Client, secureGroup, instanceId string) error
- func DoModifyInstanceAttribute(client *ecs20140526.Client, req *ecs20140526.ModifyInstanceAttributeRequest) error
- func DoRebootInstances(client *ecs20140526.Client, instanceIds []string) ([]*ecs20140526.RebootInstancesResponseBodyInstanceResponsesInstanceResponse, ...)
- func GetLaunchTemplateVersionDetail(client *ecs20140526.Client, tmpl *system.ECSLaunchTemplateModel) error
- func GetLaunchTemplates(client *ecs20140526.Client, regionId string) (...)
- func ImportReference(filepath, importCode, structName, packageName, groupName string) error
- func Init(Package string)
- func LoadAll()
- func RandStringBytesRmndr(n int) string
- func RegisterInit(order int, i SubInitializer)
- func RunInstances(client *ecs20140526.Client, tmpl *system.ECSLaunchTemplateModel, amount int32) (*ecs20140526.RunInstancesResponse, error)
- func UpdateServerCallback(args map[string]interface{}, result *results.AnsiblePlaybookJSONResults)
- type AnsibleService
- type ApiService
- func (apiService *ApiService) CreateApi(api system.SysApi) (err error)
- func (apiService *ApiService) DeleteApi(api system.SysApi) (err error)
- func (apiService *ApiService) DeleteApisByIds(ids request.IdsReq) (err error)
- func (apiService *ApiService) GetAPIInfoList(api system.SysApi, info request.PageInfo, order string, desc bool) (list interface{}, total int64, err error)
- func (apiService *ApiService) GetAllApis() (apis []system.SysApi, err error)
- func (apiService *ApiService) GetApiById(id int) (api system.SysApi, err error)
- func (apiService *ApiService) UpdateApi(api system.SysApi) (err error)
- type AssetService
- func (s *AssetService) AddAssetManager(manager *system.AssetManager) error
- func (s *AssetService) CreateAsset(asset *system.Asset) error
- func (s *AssetService) GetAllAssetManager() ([]system.ECSLaunchTemplateModel, error)
- func (s *AssetService) GetAllAssetManagers() (interface{}, error)
- func (s *AssetService) GetAsset(id string) (*system.Asset, error)
- func (s *AssetService) GetAssetManager(name string) *system.AssetManager
- func (s *AssetService) GetDefaultAssetManager() (*system.AssetManager, error)
- func (s *AssetService) GetLaunchTemplateById(templateId string) (*system.ECSLaunchTemplateModel, error)
- func (s *AssetService) GetLaunchTemplateDetail(client *ecs20140526.Client, ...) error
- func (s *AssetService) GetServerAssets(network string, info request.PageInfo, order string, desc bool) (list interface{}, total int64, err error)
- func (s *AssetService) SetDefaultAssetManager(name string) error
- type AuthorityBtnService
- type AuthorityService
- func (authorityService *AuthorityService) CopyAuthority(copyInfo response.SysAuthorityCopyResponse) (authority system.SysAuthority, err error)
- func (authorityService *AuthorityService) CreateAuthority(auth system.SysAuthority) (authority system.SysAuthority, err error)
- func (authorityService *AuthorityService) DeleteAuthority(auth *system.SysAuthority) (err error)
- func (authorityService *AuthorityService) GetAuthorityInfo(auth system.SysAuthority) (sa system.SysAuthority, err error)
- func (authorityService *AuthorityService) GetAuthorityInfoList(info request.PageInfo) (list interface{}, total int64, err error)
- func (authorityService *AuthorityService) SetDataAuthority(auth system.SysAuthority) error
- func (authorityService *AuthorityService) SetMenuAuthority(auth *system.SysAuthority) error
- func (authorityService *AuthorityService) UpdateAuthority(auth system.SysAuthority) (authority system.SysAuthority, err error)
- type AutoCodeHistoryService
- func (autoCodeHistoryService *AutoCodeHistoryService) CreateAutoCodeHistory(meta, structName, structCNName, autoCodePath string, injectionMeta string, ...) error
- func (autoCodeHistoryService *AutoCodeHistoryService) Delete(info *request.GetById) error
- func (autoCodeHistoryService *AutoCodeHistoryService) First(info *request.GetById) (string, error)
- func (autoCodeHistoryService *AutoCodeHistoryService) GetList(info request.PageInfo) (list []response.AutoCodeHistory, total int64, err error)
- func (autoCodeHistoryService *AutoCodeHistoryService) Repeat(businessDB, structName, Package string) bool
- func (autoCodeHistoryService *AutoCodeHistoryService) RollBack(info *systemReq.RollBack) error
- type AutoCodeService
- func (autoCodeService *AutoCodeService) AutoCreateApi(a *system.AutoCodeStruct) (ids []uint, err error)
- func (autoCodeService *AutoCodeService) CreateAutoCode(s *system.SysAutoCode) error
- func (autoCodeService *AutoCodeService) CreatePackageTemp(packageName string) error
- func (autoCodeService *AutoCodeService) CreatePlug(plug system.AutoPlugReq) error
- func (autoCodeService *AutoCodeService) CreateTemp(autoCode system.AutoCodeStruct, ids ...uint) (err error)
- func (autoCodeService *AutoCodeService) Database(businessDB string) Database
- func (autoCodeService *AutoCodeService) DelPackage(a system.SysAutoCode) error
- func (autoCodeService *AutoCodeService) DropTable(BusinessDb, tableName string) error
- func (autoCodeService *AutoCodeService) GetAllTplFile(pathName string, fileList []string) ([]string, error)
- func (autoCodeService *AutoCodeService) GetPackage() (pkgList []system.SysAutoCode, err error)
- func (autoCodeService *AutoCodeService) InstallPlugin(file *multipart.FileHeader) (web, server int, err error)
- func (autoCodeService *AutoCodeService) PreviewTemp(autoCode system.AutoCodeStruct) (map[string]string, error)
- type BaseMenuService
- type CasbinService
- func (casbinService *CasbinService) Casbin() *casbin.CachedEnforcer
- func (casbinService *CasbinService) ClearCasbin(v int, p ...string) bool
- func (casbinService *CasbinService) GetPolicyPathByAuthorityId(AuthorityID uint) (pathMaps []request.CasbinInfo)
- func (casbinService *CasbinService) UpdateCasbin(AuthorityID uint, casbinInfos []request.CasbinInfo) error
- func (casbinService *CasbinService) UpdateCasbinApi(oldPath string, newPath string, oldMethod string, newMethod string) error
- type Database
- type DictionaryDetailService
- func (dictionaryDetailService *DictionaryDetailService) CreateSysDictionaryDetail(sysDictionaryDetail system.SysDictionaryDetail) (err error)
- func (dictionaryDetailService *DictionaryDetailService) DeleteSysDictionaryDetail(sysDictionaryDetail system.SysDictionaryDetail) (err error)
- func (dictionaryDetailService *DictionaryDetailService) GetSysDictionaryDetail(id uint) (sysDictionaryDetail system.SysDictionaryDetail, err error)
- func (dictionaryDetailService *DictionaryDetailService) GetSysDictionaryDetailInfoList(info request.SysDictionaryDetailSearch) (list interface{}, total int64, err error)
- func (dictionaryDetailService *DictionaryDetailService) UpdateSysDictionaryDetail(sysDictionaryDetail *system.SysDictionaryDetail) (err error)
- type DictionaryService
- func (dictionaryService *DictionaryService) CreateSysDictionary(sysDictionary system.SysDictionary) (err error)
- func (dictionaryService *DictionaryService) DeleteSysDictionary(sysDictionary system.SysDictionary) (err error)
- func (dictionaryService *DictionaryService) GetSysDictionary(Type string, Id uint, status *bool) (sysDictionary system.SysDictionary, err error)
- func (dictionaryService *DictionaryService) GetSysDictionaryInfoList(info request.SysDictionarySearch) (list interface{}, total int64, err error)
- func (dictionaryService *DictionaryService) UpdateSysDictionary(sysDictionary *system.SysDictionary) (err error)
- type GameCMDBService
- type InitDBService
- type JwtService
- func (jwtService *JwtService) GetRedisJWT(userName string) (redisJWT string, err error)
- func (jwtService *JwtService) IsBlacklist(jwt string) bool
- func (jwtService *JwtService) JsonInBlacklist(jwtList system.JwtBlacklist) (err error)
- func (jwtService *JwtService) SetRedisJWT(jwt string, userName string) (err error)
- type MenuService
- func (menuService *MenuService) AddBaseMenu(menu system.SysBaseMenu) error
- func (menuService *MenuService) AddMenuAuthority(menus []system.SysBaseMenu, authorityId uint) (err error)
- func (menuService *MenuService) GetBaseMenuTree() (menus []system.SysBaseMenu, err error)
- func (menuService *MenuService) GetInfoList() (list interface{}, total int64, err error)
- func (menuService *MenuService) GetMenuAuthority(info *request.GetAuthorityId) (menus []system.SysMenu, err error)
- func (menuService *MenuService) GetMenuTree(authorityId uint) (menus []system.SysMenu, err error)
- func (menuService *MenuService) UserAuthorityDefaultRouter(user *system.SysUser)
- type MysqlInitHandler
- func (h MysqlInitHandler) EnsureDB(ctx context.Context, conf *request.InitDB) (next context.Context, err error)
- func (h MysqlInitHandler) InitData(ctx context.Context, inits initSlice) error
- func (h MysqlInitHandler) InitTables(ctx context.Context, inits initSlice) error
- func (h MysqlInitHandler) WriteConfig(ctx context.Context) error
- type OperationRecordService
- func (operationRecordService *OperationRecordService) CreateSysOperationRecord(sysOperationRecord system.SysOperationRecord) (err error)
- func (operationRecordService *OperationRecordService) DeleteSysOperationRecord(sysOperationRecord system.SysOperationRecord) (err error)
- func (operationRecordService *OperationRecordService) DeleteSysOperationRecordByIds(ids request.IdsReq) (err error)
- func (operationRecordService *OperationRecordService) GetSysOperationRecord(id uint) (sysOperationRecord system.SysOperationRecord, err error)
- func (operationRecordService *OperationRecordService) GetSysOperationRecordInfoList(info systemReq.SysOperationRecordSearch) (list interface{}, total int64, err error)
- type PgsqlInitHandler
- func (h PgsqlInitHandler) EnsureDB(ctx context.Context, conf *request.InitDB) (next context.Context, err error)
- func (h PgsqlInitHandler) InitData(ctx context.Context, inits initSlice) error
- func (h PgsqlInitHandler) InitTables(ctx context.Context, inits initSlice) error
- func (h PgsqlInitHandler) WriteConfig(ctx context.Context) error
- type PlayBookCallBack
- type ProjectService
- func (s *ProjectService) BuildProject(buildReq *request.BuildProjectReq) (string, error)
- func (s *ProjectService) CreateProject(project *system.Project) error
- func (s *ProjectService) DeployGame(req *request.DeployGameReq) (string, error)
- func (s *ProjectService) GetAllProjects() ([]system.Project, error)
- func (s *ProjectService) GetBuildHistory(requestId string) (*system.ProjectBuildHistory, error)
- func (s *ProjectService) UpdateServer(inventory map[string]*system.AnsibleHost, req *request.UpdateServerReq, ...) (string, error)
- type SecureGroupService
- type ServiceGroup
- type SubInitializer
- type SystemConfigService
- type SystemUserService
- type TagService
- type TypedDBInitHandler
- type UserService
- func (userService *UserService) ChangePassword(u *system.SysUser, newPassword string) (userInter *system.SysUser, err error)
- func (userService *UserService) DeleteUser(id int) (err error)
- func (userService *UserService) FindUserById(id int) (user *system.SysUser, err error)
- func (userService *UserService) FindUserByUuid(uuid string) (user *system.SysUser, err error)
- func (userService *UserService) GetUserInfo(uuid uuid.UUID) (user system.SysUser, err error)
- func (userService *UserService) GetUserInfoList(info request.PageInfo) (list interface{}, total int64, err error)
- func (userService *UserService) Login(u *system.SysUser) (userInter *system.SysUser, err error)
- func (userService *UserService) Register(u system.SysUser) (userInter system.SysUser, err error)
- func (userService *UserService) ResetPassword(ID uint) (err error)
- func (userService *UserService) SetUserAuthorities(id uint, authorityIds []uint) (err error)
- func (userService *UserService) SetUserAuthority(id uint, authorityId uint) (err error)
- func (userService *UserService) SetUserInfo(req system.SysUser) error
- type Visitor
Constants ¶
const ( Pending string = "Pending" // 创建中 Running string = "Running" // 运行中 Starting string = "Starting" // 启动中 Stopping string = "Stopping" // 停止中 Stopped string = "Stopped" // 已停止 )
const ( Mysql = "mysql" Pgsql = "pgsql" InitSuccess = "\n[%v] --> 初始数据成功!\n" InitDataExist = "\n[%v] --> %v 的初始数据已存在!\n" InitDataFailed = "\n[%v] --> %v 初始数据失败! \nerr: %+v\n" InitDataSuccess = "\n[%v] --> %v 初始数据成功!\n" )
const ( InitOrderSystem = 10 InitOrderInternal = 1000 InitOrderExternal = 100000 )
Variables ¶
var ( ErrMissingDBContext = errors.New("missing db in context") ErrMissingDependentContext = errors.New("missing dependent value in context") ErrDBTypeMismatch = errors.New("db type mismatch") )
var ApiServiceApp = new(ApiService)
var AuthorityServiceApp = new(AuthorityService)
var AutoCodeHistoryServiceApp = new(AutoCodeHistoryService)
var AutoCodeMysql = new(autoCodeMysql)
var AutoCodeOracle = new(autoCodeOracle)
var AutoCodePgsql = new(autoCodePgsql)
var AutoCodeServiceApp = new(AutoCodeService)
var CasbinServiceApp = new(CasbinService)
var ErrRoleExistence = errors.New("存在相同角色id")
var MenuServiceApp = new(MenuService)
var RepeatErr = errors.New("重复创建")
Functions ¶
func AddSplitString ¶
func AddSplitString1 ¶
func AddUserCallback ¶
func AddUserCallback(args map[string]interface{}, result *results.AnsiblePlaybookJSONResults)
func BuildProjectCallback ¶
func BuildProjectCallback(args map[string]interface{}, result *results.AnsiblePlaybookJSONResults)
func CreateClient ¶
func CreateClient(accessKeyId, accessKeySecret, regionId string) (_result *ecs20140526.Client, _err error)
*
- 使用AK&SK初始化账号Client
- @param accessKeyId
- @param accessKeySecret
- @return Client
- @throws Exception
func DeployGameCallback ¶
func DeployGameCallback(args map[string]interface{}, result *results.AnsiblePlaybookJSONResults)
func DescribeInstanceStatus ¶
func DescribeInstanceStatus(client *ecs20140526.Client, instanceIds []string) ([]*ecs20140526.DescribeInstanceStatusResponseBodyInstanceStatusesInstanceStatus, error)
获取多台ECS实例的状态信息
func DoAttachKeyPair ¶
func DoAttachKeyPair(client *ecs20140526.Client, KeyPairName string, instanceIds []string) error
绑定ssh密钥对
func DoDescibeInstances ¶
func DoDescibeInstances(client *ecs20140526.Client, regionId string, instanceIds []string) ([]ecs20140526.DescribeInstancesResponseBodyInstancesInstance, error)
查询ECS实例详细信息, 如果len(instanceIds)=0,则查询整个region,否则按instanceId查
func DoDescribeSecurityGroups ¶
func DoDescribeSecurityGroups(client *ecs20140526.Client, regionId string) ([]ecs20140526.DescribeSecurityGroupsResponseBodySecurityGroupsSecurityGroup, error)
查询安全组信息
func DoJoinSecurityGroup ¶
func DoJoinSecurityGroup(client *ecs20140526.Client, secureGroup, instanceId string) error
给实例添加安全组
func DoLeaveSecurityGroup ¶
func DoLeaveSecurityGroup(client *ecs20140526.Client, secureGroup, instanceId string) error
将实例从安全组中删除
func DoModifyInstanceAttribute ¶
func DoModifyInstanceAttribute(client *ecs20140526.Client, req *ecs20140526.ModifyInstanceAttributeRequest) error
修改实例信息
func DoRebootInstances ¶
func DoRebootInstances(client *ecs20140526.Client, instanceIds []string) ([]*ecs20140526.RebootInstancesResponseBodyInstanceResponsesInstanceResponse, error)
ECS实例重启
func GetLaunchTemplateVersionDetail ¶
func GetLaunchTemplateVersionDetail(client *ecs20140526.Client, tmpl *system.ECSLaunchTemplateModel) error
查询启动模板具体版本信息
func GetLaunchTemplates ¶
func GetLaunchTemplates(client *ecs20140526.Client, regionId string) ([]ecs20140526.DescribeLaunchTemplatesResponseBodyLaunchTemplateSetsLaunchTemplateSet, error)
获取所有ECS实例启动模板
func ImportReference ¶
func RandStringBytesRmndr ¶
func RegisterInit ¶
func RegisterInit(order int, i SubInitializer)
RegisterInit 注册要执行的初始化过程,会在 InitDB() 时调用
func RunInstances ¶
func RunInstances(client *ecs20140526.Client, tmpl *system.ECSLaunchTemplateModel, amount int32) (*ecs20140526.RunInstancesResponse, error)
实例创建(购买)(多台)
func UpdateServerCallback ¶
func UpdateServerCallback(args map[string]interface{}, result *results.AnsiblePlaybookJSONResults)
Types ¶
type AnsibleService ¶
type AnsibleService struct { }
func (*AnsibleService) CreatePlayBook ¶
func (s *AnsibleService) CreatePlayBook(req *request.CreatePlayBookReq, yc string) error
func (*AnsibleService) PlayLocalPlayBook ¶
func (s *AnsibleService) PlayLocalPlayBook(playBookName string, inventory string, args map[string]interface{}, callback PlayBookCallBack) error
执行本地剧本
func (*AnsibleService) PlayPlayBook ¶
func (s *AnsibleService) PlayPlayBook(play *request.PlayPlayBookReq) error
type ApiService ¶
type ApiService struct{}
func (*ApiService) CreateApi ¶
func (apiService *ApiService) CreateApi(api system.SysApi) (err error)
func (*ApiService) DeleteApi ¶
func (apiService *ApiService) DeleteApi(api system.SysApi) (err error)
func (*ApiService) DeleteApisByIds ¶
func (apiService *ApiService) DeleteApisByIds(ids request.IdsReq) (err error)
func (*ApiService) GetAPIInfoList ¶
func (*ApiService) GetAllApis ¶
func (apiService *ApiService) GetAllApis() (apis []system.SysApi, err error)
func (*ApiService) GetApiById ¶
func (apiService *ApiService) GetApiById(id int) (api system.SysApi, err error)
type AssetService ¶
type AssetService struct{}
func (*AssetService) AddAssetManager ¶
func (s *AssetService) AddAssetManager(manager *system.AssetManager) error
增加资产管理信息
func (*AssetService) CreateAsset ¶
func (s *AssetService) CreateAsset(asset *system.Asset) error
增加资产
func (*AssetService) GetAllAssetManager ¶
func (s *AssetService) GetAllAssetManager() ([]system.ECSLaunchTemplateModel, error)
获取所有ECS实例启动模板
func (*AssetService) GetAllAssetManagers ¶
func (s *AssetService) GetAllAssetManagers() (interface{}, error)
查找所有资产管理用户
func (*AssetService) GetAsset ¶
func (s *AssetService) GetAsset(id string) (*system.Asset, error)
获取资产信息
func (*AssetService) GetAssetManager ¶
func (s *AssetService) GetAssetManager(name string) *system.AssetManager
根据名字获取资产管理信息
func (*AssetService) GetDefaultAssetManager ¶
func (s *AssetService) GetDefaultAssetManager() (*system.AssetManager, error)
获取默认资产管理用户
func (*AssetService) GetLaunchTemplateById ¶
func (s *AssetService) GetLaunchTemplateById(templateId string) (*system.ECSLaunchTemplateModel, error)
获取资产信息
func (*AssetService) GetLaunchTemplateDetail ¶
func (s *AssetService) GetLaunchTemplateDetail(client *ecs20140526.Client, tmpl *ecs20140526.DescribeLaunchTemplatesResponseBodyLaunchTemplateSetsLaunchTemplateSet) error
从云中拉取指定模板的详细信息
func (*AssetService) GetServerAssets ¶
func (s *AssetService) GetServerAssets(network string, info request.PageInfo, order string, desc bool) (list interface{}, total int64, err error)
分页获取服务器
func (*AssetService) SetDefaultAssetManager ¶
func (s *AssetService) SetDefaultAssetManager(name string) error
设置默认使用的资产管理用户
type AuthorityBtnService ¶
type AuthorityBtnService struct{}
func (*AuthorityBtnService) CanRemoveAuthorityBtn ¶
func (a *AuthorityBtnService) CanRemoveAuthorityBtn(ID string) (err error)
func (*AuthorityBtnService) GetAuthorityBtn ¶
func (a *AuthorityBtnService) GetAuthorityBtn(req request.SysAuthorityBtnReq) (res response.SysAuthorityBtnRes, err error)
func (*AuthorityBtnService) SetAuthorityBtn ¶
func (a *AuthorityBtnService) SetAuthorityBtn(req request.SysAuthorityBtnReq) (err error)
type AuthorityService ¶
type AuthorityService struct{}
func (*AuthorityService) CopyAuthority ¶
func (authorityService *AuthorityService) CopyAuthority(copyInfo response.SysAuthorityCopyResponse) (authority system.SysAuthority, err error)
func (*AuthorityService) CreateAuthority ¶
func (authorityService *AuthorityService) CreateAuthority(auth system.SysAuthority) (authority system.SysAuthority, err error)
func (*AuthorityService) DeleteAuthority ¶
func (authorityService *AuthorityService) DeleteAuthority(auth *system.SysAuthority) (err error)
func (*AuthorityService) GetAuthorityInfo ¶
func (authorityService *AuthorityService) GetAuthorityInfo(auth system.SysAuthority) (sa system.SysAuthority, err error)
func (*AuthorityService) GetAuthorityInfoList ¶
func (authorityService *AuthorityService) GetAuthorityInfoList(info request.PageInfo) (list interface{}, total int64, err error)
func (*AuthorityService) SetDataAuthority ¶
func (authorityService *AuthorityService) SetDataAuthority(auth system.SysAuthority) error
func (*AuthorityService) SetMenuAuthority ¶
func (authorityService *AuthorityService) SetMenuAuthority(auth *system.SysAuthority) error
func (*AuthorityService) UpdateAuthority ¶
func (authorityService *AuthorityService) UpdateAuthority(auth system.SysAuthority) (authority system.SysAuthority, err error)
type AutoCodeHistoryService ¶
type AutoCodeHistoryService struct{}
func (*AutoCodeHistoryService) CreateAutoCodeHistory ¶
func (autoCodeHistoryService *AutoCodeHistoryService) CreateAutoCodeHistory(meta, structName, structCNName, autoCodePath string, injectionMeta string, tableName string, apiIds string, Package string) error
CreateAutoCodeHistory 创建代码生成器历史记录 RouterPath : RouterPath@RouterString;RouterPath2@RouterString2 Author [SliverHorn](https://github.com/SliverHorn) Author [songzhibin97](https://github.com/songzhibin97)
func (*AutoCodeHistoryService) Delete ¶
func (autoCodeHistoryService *AutoCodeHistoryService) Delete(info *request.GetById) error
Delete 删除历史数据 Author [SliverHorn](https://github.com/SliverHorn) Author [songzhibin97](https://github.com/songzhibin97)
func (*AutoCodeHistoryService) First ¶
func (autoCodeHistoryService *AutoCodeHistoryService) First(info *request.GetById) (string, error)
First 根据id获取代码生成器历史的数据 Author [SliverHorn](https://github.com/SliverHorn) Author [songzhibin97](https://github.com/songzhibin97)
func (*AutoCodeHistoryService) GetList ¶
func (autoCodeHistoryService *AutoCodeHistoryService) GetList(info request.PageInfo) (list []response.AutoCodeHistory, total int64, err error)
GetList 获取系统历史数据 Author [SliverHorn](https://github.com/SliverHorn) Author [songzhibin97](https://github.com/songzhibin97)
func (*AutoCodeHistoryService) Repeat ¶
func (autoCodeHistoryService *AutoCodeHistoryService) Repeat(businessDB, structName, Package string) bool
Repeat 检测重复 Author [SliverHorn](https://github.com/SliverHorn) Author [songzhibin97](https://github.com/songzhibin97)
func (*AutoCodeHistoryService) RollBack ¶
func (autoCodeHistoryService *AutoCodeHistoryService) RollBack(info *systemReq.RollBack) error
RollBack 回滚 Author [SliverHorn](https://github.com/SliverHorn) Author [songzhibin97](https://github.com/songzhibin97)
type AutoCodeService ¶
type AutoCodeService struct{}
func (*AutoCodeService) AutoCreateApi ¶
func (autoCodeService *AutoCodeService) AutoCreateApi(a *system.AutoCodeStruct) (ids []uint, err error)
func (*AutoCodeService) CreateAutoCode ¶
func (autoCodeService *AutoCodeService) CreateAutoCode(s *system.SysAutoCode) error
func (*AutoCodeService) CreatePackageTemp ¶
func (autoCodeService *AutoCodeService) CreatePackageTemp(packageName string) error
func (*AutoCodeService) CreatePlug ¶
func (autoCodeService *AutoCodeService) CreatePlug(plug system.AutoPlugReq) error
CreatePlug 自动创建插件模板
func (*AutoCodeService) CreateTemp ¶
func (autoCodeService *AutoCodeService) CreateTemp(autoCode system.AutoCodeStruct, ids ...uint) (err error)
func (*AutoCodeService) Database ¶
func (autoCodeService *AutoCodeService) Database(businessDB string) Database
func (*AutoCodeService) DelPackage ¶
func (autoCodeService *AutoCodeService) DelPackage(a system.SysAutoCode) error
func (*AutoCodeService) DropTable ¶
func (autoCodeService *AutoCodeService) DropTable(BusinessDb, tableName string) error
func (*AutoCodeService) GetAllTplFile ¶
func (autoCodeService *AutoCodeService) GetAllTplFile(pathName string, fileList []string) ([]string, error)
func (*AutoCodeService) GetPackage ¶
func (autoCodeService *AutoCodeService) GetPackage() (pkgList []system.SysAutoCode, err error)
func (*AutoCodeService) InstallPlugin ¶
func (autoCodeService *AutoCodeService) InstallPlugin(file *multipart.FileHeader) (web, server int, err error)
func (*AutoCodeService) PreviewTemp ¶
func (autoCodeService *AutoCodeService) PreviewTemp(autoCode system.AutoCodeStruct) (map[string]string, error)
type BaseMenuService ¶
type BaseMenuService struct{}
func (*BaseMenuService) DeleteBaseMenu ¶
func (baseMenuService *BaseMenuService) DeleteBaseMenu(id int) (err error)
func (*BaseMenuService) GetBaseMenuById ¶
func (baseMenuService *BaseMenuService) GetBaseMenuById(id int) (menu system.SysBaseMenu, err error)
func (*BaseMenuService) UpdateBaseMenu ¶
func (baseMenuService *BaseMenuService) UpdateBaseMenu(menu system.SysBaseMenu) (err error)
type CasbinService ¶
type CasbinService struct{}
func (*CasbinService) Casbin ¶
func (casbinService *CasbinService) Casbin() *casbin.CachedEnforcer
func (*CasbinService) ClearCasbin ¶
func (casbinService *CasbinService) ClearCasbin(v int, p ...string) bool
func (*CasbinService) GetPolicyPathByAuthorityId ¶
func (casbinService *CasbinService) GetPolicyPathByAuthorityId(AuthorityID uint) (pathMaps []request.CasbinInfo)
func (*CasbinService) UpdateCasbin ¶
func (casbinService *CasbinService) UpdateCasbin(AuthorityID uint, casbinInfos []request.CasbinInfo) error
func (*CasbinService) UpdateCasbinApi ¶
type DictionaryDetailService ¶
type DictionaryDetailService struct{}
func (*DictionaryDetailService) CreateSysDictionaryDetail ¶
func (dictionaryDetailService *DictionaryDetailService) CreateSysDictionaryDetail(sysDictionaryDetail system.SysDictionaryDetail) (err error)
func (*DictionaryDetailService) DeleteSysDictionaryDetail ¶
func (dictionaryDetailService *DictionaryDetailService) DeleteSysDictionaryDetail(sysDictionaryDetail system.SysDictionaryDetail) (err error)
func (*DictionaryDetailService) GetSysDictionaryDetail ¶
func (dictionaryDetailService *DictionaryDetailService) GetSysDictionaryDetail(id uint) (sysDictionaryDetail system.SysDictionaryDetail, err error)
func (*DictionaryDetailService) GetSysDictionaryDetailInfoList ¶
func (dictionaryDetailService *DictionaryDetailService) GetSysDictionaryDetailInfoList(info request.SysDictionaryDetailSearch) (list interface{}, total int64, err error)
func (*DictionaryDetailService) UpdateSysDictionaryDetail ¶
func (dictionaryDetailService *DictionaryDetailService) UpdateSysDictionaryDetail(sysDictionaryDetail *system.SysDictionaryDetail) (err error)
type DictionaryService ¶
type DictionaryService struct{}
func (*DictionaryService) CreateSysDictionary ¶
func (dictionaryService *DictionaryService) CreateSysDictionary(sysDictionary system.SysDictionary) (err error)
func (*DictionaryService) DeleteSysDictionary ¶
func (dictionaryService *DictionaryService) DeleteSysDictionary(sysDictionary system.SysDictionary) (err error)
func (*DictionaryService) GetSysDictionary ¶
func (dictionaryService *DictionaryService) GetSysDictionary(Type string, Id uint, status *bool) (sysDictionary system.SysDictionary, err error)
func (*DictionaryService) GetSysDictionaryInfoList ¶
func (dictionaryService *DictionaryService) GetSysDictionaryInfoList(info request.SysDictionarySearch) (list interface{}, total int64, err error)
func (*DictionaryService) UpdateSysDictionary ¶
func (dictionaryService *DictionaryService) UpdateSysDictionary(sysDictionary *system.SysDictionary) (err error)
type GameCMDBService ¶
type GameCMDBService struct{}
func (*GameCMDBService) GetServerConf ¶
func (s *GameCMDBService) GetServerConf(req *request.GetGameServerIdReq) (*system.GameServerIdCMDB, error)
type InitDBService ¶
type InitDBService struct{}
type JwtService ¶
type JwtService struct{}
func (*JwtService) GetRedisJWT ¶
func (jwtService *JwtService) GetRedisJWT(userName string) (redisJWT string, err error)
func (*JwtService) IsBlacklist ¶
func (jwtService *JwtService) IsBlacklist(jwt string) bool
func (*JwtService) JsonInBlacklist ¶
func (jwtService *JwtService) JsonInBlacklist(jwtList system.JwtBlacklist) (err error)
func (*JwtService) SetRedisJWT ¶
func (jwtService *JwtService) SetRedisJWT(jwt string, userName string) (err error)
type MenuService ¶
type MenuService struct{}
func (*MenuService) AddBaseMenu ¶
func (menuService *MenuService) AddBaseMenu(menu system.SysBaseMenu) error
func (*MenuService) AddMenuAuthority ¶
func (menuService *MenuService) AddMenuAuthority(menus []system.SysBaseMenu, authorityId uint) (err error)
func (*MenuService) GetBaseMenuTree ¶
func (menuService *MenuService) GetBaseMenuTree() (menus []system.SysBaseMenu, err error)
func (*MenuService) GetInfoList ¶
func (menuService *MenuService) GetInfoList() (list interface{}, total int64, err error)
func (*MenuService) GetMenuAuthority ¶
func (menuService *MenuService) GetMenuAuthority(info *request.GetAuthorityId) (menus []system.SysMenu, err error)
func (*MenuService) GetMenuTree ¶
func (menuService *MenuService) GetMenuTree(authorityId uint) (menus []system.SysMenu, err error)
func (*MenuService) UserAuthorityDefaultRouter ¶
func (menuService *MenuService) UserAuthorityDefaultRouter(user *system.SysUser)
UserAuthorityDefaultRouter 用户角色默认路由检查
Author [SliverHorn](https://github.com/SliverHorn)
type MysqlInitHandler ¶
type MysqlInitHandler struct{}
func NewMysqlInitHandler ¶
func NewMysqlInitHandler() *MysqlInitHandler
func (MysqlInitHandler) EnsureDB ¶
func (h MysqlInitHandler) EnsureDB(ctx context.Context, conf *request.InitDB) (next context.Context, err error)
EnsureDB 创建数据库并初始化 mysql
func (MysqlInitHandler) InitData ¶
func (h MysqlInitHandler) InitData(ctx context.Context, inits initSlice) error
func (MysqlInitHandler) InitTables ¶
func (h MysqlInitHandler) InitTables(ctx context.Context, inits initSlice) error
func (MysqlInitHandler) WriteConfig ¶
func (h MysqlInitHandler) WriteConfig(ctx context.Context) error
WriteConfig mysql回写配置
type OperationRecordService ¶
type OperationRecordService struct{}
func (*OperationRecordService) CreateSysOperationRecord ¶
func (operationRecordService *OperationRecordService) CreateSysOperationRecord(sysOperationRecord system.SysOperationRecord) (err error)
func (*OperationRecordService) DeleteSysOperationRecord ¶
func (operationRecordService *OperationRecordService) DeleteSysOperationRecord(sysOperationRecord system.SysOperationRecord) (err error)
func (*OperationRecordService) DeleteSysOperationRecordByIds ¶
func (operationRecordService *OperationRecordService) DeleteSysOperationRecordByIds(ids request.IdsReq) (err error)
func (*OperationRecordService) GetSysOperationRecord ¶
func (operationRecordService *OperationRecordService) GetSysOperationRecord(id uint) (sysOperationRecord system.SysOperationRecord, err error)
func (*OperationRecordService) GetSysOperationRecordInfoList ¶
func (operationRecordService *OperationRecordService) GetSysOperationRecordInfoList(info systemReq.SysOperationRecordSearch) (list interface{}, total int64, err error)
type PgsqlInitHandler ¶
type PgsqlInitHandler struct{}
func NewPgsqlInitHandler ¶
func NewPgsqlInitHandler() *PgsqlInitHandler
func (PgsqlInitHandler) EnsureDB ¶
func (h PgsqlInitHandler) EnsureDB(ctx context.Context, conf *request.InitDB) (next context.Context, err error)
EnsureDB 创建数据库并初始化 pg
func (PgsqlInitHandler) InitData ¶
func (h PgsqlInitHandler) InitData(ctx context.Context, inits initSlice) error
func (PgsqlInitHandler) InitTables ¶
func (h PgsqlInitHandler) InitTables(ctx context.Context, inits initSlice) error
func (PgsqlInitHandler) WriteConfig ¶
func (h PgsqlInitHandler) WriteConfig(ctx context.Context) error
WriteConfig pgsql 回写配置
type PlayBookCallBack ¶
type PlayBookCallBack func(args map[string]interface{}, result *results.AnsiblePlaybookJSONResults)
type ProjectService ¶
type ProjectService struct{}
func (*ProjectService) BuildProject ¶
func (s *ProjectService) BuildProject(buildReq *request.BuildProjectReq) (string, error)
func (*ProjectService) CreateProject ¶
func (s *ProjectService) CreateProject(project *system.Project) error
func (*ProjectService) DeployGame ¶
func (s *ProjectService) DeployGame(req *request.DeployGameReq) (string, error)
部署游戏, 如果传入的用户不存在, 则会创建
func (*ProjectService) GetAllProjects ¶
func (s *ProjectService) GetAllProjects() ([]system.Project, error)
func (*ProjectService) GetBuildHistory ¶
func (s *ProjectService) GetBuildHistory(requestId string) (*system.ProjectBuildHistory, error)
func (*ProjectService) UpdateServer ¶
func (s *ProjectService) UpdateServer(inventory map[string]*system.AnsibleHost, req *request.UpdateServerReq, buildHis *system.ProjectBuildHistory) (string, error)
更新服务器
type SecureGroupService ¶
type SecureGroupService struct { }
func (*SecureGroupService) SaveSecureGroup ¶
func (s *SecureGroupService) SaveSecureGroup(group *system.SecureGroup) error
func (*SecureGroupService) SyncFromCloud ¶
func (s *SecureGroupService) SyncFromCloud() error
type ServiceGroup ¶
type ServiceGroup struct { JwtService ApiService MenuService UserService CasbinService InitDBService AutoCodeService BaseMenuService AuthorityService DictionaryService SystemConfigService AutoCodeHistoryService OperationRecordService DictionaryDetailService AuthorityBtnService AssetService SystemUserService SecureGroupService AnsibleService ProjectService GameCMDBService TagService }
type SubInitializer ¶
type SubInitializer interface { InitializerName() string // 不一定代表单独一个表,所以改成了更宽泛的语义 MigrateTable(ctx context.Context) (next context.Context, err error) InitializeData(ctx context.Context) (next context.Context, err error) TableCreated(ctx context.Context) bool DataInserted(ctx context.Context) bool }
SubInitializer 提供 source/*/init() 使用的接口,每个 initializer 完成一个初始化过程
type SystemConfigService ¶
type SystemConfigService struct{}
func (*SystemConfigService) GetServerInfo ¶
func (systemConfigService *SystemConfigService) GetServerInfo() (server *utils.Server, err error)
func (*SystemConfigService) GetSystemConfig ¶
func (systemConfigService *SystemConfigService) GetSystemConfig() (conf config.Server, err error)
func (*SystemConfigService) SetSystemConfig ¶
func (systemConfigService *SystemConfigService) SetSystemConfig(system system.System) (err error)
type SystemUserService ¶
type SystemUserService struct { }
func (*SystemUserService) AddSystemUser ¶
func (s *SystemUserService) AddSystemUser(user *system.SystemUser) error
增加系统用户
func (*SystemUserService) AssociateAsset ¶
func (s *SystemUserService) AssociateAsset(assetId, userId string) error
系统用户关联资产
func (*SystemUserService) GetSystemUsers ¶
func (s *SystemUserService) GetSystemUsers(Type string) ([]system.SystemUser, error)
获取系统用户
type TagService ¶
type TagService struct { }
func (*TagService) GetAssetTags ¶
func (s *TagService) GetAssetTags(assetId string) map[string]*system.Tag
func (*TagService) GetAssetsByTags ¶
func (s *TagService) GetAssetsByTags(assetTags []uint, network string) []*system.Asset
func (*TagService) GetUserTags ¶
func (s *TagService) GetUserTags(user string) map[string]*system.Tag
type TypedDBInitHandler ¶
type TypedDBInitHandler interface { EnsureDB(ctx context.Context, conf *request.InitDB) (context.Context, error) // 建库,失败属于 fatal error,因此让它 panic WriteConfig(ctx context.Context) error // 回写配置 InitTables(ctx context.Context, inits initSlice) error // 建表 handler InitData(ctx context.Context, inits initSlice) error // 建数据 handler }
TypedDBInitHandler 执行传入的 initializer
type UserService ¶
type UserService struct{}
func (*UserService) ChangePassword ¶
func (*UserService) DeleteUser ¶
func (userService *UserService) DeleteUser(id int) (err error)
func (*UserService) FindUserById ¶
func (userService *UserService) FindUserById(id int) (user *system.SysUser, err error)
func (*UserService) FindUserByUuid ¶
func (userService *UserService) FindUserByUuid(uuid string) (user *system.SysUser, err error)
func (*UserService) GetUserInfo ¶
func (*UserService) GetUserInfoList ¶
func (userService *UserService) GetUserInfoList(info request.PageInfo) (list interface{}, total int64, err error)
func (*UserService) ResetPassword ¶
func (userService *UserService) ResetPassword(ID uint) (err error)
func (*UserService) SetUserAuthorities ¶
func (userService *UserService) SetUserAuthorities(id uint, authorityIds []uint) (err error)
func (*UserService) SetUserAuthority ¶
func (userService *UserService) SetUserAuthority(id uint, authorityId uint) (err error)
func (*UserService) SetUserInfo ¶
func (userService *UserService) SetUserInfo(req system.SysUser) error
Source Files ¶
- enter.go
- jwt_black_list.go
- sys_ansible.go
- sys_api.go
- sys_asset.go
- sys_authority.go
- sys_authority_btn.go
- sys_auto_code.go
- sys_auto_code_interface.go
- sys_auto_code_mysql.go
- sys_auto_code_oracle.go
- sys_auto_code_pgsql.go
- sys_autocode_history.go
- sys_base_menu.go
- sys_casbin.go
- sys_devops_common.go
- sys_dictionary.go
- sys_dictionary_detail.go
- sys_gamecmdb.go
- sys_initdb.go
- sys_initdb_mysql.go
- sys_initdb_pgsql.go
- sys_menu.go
- sys_operation_record.go
- sys_project.go
- sys_securegroup.go
- sys_system.go
- sys_systemuser.go
- sys_tag.go
- sys_user.go