Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
package(default_visibility = ["//visibility:public"])
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
go_library(
name = "go_default_library",
srcs = [
"app_auth.go",
"model.go",
],
importpath = "go-common/app/service/main/msm/model",
tags = ["automanaged"],
deps = ["//library/time:go_default_library"],
)

View File

@@ -0,0 +1,39 @@
package model
import (
xtime "go-common/library/time"
)
// AppInfo App info.
type AppInfo struct {
AppTreeID int64 `json:"app_tree_id"`
AppID string `json:"app_id"`
Limit int32 `json:"limit"`
MTime xtime.Time `json:"mtime"`
}
// AppAuth AppAuth.
type AppAuth struct {
ServiceTreeID int64 `json:"service_tree_id"`
AppTreeID int64 `json:"app_tree_id"`
RPCMethod string `json:"rpc_method"`
HTTPMethod string `json:"http_method"`
Quota int32 `json:"quota"`
MTime xtime.Time `json:"mtime"`
}
// Scope Scope.
type Scope struct {
AppTreeID int64 `json:"app_tree_id"`
RPCMethods []string `json:"rpc_methods"`
HTTPMethods []string `json:"http_methods"`
Quota int32 `json:"quota"`
Sign string `json:"sign"`
}
// AppToken AppToken.
type AppToken struct {
AppTreeID int64 `json:"app_tree_id"`
AppID string `json:"app_id"`
AppAuth string `json:"app_auth"`
}

View File

@@ -0,0 +1,109 @@
package model
import (
"container/list"
)
const (
// CodePlatDefaut db common plat code.
CodePlatDefaut = 1
// CodePlatDefautMsg db common plat msg.
CodePlatDefautMsg = "common"
// CodeDelStatus db delete status.
CodeDelStatus = 2
// HostOffline host offline state.
HostOffline = 0
)
// RPC rpc node value.
type RPC struct {
Proto string `json:"Proto"`
Addr string `json:"Addr"`
Group string `json:"Group"`
Weight int `json:"Weight"`
}
// Code ver and message.
type Code struct {
Ver int64
Code int
Msg string
}
// Codes all codes local map cache.
type Codes struct {
Ver int64
MD5 string
Code map[int]string
}
// Version list and map.
type Version struct {
List *list.List
Map map[int64]*list.Element
}
// Databus databus rule.
type Databus struct {
Topic string `json:"topic"`
Group string `json:"group"`
Cluster string `json:"cluster"`
Business string `json:"business"`
Operation int8 `json:"operation"`
Leader string `json:"leader"`
Phone string `json:"phone"`
Email string `json:"email"`
AlarmSwitch int8 `json:"alarmSwitch"`
Users string `json:"users"`
AlarmRule string `json:"alarmRule"`
}
// Databuss databuss rules.
type Databuss struct {
Rules []*Databus `json:"rules"`
MD5 string `json:"md5"`
}
// Limit limit.
type Limit struct {
Burst int `json:"burst"`
Rate float64 `json:"rate"`
}
// Limits limits.
type Limits struct {
Apps map[string]*Limit `json:"apps"`
MD5 string `json:"md5"`
}
// Host host.
type Host struct {
Name string `json:"hostname"`
State int `json:"state"`
}
//CodesLangs ...
type CodesLangs struct {
Ver int64
MD5 string
Code map[int]map[string]string
}
// //Langs ...
// type Langs struct {
// Default string `json:"default"`
// Localeds []*Locale
// }
//Locale ...
// type Locale struct {
// Locale string
// Message string
// }
//CodeLangs ...
type CodeLangs struct {
Ver int64
Code int
Msg map[string]string
}