view

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigFormatToml ..
	ConfigFormatToml = "toml"
	// ConfigFormatYaml ..
	ConfigFormatYaml = "yaml"
)
View Source
const (
	ConfigDepSettingName string = "config_dep"
)

Variables

View Source
var (
	// ConfigFormats Verified list
	ConfigFormats = []ConfigFormat{ConfigFormatToml, ConfigFormatYaml}
)
View Source
var (
	// todo can't global config
	// 对各项配置进行设置,设置项写到此处才能生效
	SettingFieldConfigs = map[string]SettingFieldConfig{
		"grafana": {
			Default: `{"host":"","header_name":"","api_dashboard_addr":"","instance_dashboard_addr":"","overview_dashboard_addr":""}`,
			Validate: func(value string) error {
				return nil
			},
		},
		ConfigDepSettingName: {
			Default: `{"interval":720}`,
			Validate: func(value string) error {
				return nil
			},
		},
		"gateway": {
			Default: "[]",
			Validate: func(value string) error {
				field := SettingGateway{}
				err := json.Unmarshal([]byte(value), &field)
				if err != nil {
					return err
				}

				settingMap := make(map[string]SettingGatewayItem)
				for _, item := range field {
					if _, ok := settingMap[item.Domain]; ok {

						return fmt.Errorf("域名 %s 存在重复配置", item.Domain)
					}

					settingMap[item.Domain] = item
				}

				return nil
			},
		},
	}
)

Functions

func CheckConfigFormat added in v0.2.0

func CheckConfigFormat(format ConfigFormat) bool

CheckConfigFormat 检查配置文件格式是否符合要求

func CheckSettingNameValid added in v0.2.0

func CheckSettingNameValid(settingName string) bool

Types

type APIListItem added in v0.2.0

type APIListItem struct {
	Path   string `json:"path"`
	Method string `json:"method"`
}

type APIPermItem added in v0.2.0

type APIPermItem struct {
	Method string `json:"method"`
	Path   string `json:"path"`
}

type AccessTokenItem added in v0.2.0

type AccessTokenItem struct {
	Name      string `json:"name"`
	AppID     string `json:"app_id"`
	AppSecret string `json:"app_secret"`
}

type AppListWithEnvItem added in v0.2.0

type AppListWithEnvItem struct {
	db.AppInfo
	Envs []string `json:"envs"`
}

type AppPermItem added in v0.2.0

type AppPermItem struct {
	Aid           int      `json:"aid"`
	AppName       string   `json:"app_name"`
	AvailableEnvs []string `json:"available_envs"` // 可选的环境
	AllowEnvs     []string `json:"allow_envs"`     // 可用的环境
}

type BatchCheckResourceVersionItem added in v0.2.0

type BatchCheckResourceVersionItem struct {
	Name          string    `json:"name"`
	Value         string    `json:"value"`
	Version       uint      `json:"version"`
	LatestVersion uint      `json:"latest_version"`
	UpdatedAt     time.Time `json:"updated_at"`
}

type ConfigFormat added in v0.2.0

type ConfigFormat string

ConfigFormat ..

type ConfigResourceVersion added in v0.2.0

type ConfigResourceVersion struct {
	Version   uint      `json:"version"`
	CreatedAt time.Time `json:"created_at"`
}

type ConfigurationPublishData added in v0.2.0

type ConfigurationPublishData struct {
	Content  string   `json:"content"`
	Metadata Metadata `json:"metadata"`
}

ConfigurationPublishData ..

type ConfigurationStatus added in v0.2.0

type ConfigurationStatus struct {
	// etcd store data
	FileName   string `json:"file_name"`
	Version    string `json:"md5"`
	Hostname   string `json:"hostname"`
	Env        string `json:"env"`
	Timestamp  int64  `json:"timestamp"`
	IP         string `json:"ip"`
	HealthPort string `json:"health_port"`

	// attach key
	ZoneCode      string `json:"zone_code"`
	EffectVersion string `json:"effect_version"`
}

ConfigurationStatus ..

type EtcdInfo

type EtcdInfo struct {
	Key            string `json:"key"`
	CreateRevision int    `json:"createRevision"`
	ModRevision    int    `json:"modRevision"`
	Version        int    `json:"version"`
	Value          []byte `json:"value"`
}

type GovernIdcStatus

type GovernIdcStatus struct {
	ZoneCode string `json:"zone_code"`
	Status   string `json:"status"`
	Message  string `json:"message"`
}

type GovernServerStats

