Documentation
¶
Index ¶
- type Service
- func (s *Service) AllBuilds(appIDS []int64) (builds []*model.Build, err error)
- func (s *Service) Apm(treeID int64, name, apmname, username string) (err error)
- func (s *Service) ApmBuild(val *model.ServiceName, name, username string, treeID int64) (err error)
- func (s *Service) AppByTeam(commonConfigID int64) (tagMap map[int64]*model.TagMap, err error)
- func (s *Service) AppByTree(treeID int64, env, zone string) (app *model.App, err error)
- func (s *Service) AppIDGetTreeID(appID int64) (TreeID int64, err error)
- func (s *Service) AppList(ctx context.Context, bu, team, name, env, zone string, ps, pn int64, ...) (pager *model.AppPager, err error)
- func (s *Service) AppRename(treeID int64, user, cookie string) (err error)
- func (s *Service) AppsByTreeZone(treeID int64, zone string) (apps []*model.App, err error)
- func (s *Service) AuthApp(ctx context.Context, user, cookie string, treeID int64) (rule int8, err error)
- func (s *Service) AuthApps(ctx context.Context, user, cookie string) (nodes *model.CacheData, err error)
- func (s *Service) Build(ID int64) (build *model.Build, err error)
- func (s *Service) BuildByName(appID int64, name string) (build *model.Build, err error)
- func (s *Service) BuildConfigInfos(appName, env, zone string, buildID, treeID int64) (res map[string][]*model.ConfigRefs, err error)
- func (s *Service) BuildGetTreeID(buildID int64) (TreeID int64, err error)
- func (s *Service) Builds(treeID int64, appName, env, zone string) (builds []*model.Build, err error)
- func (s *Service) BuildsByApp(appID int64) (builds []*model.Build, err error)
- func (s *Service) CanalCheckToken(AppName, Env, Zone, Token string) (err error)
- func (s *Service) CasterEnvs(zone string, treeID int64) (envs []*model.Env, err error)
- func (s *Service) ClearForce(ctx context.Context, treeID int64, env, zone, build string, ...) (err error)
- func (s *Service) ClearHost(c context.Context, treeID int64, env, zone string) (err error)
- func (s *Service) Close()
- func (s *Service) ComConfig(id int64) (conf *model.CommonConf, err error)
- func (s *Service) ComConfigsByName(teamName, env, zone, name string) (confs []*model.CommonConf, err error)
- func (s *Service) ComConfigsByTeam(name, env, zone string, ps, pn int64) (pager *model.CommonConfPager, err error)
- func (s *Service) CommonPush(ctx context.Context, tagID, commonConfigID int64, user string) (err error)
- func (s *Service) Config(ID int64) (conf *model.Config, err error)
- func (s *Service) ConfigDel(ID int64) (err error)
- func (s *Service) ConfigGetTreeID(configID int64) (TreeID int64, err error)
- func (s *Service) ConfigList(appID int64, name string) (confs []*model.Config, err error)
- func (s *Service) ConfigRefs(appName, env, zone string, buildID, treeID int64) (res []*model.ConfigRefs, err error)
- func (s *Service) ConfigSearchAll(ctx context.Context, env, zone, like string, nodes *model.CacheData) (searchs []*model.ConfigSearch, err error)
- func (s *Service) ConfigSearchApp(ctx context.Context, appName, env, zone, like string, buildID, treeID int64) (searchs []*model.ConfigSearch, err error)
- func (s *Service) Configs(appName, env, zone string, buildID, treeID int64) (res *model.ConfigRes, err error)
- func (s *Service) ConfigsByAppID(appID int64, state int8) (confs []*model.Config, err error)
- func (s *Service) ConfigsByAppName(appName, env, zone string, treeID int64, state int8) (confs []*model.Config, err error)
- func (s *Service) ConfigsByBuildID(buildID int64) (confs []*model.Config, err error)
- func (s *Service) ConfigsByIDs(ids []int64) (confs []*model.Config, err error)
- func (s *Service) ConfigsByTagID(tagID int64) (confs []*model.Config, err error)
- func (s *Service) ConfigsByTree(treeID int64, env, zone, name string) (confs []*model.Config, err error)
- func (s *Service) CreateApp(name, env, zone string, treeID int64) error
- func (s *Service) CreateBuild(build *model.Build, treeID int64, env, zone string) (err error)
- func (s *Service) CreateComConf(conf *model.CommonConf, name, env, zone string, skiplint bool) (err error)
- func (s *Service) CreateConf(conf *model.Config, treeID int64, env, zone string, skiplint bool) error
- func (s *Service) CreateTag(tag *model.Tag, treeID int64, env, zone string) (err error)
- func (s *Service) CreateTeam(name, env, zone string) error
- func (s *Service) Delete(ID int64) (err error)
- func (s *Service) Diff(ID, BuildID int64) (data *model.Config, err error)
- func (s *Service) Envs(ctx context.Context, user, appName, zone string, treeID int64, ...) (envs []*model.Env, err error)
- func (s *Service) EnvsByTeam(ctx context.Context, appName, zone string, nodes *model.CacheData) (envs []*model.Env, err error)
- func (s *Service) GetApps(env string) (apps []*model.App, err error)
- func (s *Service) GetConfig(ids []int64, name string) (config *model.Config, err error)
- func (s *Service) GetConfigIDS(tagIDS []int64) (tags []*model.Tag, err error)
- func (s *Service) GetConfigs(ids []int64, name string) (configs []*model.Config, err error)
- func (s *Service) GetDelInfos(c context.Context, BuildID int64) (err error)
- func (s *Service) Hosts(c context.Context, treeID int64, appName, env, zone string) (hosts []*model.Host, err error)
- func (s *Service) IdsGetApps(ids []int64) (apps []*model.App, err error)
- func (s *Service) LastBuildConfigConfigs(appID, buildID int64) (confs []*model.Config, err error)
- func (s *Service) LastBuildConfigs(appID, buildID int64) (confs []*model.Config, err error)
- func (s *Service) LastTagByAppBuild(appID, buildID int64) (tag *model.Tag, err error)
- func (s *Service) LastTags(treeID int64, env, zone, bName string) (tags []*model.Tag, err error)
- func (s *Service) LastTasConfigDiff(tagID, appID, buildID int64) (tag *model.Tag, err error)
- func (s *Service) LintConfig(filename, content string) ([]lint.LineErr, error)
- func (s *Service) NamesByAppTree(appName, env, zone string, treeID int64) (names []string, err error)
- func (s *Service) NamesByTeam(teamName, env, zone string) (names []*model.CommonName, err error)
- func (s *Service) NewCommon(from int64) (new int64, err error)
- func (s *Service) Node(ctx context.Context, user, node, team, cookie string, nodes *model.CacheData) (res []*model.Node, err error)
- func (s *Service) Ping() (err error)
- func (s *Service) Push(c context.Context, treeID int64, env, zone, bver string, ver int64) (err error)
- func (s *Service) PushForce(c context.Context, treeID int64, env, zone, bver string, ver int64, ...) (err error)
- func (s *Service) RollBackTag(tagID int64) (tag *model.Tag, err error)
- func (s *Service) SetToken(c context.Context, treeID int64, env, zone, token string) (err error)
- func (s *Service) SyncTree(ctx context.Context, user string, cookie string) (nodes *model.CacheData, err error)
- func (s *Service) Tag(ID int64) (tag *model.Tag, err error)
- func (s *Service) TagByAppBuild(appID, buildID int64) (tag *model.Tag, err error)
- func (s *Service) TagByAppBuildLastConfig(appID, buildID, tagID int64, cids []int64) (configID int64, err error)
- func (s *Service) TagGetTreeID(tagID int64) (TreeID int64, err error)
- func (s *Service) TagsByBuild(appName, env, zone, name string, ps, pn, treeID int64) (tagPager *model.TagConfigPager, err error)
- func (s *Service) TeamByName(name, env, zone string) (team *model.Team, err error)
- func (s *Service) Tree(ctx context.Context, user string) (data interface{}, err error)
- func (s *Service) UpAppStatus(ctx context.Context, status int8, treeID int64) (err error)
- func (s *Service) UpdateComConfValue(conf *model.CommonConf, skiplint bool) (err error)
- func (s *Service) UpdateConfState(ID int64) (err error)
- func (s *Service) UpdateConfValue(conf *model.Config, skiplint bool) (err error)
- func (s *Service) UpdateForce(ctx context.Context, treeID, version int64, env, zone, build, username string, ...) (err error)
- func (s *Service) UpdateTag(ctx context.Context, treeID int64, env, zone, name string, tag *model.Tag) (err error)
- func (s *Service) UpdateTagID(ctx context.Context, env, zone, bName string, tag, TreeID int64) (err error)
- func (s *Service) UpdateToken(c context.Context, env, zone string, treeID int64) (err error)
- func (s *Service) Value(ID int64) (conf *model.Config, err error)
- func (s *Service) ZoneCopy(ctx context.Context, AppName, From, To string, TreeID int64) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct { //apm gorm DBApm *gorm.DB //db gorm DB *gorm.DB // contains filtered or unexported fields }
Service service
func (*Service) AppIDGetTreeID ¶
AppIDGetTreeID ...
func (*Service) AppList ¶
func (s *Service) AppList(ctx context.Context, bu, team, name, env, zone string, ps, pn int64, nodes *model.CacheData, status int8) (pager *model.AppPager, err error)
AppList get token by Name.
func (*Service) AppsByTreeZone ¶
AppsByTreeZone get token by Name and zone.
func (*Service) AuthApp ¶
func (s *Service) AuthApp(ctx context.Context, user, cookie string, treeID int64) (rule int8, err error)
AuthApp authApp.
func (*Service) AuthApps ¶
func (s *Service) AuthApps(ctx context.Context, user, cookie string) (nodes *model.CacheData, err error)
AuthApps authApps.
func (*Service) BuildByName ¶
BuildByName get Build by build ID.
func (*Service) BuildConfigInfos ¶
func (s *Service) BuildConfigInfos(appName, env, zone string, buildID, treeID int64) (res map[string][]*model.ConfigRefs, err error)
BuildConfigInfos configRefs.
func (*Service) BuildGetTreeID ¶
BuildGetTreeID ...
func (*Service) Builds ¶
func (s *Service) Builds(treeID int64, appName, env, zone string) (builds []*model.Build, err error)
Builds get builds by app id.
func (*Service) BuildsByApp ¶
BuildsByApp buildsByApp.
func (*Service) CanalCheckToken ¶
CanalCheckToken ...
func (*Service) CasterEnvs ¶
CasterEnvs ...
func (*Service) ClearForce ¶
func (s *Service) ClearForce(ctx context.Context, treeID int64, env, zone, build string, hosts map[string]string) (err error)
ClearForce delete force.
func (*Service) ComConfig ¶
func (s *Service) ComConfig(id int64) (conf *model.CommonConf, err error)
ComConfig get common config by id.
func (*Service) ComConfigsByName ¶
func (s *Service) ComConfigsByName(teamName, env, zone, name string) (confs []*model.CommonConf, err error)
ComConfigsByName get Config by Config name.
func (*Service) ComConfigsByTeam ¶
func (s *Service) ComConfigsByTeam(name, env, zone string, ps, pn int64) (pager *model.CommonConfPager, err error)
ComConfigsByTeam common config by team.
func (*Service) CommonPush ¶
func (s *Service) CommonPush(ctx context.Context, tagID, commonConfigID int64, user string) (err error)
CommonPush ...
func (*Service) ConfigGetTreeID ¶
ConfigGetTreeID ...
func (*Service) ConfigList ¶
ConfigList ...
func (*Service) ConfigRefs ¶
func (s *Service) ConfigRefs(appName, env, zone string, buildID, treeID int64) (res []*model.ConfigRefs, err error)
ConfigRefs configRefs.
func (*Service) ConfigSearchAll ¶
func (s *Service) ConfigSearchAll(ctx context.Context, env, zone, like string, nodes *model.CacheData) (searchs []*model.ConfigSearch, err error)
ConfigSearchAll configSearchAll.
func (*Service) ConfigSearchApp ¶
func (s *Service) ConfigSearchApp(ctx context.Context, appName, env, zone, like string, buildID, treeID int64) (searchs []*model.ConfigSearch, err error)
ConfigSearchApp configSearchApp.
func (*Service) Configs ¶
func (s *Service) Configs(appName, env, zone string, buildID, treeID int64) (res *model.ConfigRes, err error)
Configs configs.
func (*Service) ConfigsByAppID ¶
ConfigsByAppID configs by app ID.
func (*Service) ConfigsByAppName ¶
func (s *Service) ConfigsByAppName(appName, env, zone string, treeID int64, state int8) (confs []*model.Config, err error)
ConfigsByAppName get configs by app name.
func (*Service) ConfigsByBuildID ¶
ConfigsByBuildID get configs by build ID.
func (*Service) ConfigsByIDs ¶
ConfigsByIDs get Config by IDs.
func (*Service) ConfigsByTagID ¶
ConfigsByTagID get configs by tag id.
func (*Service) ConfigsByTree ¶
func (s *Service) ConfigsByTree(treeID int64, env, zone, name string) (confs []*model.Config, err error)
ConfigsByTree get Config by Config name.
func (*Service) CreateBuild ¶
CreateBuild create build.
func (*Service) CreateComConf ¶
func (s *Service) CreateComConf(conf *model.CommonConf, name, env, zone string, skiplint bool) (err error)
CreateComConf create config.
func (*Service) CreateConf ¶
func (s *Service) CreateConf(conf *model.Config, treeID int64, env, zone string, skiplint bool) error
CreateConf create config.
func (*Service) CreateTeam ¶
CreateTeam create App.
func (*Service) Envs ¶
func (s *Service) Envs(ctx context.Context, user, appName, zone string, treeID int64, nodes *model.CacheData) (envs []*model.Env, err error)
Envs envs.
func (*Service) EnvsByTeam ¶
func (s *Service) EnvsByTeam(ctx context.Context, appName, zone string, nodes *model.CacheData) (envs []*model.Env, err error)
EnvsByTeam envs.
func (*Service) GetConfigIDS ¶
GetConfigIDS ...
func (*Service) GetConfigs ¶
GetConfigs ...
func (*Service) GetDelInfos ¶
GetDelInfos get delete info.
func (*Service) Hosts ¶
func (s *Service) Hosts(c context.Context, treeID int64, appName, env, zone string) (hosts []*model.Host, err error)
Hosts get hosts.
func (*Service) IdsGetApps ¶
IdsGetApps ...
func (*Service) LastBuildConfigConfigs ¶
LastBuildConfigConfigs get configs by build ID.
func (*Service) LastBuildConfigs ¶
LastBuildConfigs get configs by build ID.
func (*Service) LastTagByAppBuild ¶
LastTagByAppBuild get tags by app and build.
func (*Service) LastTasConfigDiff ¶
LastTasConfigDiff ...
func (*Service) LintConfig ¶
LintConfig lint config file
func (*Service) NamesByAppTree ¶
func (s *Service) NamesByAppTree(appName, env, zone string, treeID int64) (names []string, err error)
NamesByAppTree get configs by app name.
func (*Service) NamesByTeam ¶
func (s *Service) NamesByTeam(teamName, env, zone string) (names []*model.CommonName, err error)
NamesByTeam get configs by team name.
func (*Service) Node ¶
func (s *Service) Node(ctx context.Context, user, node, team, cookie string, nodes *model.CacheData) (res []*model.Node, err error)
Node node.
func (*Service) Push ¶
func (s *Service) Push(c context.Context, treeID int64, env, zone, bver string, ver int64) (err error)
Push push new ver to config-service.
func (*Service) PushForce ¶
func (s *Service) PushForce(c context.Context, treeID int64, env, zone, bver string, ver int64, hosts map[string]string, sType int8) (err error)
PushForce push new ver to config-service.
func (*Service) RollBackTag ¶
RollBackTag ...
func (*Service) SyncTree ¶
func (s *Service) SyncTree(ctx context.Context, user string, cookie string) (nodes *model.CacheData, err error)
SyncTree syncTree.
func (*Service) TagByAppBuild ¶
TagByAppBuild ...
func (*Service) TagByAppBuildLastConfig ¶
func (s *Service) TagByAppBuildLastConfig(appID, buildID, tagID int64, cids []int64) (configID int64, err error)
TagByAppBuildLastConfig ...
func (*Service) TagGetTreeID ¶
TagGetTreeID ...
func (*Service) TagsByBuild ¶
func (s *Service) TagsByBuild(appName, env, zone, name string, ps, pn, treeID int64) (tagPager *model.TagConfigPager, err error)
TagsByBuild get tags by app name.
func (*Service) TeamByName ¶
TeamByName get team by Name.
func (*Service) UpAppStatus ¶
UpAppStatus edit status.
func (*Service) UpdateComConfValue ¶
func (s *Service) UpdateComConfValue(conf *model.CommonConf, skiplint bool) (err error)
UpdateComConfValue update config value.
func (*Service) UpdateConfState ¶
UpdateConfState update config state.
func (*Service) UpdateConfValue ¶
UpdateConfValue update config state.
func (*Service) UpdateForce ¶
func (s *Service) UpdateForce(ctx context.Context, treeID, version int64, env, zone, build, username string, hosts map[string]string) (err error)
UpdateForce update force.
func (*Service) UpdateTag ¶
func (s *Service) UpdateTag(ctx context.Context, treeID int64, env, zone, name string, tag *model.Tag) (err error)
UpdateTag update tag.
func (*Service) UpdateTagID ¶
func (s *Service) UpdateTagID(ctx context.Context, env, zone, bName string, tag, TreeID int64) (err error)
UpdateTagID update tag.
func (*Service) UpdateToken ¶
UpdateToken update token.