service

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

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 New

func New(c *conf.Config) (s *Service)

New new a service

func (*Service) AllBuilds

func (s *Service) AllBuilds(appIDS []int64) (builds []*model.Build, err error)

AllBuilds ...

func (*Service) Apm

func (s *Service) Apm(treeID int64, name, apmname, username string) (err error)

Apm apm.

func (*Service) ApmBuild

func (s *Service) ApmBuild(val *model.ServiceName, name, username string, treeID int64) (err error)

ApmBuild apmBuild.

func (*Service) AppByTeam

func (s *Service) AppByTeam(commonConfigID int64) (tagMap map[int64]*model.TagMap, err error)

AppByTeam get tagMap

func (*Service) AppByTree

func (s *Service) AppByTree(treeID int64, env, zone string) (app *model.App, err error)

AppByTree get token by Name.

func (*Service) AppIDGetTreeID

func (s *Service) AppIDGetTreeID(appID int64) (TreeID int64, err error)

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) AppRename

func (s *Service) AppRename(treeID int64, user, cookie string) (err error)

AppRename ...

func (*Service) AppsByTreeZone

func (s *Service) AppsByTreeZone(treeID int64, zone string) (apps []*model.App, err error)

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) Build

func (s *Service) Build(ID int64) (build *model.Build, err error)

Build get Build by build ID.

func (*Service) BuildByName

func (s *Service) BuildByName(appID int64, name string) (build *model.Build, err error)

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

func (s *Service) BuildGetTreeID(buildID int64) (TreeID int64, err error)

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

func (s *Service) BuildsByApp(appID int64) (builds []*model.Build, err error)

BuildsByApp buildsByApp.

func (*Service) CanalCheckToken

func (s *Service) CanalCheckToken(AppName, Env, Zone, Token string) (err error)

CanalCheckToken ...

func (*Service) CasterEnvs

func (s *Service) CasterEnvs(zone string, treeID int64) (envs []*model.Env, err error)

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) ClearHost

func (s *Service) ClearHost(c context.Context, treeID int64, env, zone string) (err error)

ClearHost clear hosts.

func (*Service) Close

func (s *Service) Close()

Close close resource

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) Config

func (s *Service) Config(ID int64) (conf *model.Config, err error)

Config get Config by Config ID.

func (*Service) ConfigDel

func (s *Service) ConfigDel(ID int64) (err error)

ConfigDel config is delete.

func (*Service) ConfigGetTreeID

func (s *Service) ConfigGetTreeID(configID int64) (TreeID int64, err error)

ConfigGetTreeID ...

func (*Service) ConfigList

func (s *Service) ConfigList(appID int64, name string) (confs []*model.Config, err error)

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

func (s *Service) ConfigsByAppID(appID int64, state int8) (confs []*model.Config, err error)

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

func (s *Service) ConfigsByBuildID(buildID int64) (confs []*model.Config, err error)

ConfigsByBuildID get configs by build ID.

func (*Service) ConfigsByIDs

func (s *Service) ConfigsByIDs(ids []int64) (confs []*model.Config, err error)

ConfigsByIDs get Config by IDs.

func (*Service) ConfigsByTagID

func (s *Service) ConfigsByTagID(tagID int64) (confs []*model.Config, err error)

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) CreateApp

func (s *Service) CreateApp(name, env, zone string, treeID int64) error

CreateApp create App.

func (*Service) CreateBuild

func (s *Service) CreateBuild(build *model.Build, treeID int64, env, zone string) (err error)

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) CreateTag

func (s *Service) CreateTag(tag *model.Tag, treeID int64, env, zone string) (err error)

CreateTag create App.

func (*Service) CreateTeam

func (s *Service) CreateTeam(name, env, zone string) error

CreateTeam create App.

func (*Service) Delete

func (s *Service) Delete(ID int64) (err error)

Delete delete Build by build ID.

func (*Service) Diff

func (s *Service) Diff(ID, BuildID int64) (data *model.Config, err error)

Diff get value by Config ID.

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) GetApps

func (s *Service) GetApps(env string) (apps []*model.App, err error)

GetApps ...

func (*Service) GetConfig

func (s *Service) GetConfig(ids []int64, name string) (config *model.Config, err error)