type GovernServerStats struct {
	IP       string      `json:"ip"`
	Hostname string      `json:"hostname"`
	Time     string      `json:"time"` // 每次展示数据的时间
	Err      string      `json:"err"`
	Servers  interface{} `json:"servers"`
}

type JunoAgent added in v0.2.0

type JunoAgent struct {
	HostName string `json:"host_name"`
	IPPort   string `json:"ip"`
}

JunoAgent ..

type ListGroupItem added in v0.2.0

type ListGroupItem struct {
	Name string `json:"name"`
}

type ListUserItem added in v0.2.0

type ListUserItem struct {
	UID       uint   `json:"uid"`
	UserName  string `json:"user_name"`
	NickName  string `json:"nick_name"`
	Access    string `json:"access"`
	GroupName string `json:"group_name"`
}
type MenuTree []MenuTreeItem
type MenuTreeItem struct {
	Name     string   `json:"name"`
	Path     string   `json:"path"`
	Icon     string   `json:"icon"`
	Children MenuTree `json:"children"`
}

type Metadata added in v0.2.0

type Metadata struct {
	Timestamp int64    `json:"timestamp"`
	Version   string   `json:"version"`
	Format    string   `json:"format"`
	Paths     []string `json:"paths"`
}

Metadata ..

type Pagination

type Pagination struct {
	Current  int `json:"current"`
	Total    int `json:"total"`
	PageSize int `json:"pageSize"`
}

响应

func NewPagination

func NewPagination(current int, pageSize int) *Pagination

type RelationApps

type RelationApps struct {
	AppName    string `json:"appName"`
	Name       string `json:"name"`
	Type       string `json:"type"`
	Addr       string `json:"addr"`
	UpdateTime int64  `json:"update_time"`
	Info       string `json:"info"`
}

type ReportInfo

type ReportInfo struct {
	Id         int     `json:"id"`
	Aid        int     `json:"aid"`
	AppName    string  `json:"appName" gorm:"column:app_name"`
	Normalized float64 `json:"normalized"`
	Warn       int     `json:"warn"`
	Dpainc     int     `json:"dpainc" gorm:"column:dpainc"`
	Error      int     `json:"error"`
	Merror     int     `json:"merror" gorm:"column:merror"`
	Fatal      int     `json:"fatal"`
	Person     string  `json:"person" gorm:"column:users"`
	Timestamp  int     `json:"timestamp" gorm:"column:timestamp"`
}

type ReqAddEtcd

type ReqAddEtcd struct {
	Prefix      string `json:"prefix"`
	AppName     string `json:"appName"`
	ServiceName string `json:"serviceName"`
	Suffix      string `json:"suffix"`
	ZoneCode    string `json:"zone_code"`
	Env         string `json:"env"`
	DataSource  string `json:"dataSource"`
	Value       string `json:"value"`
}

type ReqAppList

type ReqAppList struct {
	CurrentPage int    `json:"currentPage" form:"currentPage"` // 项目名称
	ShowNum     int    `json:"showNum"  form:"showNum"`        // gitlab项目ID
	Lang        string `json:"lang" form:"lang"`               // filter by lang
	Qs          string `json:"qs" form:"qs"`                   // 模糊搜索
	Sort        string `json:"sort" form:"sort"`               // 模糊搜索
}

ReqAppList ...

type ReqAppListWithEnv added in v0.2.0

type ReqAppListWithEnv struct {
	SearchText string `query:"searchText"`
	Page       int    `query:"page"`
	PageSize   int    `query:"pageSize"`
}

type ReqAppSearch

type ReqAppSearch struct {
	Repos string `json:"repos" form:"repos"`
	Stats string `json:"stats" form:"stats"`
	Q     string `json:"q" form:"q"`
	Files string `json:"files" form:"files"`
	I     string `json:"i" form:"i"`
	Ctx   string `json:"ctx" form:"ctx"`
}

ReqAppSearch ...

type ReqBatchCheckResourceVersion added in v0.2.0

type ReqBatchCheckResourceVersion []struct {
	Name    string `json:"name"`
	Version uint   `json:"version"`
	Zone    string `json:"zone"` // zone code
	Env     string `json:"env"`
}

type ReqChangeAppGroup added in v0.2.0

type ReqChangeAppGroup struct {
	AppName   string `json:"app_name"`
	AppEnv    string `json:"app_env"`
	GroupName string `json:"group_name"`
}

type ReqChangeUserGroup added in v0.2.0

type ReqChangeUserGroup struct {
	UID       uint   `json:"uid"`
	GroupName string `json:"group_name"`
}

type ReqConfigInstanceList added in v0.2.0

type ReqConfigInstanceList struct {
	ConfigurationID uint   `json:"id" query:"id" validate:"required"`
	Env             string `json:"env" query:"env" validate:"required"`
	ZoneCode        string `json:"zone_code" query:"zone_code" validate:"required"`
}

type ReqConfigPublish added in v0.2.0

type ReqConfigPublish struct {
	AppName      string   `json:"app_name"`
	ZoneCode     string   `json:"zone_code"`
	Port         string   `json:"port"`
	FileName     string   `json:"file_name"`
	Format       string   `json:"format"`
	Content      string   `json:"content"`
	InstanceList []string `json:"instance_list"`
	Env          string   `json:"env"`
	Version      string   `json:"version"`
}

ReqConfigPublish configuration publish request struct

type ReqCreateAccessToken added in v0.2.0

type ReqCreateAccessToken struct {
	Name string `json:"name" valid:"required"`
}

type ReqCreateConfig added in v0.2.0

type ReqCreateConfig struct {
	AppName  string       `json:"app_name" validate:"required"`
	Env      string       `json:"env" validate:"required"`
	Zone     string       `json:"zone" validate:"required"`
	FileName string       `json:"file_name" validate:"required"` // 文件名(不带后缀)
	Format   ConfigFormat `json:"format" validate:"required"`    // 格式后缀名(比如: toml, yaml)
}

ReqCreateConfig ..

type ReqCreateConfigResource added in v0.2.0

type ReqCreateConfigResource struct {
	Env         string   `json:"env" validate:"required"`
	Zone        string   `json:"zone" validate:"required"`
	Name        string   `json:"name" validate:"required"`
	Value       string   `json:"value" validate:"required"`
	IsGlobal    bool     `json:"is_global"`
	Description string   `json:"description" validate:"required"`
	Visible     bool     `json:"visible"`
	Tags        []string `json:"tags"`
}

type ReqCreateConfigResourceVersion added in v0.2.0

type ReqCreateConfigResourceVersion struct {
	ID          uint     `json:"id" validate:"required"`
	Value       string   `json:"value" validate:"required"`
	Description string   `json:"description" validate:"required"`
	Tags        []string `json:"tags"`
}

type ReqDeleteAccessToken added in v0.2.0

type ReqDeleteAccessToken struct {
	AppID string `json:"app_id" valid:"required"`
}

type ReqDeleteConfig added in v0.2.0

type ReqDeleteConfig struct {
	ID uint `json:"id" validate:"required"`
}

ReqDeleteConfig ..

type ReqDetailConfig added in v0.2.0

type ReqDetailConfig struct {
	ID uint `json:"id" validate:"required"`
}

ReqDetailConfig ..

type ReqDetailConfigResource added in v0.2.0

type ReqDetailConfigResource struct {
	ID uint `json:"id" validate:"required"`
}

type ReqDiffConfig added in v0.2.0

type ReqDiffConfig struct {
	ID        uint `query:"id" validate:"required"`         // 配置ID
	HistoryID uint `query:"history_id" validate:"required"` // 版本ID
}

ReqDiffConfig ..

type ReqEtcdServiceList

type ReqEtcdServiceList struct {
	AppName  string `json:"appName"`
	ZoneCode string `json:"zone_code"`
}

type ReqGetAppPerm added in v0.2.0

type ReqGetAppPerm struct {
	GroupName     string `json:"group_name"`
	AppNameSearch string `json:"app_name_search"`
	PageSize      uint   `json:"size"`
	Page          uint   `json:"page"`
}

type ReqGetConfigResourceByName added in v0.2.0

type ReqGetConfigResourceByName struct {
	Name string `json:"name"`
	Env  string `json:"env"`
	Zone string `json:"zone"` // Zone Code
}

type ReqGetEtcdList

type ReqGetEtcdList struct {
	Prefix      string `json:"prefix"`
	AppName     string `json:"appName"`
	ServiceName string `json:"serviceName"`
	Suffix      string `json:"suffix"`
	ZoneCode    string `json:"zone_code"`
	Env         string `json:"env"`
}

type ReqGetGroupAPIPerm added in v0.2.0

type ReqGetGroupAPIPerm struct {
	GroupName string `query:"group_name" valid:"required"`
}

type ReqGetGroupMenuPerm added in v0.2.0

type ReqGetGroupMenuPerm struct {
	GroupName string `query:"group_name"`
}

type ReqHTTPProxy added in v0.2.0

type ReqHTTPProxy struct {
	Address string            `json:"address"`
	URL     string            `json:"url"`
	Type    string            `json:"type"` // GET POST
	Params  map[string]string `json:"params"`
}

ReqHTTPProxy ..

type ReqHistoryConfig added in v0.2.0