GetConfig ...

func (*Service) GetConfigIDS

func (s *Service) GetConfigIDS(tagIDS []int64) (tags []*model.Tag, err error)

GetConfigIDS ...

func (*Service) GetConfigs

func (s *Service) GetConfigs(ids []int64, name string) (configs []*model.Config, err error)

GetConfigs ...

func (*Service) GetDelInfos

func (s *Service) GetDelInfos(c context.Context, BuildID int64) (err error)

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

func (s *Service) IdsGetApps(ids []int64) (apps []*model.App, err error)

IdsGetApps ...

func (*Service) LastBuildConfigConfigs

func (s *Service) LastBuildConfigConfigs(appID, buildID int64) (confs []*model.Config, err error)

LastBuildConfigConfigs get configs by build ID.

func (*Service) LastBuildConfigs

func (s *Service) LastBuildConfigs(appID, buildID int64) (confs []*model.Config, err error)

LastBuildConfigs get configs by build ID.

func (*Service) LastTagByAppBuild

func (s *Service) LastTagByAppBuild(appID, buildID int64) (tag *model.Tag, err error)

LastTagByAppBuild get tags by app and build.

func (*Service) LastTags

func (s *Service) LastTags(treeID int64, env, zone, bName string) (tags []*model.Tag, err error)

LastTags get tags by app name.

func (*Service) LastTasConfigDiff

func (s *Service) LastTasConfigDiff(tagID, appID, buildID int64) (tag *model.Tag, err error)

LastTasConfigDiff ...

func (*Service) LintConfig

func (s *Service) LintConfig(filename, content string) ([]lint.LineErr, error)

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) NewCommon

func (s *Service) NewCommon(from int64) (new int64, err error)

NewCommon get new common id

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) Ping

func (s *Service) Ping() (err error)

Ping check server ok.

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

func (s *Service) RollBackTag(tagID int64) (tag *model.Tag, err error)

RollBackTag ...

func (*Service) SetToken

func (s *Service) SetToken(c context.Context, treeID int64, env, zone, token string) (err error)

SetToken set token to config-service.

func (*Service) SyncTree

func (s *Service) SyncTree(ctx context.Context, user string, cookie string) (nodes *model.CacheData, err error)

SyncTree syncTree.

func (*Service) Tag

func (s *Service) Tag(ID int64) (tag *model.Tag, err error)

Tag get tag by id.

func (*Service) TagByAppBuild

func (s *Service) TagByAppBuild(appID, buildID int64) (tag *model.Tag, err error)

TagByAppBuild ...

func (*Service) TagByAppBuildLastConfig

func (s *Service) TagByAppBuildLastConfig(appID, buildID, tagID int64, cids []int64) (configID int64, err error)

TagByAppBuildLastConfig ...

func (*Service) TagGetTreeID

func (s *Service) TagGetTreeID(tagID int64) (TreeID int64, err error)

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

func (s *Service) TeamByName(name, env, zone string) (team *model.Team, err error)

TeamByName get team by Name.

func (*Service) Tree

func (s *Service) Tree(ctx context.Context, user string) (data interface{}, err error)

Tree get service tree.

func (*Service) UpAppStatus

func (s *Service) UpAppStatus(ctx context.Context, status int8, treeID int64) (err error)

UpAppStatus edit status.

func (*Service) UpdateComConfValue

func (s *Service) UpdateComConfValue(conf *model.CommonConf, skiplint bool) (err error)

UpdateComConfValue update config value.

func (*Service) UpdateConfState

func (s *Service) UpdateConfState(ID int64) (err error)

UpdateConfState update config state.

func (*Service) UpdateConfValue

func (s *Service) UpdateConfValue(conf *model.Config, skiplint bool) (err error)

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

func (s *Service) UpdateToken(c context.Context, env, zone string, treeID int64) (err error)

UpdateToken update token.

func (*Service) Value

func (s *Service) Value(ID int64) (conf *model.Config, err error)

Value get value by Config ID.

func (*Service) ZoneCopy

func (s *Service) ZoneCopy(ctx context.Context, AppName, From, To string, TreeID int64) (err error)

ZoneCopy ...

Jump to

Keyboard shortcuts

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