type ReqHistoryConfig struct {
	ID   uint `json:"id" validate:"required"` // 配置文件ID
	Size uint `json:"size" validate:"required"`
	Page uint `json:"page"`
}

ReqHistoryConfig ..

type ReqListAccessToken added in v0.2.0

type ReqListAccessToken struct {
	Page     uint `query:"page"`
	PageSize uint `query:"page_size" valid:"required"`
}

type ReqListConfig added in v0.2.0

type ReqListConfig struct {
	AppName string `query:"app_name" validate:"required"`
	Env     string `query:"env" validate:"required"`
}

ReqListConfig ..

type ReqListConfigResource added in v0.2.0

type ReqListConfigResource struct {
	Page     uint     `json:"page"`
	PageSize uint     `json:"page_size" validate:"required"`
	Env      []string `json:"env"`
	Zone     []string `json:"zone"`
	Tag      string   `json:"tag"`
	Query    string   `json:"query"`
}

type ReqListUser added in v0.2.0

type ReqListUser struct {
	GroupName string `query:"group_name"`
	Search    string `query:"search"`
	Page      uint   `query:"page"`
	PageSize  uint   `query:"page_size"`
}

type ReqNodeHeartBeat added in v0.2.0

type ReqNodeHeartBeat struct {
	Hostname     string `json:"hostname"`
	IP           string `json:"ip"`
	RegionCode   string `json:"region_code"`
	RegionName   string `json:"region_name"`
	ZoneCode     string `json:"zone_code"`
	ZoneName     string `json:"zone_name"`
	AppName      string `json:"app_name"`
	Env          string `json:"env"`
	AgentType    int    `json:"agent_type"`
	AgentVersion string `json:"agent_version"`
	ProxyType    int    `json:"proxy_type"`
	ProxyVersion string `json:"proxy_version"`
}

ReqNodeHeartBeat ..

type ReqOptionCreate added in v0.2.0

type ReqOptionCreate struct {
	db.Option
}

type ReqOptionDelete added in v0.2.0

type ReqOptionDelete struct {
	db.Option
}

type ReqOptionInfo added in v0.2.0

type ReqOptionInfo struct {
	Id          int    `query:"id"`
	OptionTitle string `query:"option_title"`
}

机房信息

type ReqOptionList added in v0.2.0

type ReqOptionList struct {
	CurrentPage int `query:"currentPage"`
	PageSize    int `query:"pageSize"`
}

type ReqOptionUpdate added in v0.2.0

type ReqOptionUpdate struct {
	db.Option
}

type ReqPublishConfig added in v0.2.0

type ReqPublishConfig struct {
	ID      uint    `json:"id" validate:"required"`      // 配置ID
	Version *string `json:"version" validate:"optional"` // 版本号
}

ReqPublishConfig ..

type ReqRegistryQuery

type ReqRegistryQuery struct {
	AppName  string `json:"appName"`
	IDCCode  string `json:"zone_code"`
	IP       string `json:"ip"`
	HostName string `json:"hostname"`
	Env      string `json:"env"`
}

type ReqRelationApps

type ReqRelationApps struct {
	Current  int      `json:"current"`
	PageSize int      `json:"pageSize"`
	Env      string   `json:"env"`
	IsAddr   int      `json:"isAddr"`
	IsApp    int      `json:"isApp"`
	AppList  []string `json:"appList"`
	Types    []string `json:"types"`
	AddrList []string `json:"addrList"`
}

type ReqReportList

type ReqReportList struct {
	Current  int    `json:"current"`
	PageSize int    `json:"pageSize"`
	Aid      int    `json:"aid"`
	AppName  string `json:"appName"`
	StatDate int64  `json:"statDate"`
}

请求

type ReqReportRangeList

type ReqReportRangeList struct {
	Aid       int `json:"aid"`
	StartTime int `json:"startTime"`
	EndTime   int `json:"endTime"`
}

type ReqSentinelRuleAdd

type ReqSentinelRuleAdd struct {
	Prefix      string `json:"prefix"`
	AppName     string `json:"appName"`
	ServiceName string `json:"serviceName"`
	Suffix      string `json:"suffix"`
	ZoneCode    string `json:"zone_code"`
	DataSource  string `json:"dataSource"`
}

type ReqSetGroupAPIPerm added in v0.2.0

type ReqSetGroupAPIPerm struct {
	GroupName string        `json:"group_name"`
	APIList   []APIListItem `json:"api_list"`
}

type ReqSetGroupAppPerm added in v0.2.0

type ReqSetGroupAppPerm struct {
	GroupName string   `json:"group_name" valid:"required"`
	AppName   string   `json:"app_name" valid:"required"`
	Env       []string `json:"env"`
	Action    []string `json:"action"`
}

type ReqSetGroupMenuPerm added in v0.2.0

type ReqSetGroupMenuPerm struct {
	GroupName string   `json:"group_name"`
	Menu      []string `json:"menu"`
}

type ReqToolDedail

type ReqToolDedail struct {
	Id int `json:"id" form:"id"`
}

ReqToolDedail ...

type ReqToolList

type ReqToolList struct {
	CurrentPage int    `json:"currentPage" form:"currentPage"`
	ShowNum     int    `json:"showNum"  form:"showNum"`
	QueryObj    string `json:"queryObj" form:"queryObj"`
}

ReqToolList ...

type ReqUpdateConfig added in v0.2.0

type ReqUpdateConfig struct {
	ID      uint   `json:"id" validate:"required"`
	Message string `json:"message" validate:"required"`
	Content string `json:"content" validate:"required"`
}

ReqUpdateConfig ..

type ReqUpdateGroup added in v0.2.0

type ReqUpdateGroup struct {
	OriginalName string `json:"name"`
	CurrentName  string `json:"current_name"`
}

type ReqUpdateSettings added in v0.2.0

type ReqUpdateSettings struct {
	Name    string `json:"name"`
	Content string `json:"content"`
}

更新设置

type ReqUserAppViewHistory

type ReqUserAppViewHistory struct {
	Aid uint `json:"aid" valid:"required"`
}

ReqUserAppViewHistory 应用浏览记录埋点请求

type ReqUserApps

type ReqUserApps struct {
	Page     uint   `json:"page" valid:"required"`
	PageSize uint   `json:"pageSize" valid:"required"`
	QS       string `json:"qs"`
}

ReqUserApps 用户应用的请求

type ReqUserEvents

type ReqUserEvents struct {
	// FromTime uint `json:"fromTime" valid:"required"` // 获取从什么时候开始的数据
	PageSize uint `json:"pageSize" valid:"required"`
	Page     uint `json:"page" valid:"required"`
}

ReqUserEvents 获取用户相关事件的入参

type ResourceList

type ResourceList []db.AppTopology

func (ResourceList) Len

func (p ResourceList) Len() int

func (ResourceList) Less

func (p ResourceList) Less(i, j int) bool

func (ResourceList) Swap

func (p ResourceList) Swap(i, j int)

type RespAppCommit

type RespAppCommit struct {
	Aid          int    `json:"aid"`
	Commit       string `json:"commit"`
	ReporterPath string `json:"reporterPath"`
}

type RespAppInfo

type RespAppInfo struct {
	Aid       int    `json:"aid"`
	Name      string `json:"name"`
	Lang      string `json:"lang"`
	AppName   string `json:"appName"`
	GitlabURL string `json:"gitlabUrl"`
	ProtoDir  string `json:"proto_dir"`
}

RespAppInfo ...

type RespAppInstance

type RespAppInstance struct {
	IP   string
	Host string
}

RespAppInstance ...

type RespAppListWithEnv added in v0.2.0

type RespAppListWithEnv struct {
	List       []AppListWithEnvItem `json:"list"`
	Pagination Pagination           `json:"pagination"`
}

type RespAppNumber

type RespAppNumber struct {
	TotalNumber  int `json:"totalNumber"`
	NewNumber    int `json:"newNumber"`
	DeleteNumber int `json:"deleteNumber"`
}

RespAppNumber ...

type RespAppPkgAllList

type RespAppPkgAllList struct {
	Aid        int    `json:"aid"`
	AppName    string `json:"appName"`
	DepName    string `json:"depName"`
	DepBranch  string `json:"depBranch"`
	DepVersion string `json:"depVersion"`
	UpdateTime string `json:"update_time"`
}
type RespAppPkgLinkList struct {
	Aid     int    `json:"aid"`
	DepName string `json:"depName"`
}

type RespAppProjectList

type RespAppProjectList struct {
	Aid     int    `json:"aid"`
	AppName string `json:"appName"`
	WebUrl  string `json:"webUrl"`
}

type RespAppResource

type RespAppResource struct {
	Aid   int    `json:"aid"`
	Addr  string `json:"addr"`
	Name  string `json:"name"`
	Env   string `json:"env"`
	Type  string `json:"type"`
	Info  string `json:"info"`
	IdcID int    `json:"idcId"`
}

RespAppResource ...

type RespAppStatistics

type RespAppStatistics struct {
	AppCount     int `json:"appCount"`
	AppNodeCount int `json:"appNodeCount"`
}

type RespBatchCheckResourceVersion added in v0.2.0

type RespBatchCheckResourceVersion []BatchCheckResourceVersionItem

type RespConfig

type RespConfig struct {
	AppName string          `json:"app_name"`
	Aid     int             `json:"aid"`
	Config  []RespOneConfig `json:"config"`
}

type RespConfigInstanceItem added in v0.2.0

type RespConfigInstanceItem struct {
	ConfigurationStatusID uint      `json:"configuration_status_id"`
	Env                   string    `json:"env"`
	IP                    string    `json:"ip"`
	HostName              string    `json:"host_name"`
	DeviceID              int       `json:"device_id"`
	RegionCode            string    `json:"region_code"`
	RegionName            string    `json:"region_name"`
	ZoneCode              string    `json:"zone_code"`
	ZoneName              string    `json:"zone_name"`
	ConfigFilePath        string    `json:"config_file_path"`
	ConfigFileUsed        uint      `json:"config_file_used"` // 1 supervisor 2 systemd
	ConfigFileSynced      uint      `json:"config_file_synced"`
	ConfigFileTakeEffect  uint      `json:"config_file_take_effect"`
	SyncAt                time.Time `json:"sync_at"`
	ChangeLog             string    `json:"change_log"`
	Version               string    `json:"version"` // 发布到Juno Proxy的版本号
}

RespConfigInstanceItem ..

type RespConfigInstanceList added in v0.2.0

type RespConfigInstanceList []RespConfigInstanceItem

type RespDetailConfig added in v0.2.0

type RespDetailConfig struct {
	ID          uint       `json:"id"`
	AID         uint       `json:"aid"`
	Name        string     `json:"name"`
	Content     string     `json:"content"`
	Format      string     `json:"format"` // Yaml/Toml
	Env         string     `json:"env"`    // 环境
	Zone        string     `json:"zone"`   // 机房Zone
	CreatedAt   time.Time  `json:"created_time"`
	UpdatedAt   time.Time  `json:"update_time"`
	PublishedAt *time.Time `json:"published"` // 未发布/发布时间
}

RespDetailConfig Contains configuration content

type RespDetailConfigResource added in v0.2.0

type RespDetailConfigResource struct {
	UserName      string                  `json:"user_name"`
	Name          string                  `json:"name"`
	Env           string                  `json:"env"`
	ZoneName      string                  `json:"zone_name"`
	ZoneCode      string                  `json:"zone_code"`
	IsGlobal      bool                    `json:"is_global"`
	Description   string                  `json:"description"`
	LatestVersion uint                    `json:"latest_version"`
	LastUpdate    time.Time               `json:"last_update"`
	Versions      []ConfigResourceVersion `json:"versions"`
	Tags          []string                `json:"tags"`
	Value         string                  `json:"value"`
}

type RespDiffConfig added in v0.2.0

type RespDiffConfig struct {
	Origin   *RespDetailConfig `json:"origin,omitempty"`
	Modified RespDetailConfig  `json:"modified"`
}

RespDiffConfig ..

type RespDroneStatus

type RespDroneStatus struct {
	RepoId      int    `json:"repoId"`
	RepoLink    string `json:"repoLink"`
	BuildStatus string `json:"buildStatus"`
	BuildEvent  string `json:"buildEvent"`
}

type RespEnvZone added in v0.2.0

type RespEnvZone map[string][]RespEnvZoneItem // env => zones

type RespEnvZoneItem added in v0.2.0

type RespEnvZoneItem struct {
	ZoneCode string `json:"zone_code"`
	ZoneName string `json:"zone_name"`
}

type RespEtcdInfo

type RespEtcdInfo struct {
	Key            string `json:"key"`
	CreateRevision int    `json:"createRevision"`
	ModRevision    int    `json:"modRevision"`
	Version        int    `json:"version"`
	Value          string `json:"value"`
}

type RespEtcdServiceList

type RespEtcdServiceList struct {
	AppName  string `json:"appName"`
	ZoneCode string `json:"zone_code"`
}

type RespGetAppPerm added in v0.2.0

type RespGetAppPerm struct {
	List       []AppPermItem `json:"list"`
	Pagination Pagination    `json:"pagination"`
}

type RespGetGroupAPIPerm added in v0.2.0

type RespGetGroupAPIPerm []APIPermItem

type RespGetMenuPerm added in v0.2.0

type RespGetMenuPerm []string

type RespHistoryConfig added in v0.2.0

type RespHistoryConfig struct {
	Pagination Pagination              `json:"pagination"`
	List       []RespHistoryConfigItem `json:"list"`
}

RespHistoryConfig ..

type RespHistoryConfigItem added in v0.2.0

type RespHistoryConfigItem struct {
	ID              uint      `json:"id"`
	UID             uint      `json:"uid"` // 发布人ID
	AccessTokenID   uint      `json:"access_token_id"`
	AccessTokenName string    `json:"access_token_name"`
	UserName        string    `json:"user_name"`
	ChangeLog       string    `json:"change_log"`
	ConfigurationID uint      `json:"configuration_id"`
	Version         string    `json:"version"` // 发布到Juno Proxy的版本号
	CreatedAt       time.Time `json:"created_at"`
}

RespHistoryConfigItem ..

type RespIDCList

type RespIDCList struct {
	RegionCode string `json:"regionCode" gorm:"column:region_code"`
	RegionName string `json:"regionName" gorm:"column:region_name"`
	ZoneCode   string `json:"zone_code" gorm:"column:zone_code"`
}

type RespIDCStructure

type RespIDCStructure struct {
	JunoZone         string            `json:"junoZone"`
	GovernStatusList []GovernIdcStatus `json:"governIdcList"`
	IDCList          []db.Zone         `json:"idcList"`
}

type RespListAccessToken added in v0.2.0

type RespListAccessToken struct {
	Pagination Pagination        `json:"pagination"`
	List       []AccessTokenItem `json:"list"`
}

type RespListAppGroup added in v0.2.0

type RespListAppGroup []ListGroupItem

type RespListConfig added in v0.2.0

type RespListConfig []RespListConfigItem

RespListConfig ..

type RespListConfigItem added in v0.2.0

type RespListConfigItem struct {
	ID          uint       `json:"id"`
	AID         uint       `json:"aid"`
	Name        string     `json:"name"`
	Format      string     `json:"format"` // Yaml/Toml
	Env         string     `json:"env"`    // 环境
	Zone        string     `json:"zone"`   // 机房Zone
	CreatedAt   time.Time  `json:"created_time"`
	UpdatedAt   time.Time  `json:"update_time"`
	DeletedAt   *time.Time `json:"deleted_at"`
	PublishedAt *time.Time `json:"published"` // 未发布/发布时间
}

RespListConfigItem Does not contain configuration content to prevent configuration from being too long

type RespListConfigResource added in v0.2.0

type RespListConfigResource struct {
	Pagination Pagination                   `json:"pagination"`
	List       []RespListConfigResourceItem `json:"list"`
}

type RespListConfigResourceItem added in v0.2.0

type RespListConfigResourceItem struct {
	ID            uint      `json:"id"`
	UID           uint      `json:"uid"`
	UserName      string    `json:"user_name"`
	Name          string    `json:"name"`
	Env           string    `json:"env"`
	ZoneName      string    `json:"zone_name"`
	ZoneCode      string    `json:"zone_code"`
	IsGlobal      bool      `json:"is_global"`
	Description   string    `json:"description"`
	LatestVersion uint      `json:"latest_version"`
	LastUpdate    time.Time `json:"last_update"`
	Value         string    `json:"value"`
	Tags          []string  `json:"tags"`
}

type RespListUser added in v0.2.0

type RespListUser struct {
	List       []ListUserItem `json:"list"`
	Pagination Pagination     `json:"pagination"`
}

type RespListUserGroup added in v0.2.0

type RespListUserGroup []ListGroupItem

type RespOneConfig

type RespOneConfig struct {
	Caid     int    `json:"caid"`
	Env      string `json:"env"`
	ZoneCode string `json:"zone_code"`
	Content  string `json:"content"`
	AppName  string `json:"app_name"`
	Aid      int    `json:"aid"`
	Format   string `json:"format"`
	FileName string `json:"file_name"`
}

type RespRegisterInfo

type RespRegisterInfo struct {
	AppName   string `json:"app_name"`
	IP        string `json:"ip"`
	HostName  string `json:"host_name"`
	RegKey    string `json:"reg_key"`
	StartTime string `json:"start_time"`
	VCSInfo   string `json:"vcs_info"`
}

type RespRegistryItem

type RespRegistryItem struct {
	ID             int32  `json:"id"`
	AppName        string `json:"appName"`
	RegKey         string `json:"regKey"`
	RegValue       string `json:"regValue"`
	Region         string `json:"region"`
	Zone           string `json:"zone"`
	Scheme         string `json:"scheme"`
	Address        string `json:"address"`
	IP             string `json:"ip"`
	HostName       string `json:"hostname"`
	Type           string `json:"type"`
	Enable         int8   `json:"enable"`
	Group          string `json:"group"`
	Weight         int64  `json:"weight"`
	ProcessStartAt int64  `json:"processStartAt"`
	CreateAt       int64  `json:"createAt"`
	UpdateAt       int64  `json:"updateAt"`
}

查询结果记录

type RespRegistryQuery

type RespRegistryQuery struct {
	List []RespRegistryItem `json:"list"`
}

查询结果

type RespRelationApps

type RespRelationApps struct {
	Current  int            `json:"current"`
	PageSize int            `json:"pageSize"`
	Total    int            `json:"total"`
	List     []RelationApps `json:"list"`
	AddrList []string       `json:"addrList"`
}

type RespReportList

type RespReportList struct {
	Pagination Pagination   `json:"pagination"`
	List       []ReportInfo `json:"list"`
}

type RespToolDetail

type RespToolDetail struct {
	Id         uint64 `gorm:"primary_key"`
	Name       string
	Url        string
	PicUrl     string
	Desc       string
	CreateTime int64
}

RespToolDetail ...

type RespToolList

type RespToolList struct {
	CurrentPage int            `json:"currentPage"`
	TotalPage   int            `json:"totalPage"`
	ShowNum     int            `json:"showNum"`
	List        []*db.ToolInfo `json:"list"`
}

RespToolList ...

type RespUserApps

type RespUserApps struct {
	Pagination Pagination   `json:"pagination"`
	List       []db.AppInfo `json:"list"`
}

RespUserApps 用户应用响应

type RespUserEvents

type RespUserEvents struct {
	Events     []db.AppEvent     `json:"events"`
	Pagination output.Pagination `json:"pagination"`
}

RespUserEvents 用户相关事件的出参

type RuntimeStats

type RuntimeStats struct {
	IP       string `json:"ip"`
	Hostname string `json:"hostname"`
	Time     string `json:"time"` // 每次展示数据的时间
	Err      string `json:"err"`
}

type SelectData

type SelectData struct {
	Title string `json:"name"`
	Value string `json:"value"`
}

type ServerNode

type ServerNode struct {
	Name     string              `json:"name" toml:"name"`
	Scheme   string              `json:"scheme" toml:"scheme"` // http | grpc
	Address  string              `json:"address" toml:"address"`
	Labels   map[string]string   `json:"labels" toml:"labels"` // 标签: group, weight, enable 等
	Services map[string]*Service `json:"services" toml:"services"`
}

type Service

type Service struct {
	Namespace string            `json:"namespace" toml:"namespace"`
	Name      string            `json:"name" toml:"name"`
	Labels    map[string]string `json:"labels" toml:"labels"`
	Methods   []string          `json:"methods" toml:"methods"`
}

type SettingConfigDep added in v0.2.0

type SettingConfigDep struct {
	Interval uint `json:"interval"` // 配置依赖解析的
}

type SettingFieldConfig added in v0.2.0

type SettingFieldConfig struct {
	Default  string                   // 默认值
	Validate func(value string) error // 参数检查函数
}

设置项配置

func GetSettingFieldConfig added in v0.2.0

func GetSettingFieldConfig(name string) (SettingFieldConfig, bool)

type SettingGateway added in v0.2.0

type SettingGateway []SettingGatewayItem

type SettingGatewayItem added in v0.2.0

type SettingGatewayItem struct {
	Name    string `json:"name"`    // 设置项名称
	Domain  string `json:"domain"`  // 访问地址,Juno根据这个域名进行代理
	Host    string `json:"host"`    // 被代理的服务真实地址
	Scheme  string `json:"scheme"`  // 被代理的服务的协议
	Timeout uint   `json:"timeout"` // 超时(秒)
	Headers []struct {
		Name  string `json:"name"`
		Value string `json:"value"`
	} `json:"headers"` // header头
}

type SettingGrafana added in v0.2.0

type SettingGrafana struct {
	Host                  string `json:"host"`
	HeaderName            string `json:"header_name"`
	ApiDashboardAddr      string `json:"api_dashboard_addr"`      // api监控面板路径
	InstanceDashboardAddr string `json:"instance_dashboard_addr"` // 实例监控面板
	OverviewDashboardAddr string `json:"overview_dashboard_addr"` // 概览面板
}

type SettingName added in v0.2.0

type SettingName string

设置名称

type UniqZone added in v0.2.0

type UniqZone struct {
	Env  string
	Zone string
}

func (UniqZone) String added in v0.2.0

func (u UniqZone) String() string

type UsedStatusResp added in v0.2.0

type UsedStatusResp struct {
	IsUsed int `json:"is_used"`
}

UsedStatusResp ..

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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