Documentation
¶
Index ¶
- Constants
- Variables
- func Arguments2Labels(arguments []*v1.MatchArgument) map[string]*v1.MatchString
- func BuildDefaultStrategyName(role PrincipalType, name string) string
- func CheckPrincipalType(role int) error
- func Int2bool(entry int) bool
- func StatusBoolToInt(value bool) int
- func Store2ClientStat(clientStatStore *ClientStatStore) *api.StatInfo
- func WithAccessResources(accessResources map[api.ResourceType][]ResourceEntry) acquireContextOption
- func WithAttachment(attachment map[string]interface{}) acquireContextOption
- func WithFromClient() acquireContextOption
- func WithFromConsole() acquireContextOption
- func WithMethod(method string) acquireContextOption
- func WithModule(module BzModule) acquireContextOption
- func WithOperation(operation ResourceOperation) acquireContextOption
- func WithRequestContext(ctx context.Context) acquireContextOption
- type AcquireContext
- func (authCtx *AcquireContext) GetAccessResources() map[api.ResourceType][]ResourceEntry
- func (authCtx *AcquireContext) GetAttachment(key string) interface{}
- func (authCtx *AcquireContext) GetAttachments() map[string]interface{}
- func (authCtx *AcquireContext) GetMethod() string
- func (authCtx *AcquireContext) GetModule() BzModule
- func (authCtx *AcquireContext) GetOperation() ResourceOperation
- func (authCtx *AcquireContext) GetRequestContext() context.Context
- func (authCtx *AcquireContext) IsAccessResourceEmpty() bool
- func (authCtx *AcquireContext) IsFromClient() bool
- func (authCtx *AcquireContext) IsFromConsole() bool
- func (authCtx *AcquireContext) SetAccessResources(accessRes map[api.ResourceType][]ResourceEntry)
- func (authCtx *AcquireContext) SetAttachment(key string, val interface{})
- func (authCtx *AcquireContext) SetRequestContext(requestContext context.Context)
- type Business
- type BzModule
- type Callee
- type CircuitBreaker
- type CircuitBreakerDetail
- type CircuitBreakerInfo
- type CircuitBreakerRelation
- type Client
- type ClientStatStore
- type ClientStore
- type ConfigFile
- type ConfigFileGroup
- type ConfigFileRelease
- type ConfigFileReleaseHistory
- type ConfigFileTag
- type ConfigFileTemplate
- type DiscoverEventConfig
- type EnhancedService
- type ExpandInstanceStore
- type ExtendRateLimit
- type ExtendRoutingConfig
- type IPConfig
- type Instance
- func (i *Instance) Ctime() string
- func (i *Instance) EnableHealthCheck() bool
- func (i *Instance) HealthCheck() *api.HealthCheck
- func (i *Instance) Healthy() bool
- func (i *Instance) Host() string
- func (i *Instance) ID() string
- func (i *Instance) Isolate() bool
- func (i *Instance) Location() *api.Location
- func (i *Instance) LogicSet() string
- func (i *Instance) MallocProto()
- func (i *Instance) Metadata() map[string]string
- func (i *Instance) Mtime() string
- func (i *Instance) Namespace() string
- func (i *Instance) Port() uint32
- func (i *Instance) Priority() uint32
- func (i *Instance) Protocol() string
- func (i *Instance) Revision() string
- func (i *Instance) Service() string
- func (i *Instance) ServiceToken() string
- func (i *Instance) Version() string
- func (i *Instance) VpcID() string
- func (i *Instance) Weight() uint32
- type InstanceCount
- type InstanceEvent
- type InstanceEventType
- type InstanceStore
- type Location
- type LocationStore
- type ModifyStrategyDetail
- type ModifyUserGroup
- type Namespace
- type NamespaceServiceCount
- type OperationType
- type Policy
- type Principal
- type PrincipalType
- type PrometheusDiscoveryResponse
- type PrometheusTarget
- type RateLimit
- type RateLimitRevision
- type RecordEntry
- type Resource
- type ResourceEntry
- type ResourceOperation
- type ResourceType
- type Route
- type RoutingConfig
- type Section
- type Service
- type ServiceAlias
- type ServiceKey
- type ServiceWithCircuitBreaker
- type Sid
- type SidConfig
- type Strategy
- type StrategyDetail
- type StrategyDetailCache
- type StrategyResource
- type User
- type UserGroup
- type UserGroupDetail
- type UserGroupRelation
- type UserRoleType
- type WeightType
Constants ¶
const ( OperatorRoleKey string = "operator_role" OperatorPrincipalType string = "operator_principal" OperatorIDKey string = "operator_id" OperatorOwnerKey string = "operator_owner" OperatorLinkStrategy string = "operator_link_strategy" LinkUsersKey string = "link_users" LinkGroupsKey string = "link_groups" RemoveLinkUsersKey string = "remove_link_users" RemoveLinkGroupsKey string = "remove_link_groups" TokenDetailInfoKey string = "TokenInfo" TokenForUser string = "uid" TokenForUserGroup string = "groupid" ResourceAttachmentKey string = "resource_attachment" )
const ( // MetaKeyPolarisService service identifier by self registration MetaKeyPolarisService = "polaris_service" // MetaKeyBuildRevision build revision for server MetaKeyBuildRevision = "build-revision" )
const ( LabelKeyPath = "$path" LabelKeyMethod = "$method" LabelKeyHeader = "$header" LabelKeyQuery = "$query" LabelKeyCallerService = "$caller_service" LabelKeyCallerIP = "$caller_ip" )
const ( // DefaultStrategySuffix 默认策略的名称前缀 DefaultStrategySuffix string = "的默认策略" )
const (
StatReportPrometheus string = "prometheus"
)
Variables ¶
var ( // ErrorNoUser 没有找到对应的用户 ErrorNoUser error = errors.New("no such user") // ErrorNoUserGroup 没有找到对应的用户组 ErrorNoUserGroup error = errors.New("no such user group") // ErrorNoNamespace 没有找到对应的命名空间 ErrorNoNamespace error = errors.New("no such namespace") // ErrorNoService 没有找到对应的服务 ErrorNoService error = errors.New("no such service") // ErrorWrongUsernameOrPassword 用户或者密码错误 ErrorWrongUsernameOrPassword error = errors.New("name or password is wrong") // ErrorTokenNotExist token 不存在 ErrorTokenNotExist error = errors.New("token not exist") // ErrorTokenInvalid 非法的 token ErrorTokenInvalid error = errors.New("invalid token") // ErrorTokenDisabled token 已经被禁用 ErrorTokenDisabled error = errors.New("token already disabled") )
var ( // PrincipalNames principal name map PrincipalNames = map[PrincipalType]string{ PrincipalUser: "user", PrincipalGroup: "group", } )
var ResourceTypeMap = map[Resource]ResourceType{ RNamespace: ServiceType, RService: ServiceType, RRouting: ServiceType, RInstance: ServiceType, RRateLimit: ServiceType, RMesh: MeshType, RMeshResource: MeshType, RMeshService: MeshType, }
ResourceTypeMap resource type map
var ( UserRoleNames = map[UserRoleType]string{ AdminUserRole: "admin", OwnerUserRole: "main", SubAccountUserRole: "sub", } )
var WeightEnum = map[string]WeightType{ "dynamic": WEIGHTDYNAMIC, "static": WEIGHTSTATIC, }
WeightEnum weight enum map
var WeightString = map[WeightType]string{ WEIGHTDYNAMIC: "dynamic", WEIGHTSTATIC: "static", }
WeightString weight string map
Functions ¶
func Arguments2Labels ¶
func Arguments2Labels(arguments []*v1.MatchArgument) map[string]*v1.MatchString
Arguments2Labels 将参数列表适配成旧的标签模型
func BuildDefaultStrategyName ¶
func BuildDefaultStrategyName(role PrincipalType, name string) string
BuildDefaultStrategyName 构建默认鉴权策略的名称信息
func Store2ClientStat ¶
func Store2ClientStat(clientStatStore *ClientStatStore) *api.StatInfo
func WithAccessResources ¶
func WithAccessResources(accessResources map[api.ResourceType][]ResourceEntry) acquireContextOption
WithAccessResources 设置本次访问的资源
@param accessResources @return acquireContextOption
func WithAttachment ¶
func WithAttachment(attachment map[string]interface{}) acquireContextOption
WithAttachment 设置本次请求的额外携带信息
@param attachment @return acquireContextOption
func WithModule ¶
func WithModule(module BzModule) acquireContextOption
WithModule 设置本次请求的模块
@param module @return acquireContextOption
func WithOperation ¶
func WithOperation(operation ResourceOperation) acquireContextOption
WithOperation 设置本次的操作类型
@param operation @return acquireContextOption
Types ¶
type AcquireContext ¶
type AcquireContext struct {
// contains filtered or unexported fields
}
AcquireContext 每次鉴权请求上下文信息
func NewAcquireContext ¶
func NewAcquireContext(options ...acquireContextOption) *AcquireContext
NewAcquireContext 创建一个请求响应
@param options @return *AcquireContext
func (*AcquireContext) GetAccessResources ¶
func (authCtx *AcquireContext) GetAccessResources() map[api.ResourceType][]ResourceEntry
GetAccessResources 获取本次请求的资源
@receiver authCtx @return map
func (*AcquireContext) GetAttachment ¶
func (authCtx *AcquireContext) GetAttachment(key string) interface{}
GetAttachment 按照 key 获取某一个附件信息
func (*AcquireContext) GetAttachments ¶
func (authCtx *AcquireContext) GetAttachments() map[string]interface{}
GetAttachments 获取本次请求的额外携带信息
func (*AcquireContext) GetMethod ¶
func (authCtx *AcquireContext) GetMethod() string
GetMethod 获取本次请求涉及的操作函数
func (*AcquireContext) GetModule ¶
func (authCtx *AcquireContext) GetModule() BzModule
GetModule 获取请求的模块
@receiver authCtx @return BzModule
func (*AcquireContext) GetOperation ¶
func (authCtx *AcquireContext) GetOperation() ResourceOperation
GetOperation 获取本次操作的类型
@receiver authCtx @return ResourceOperation
func (*AcquireContext) GetRequestContext ¶
func (authCtx *AcquireContext) GetRequestContext() context.Context
GetRequestContext 获取 context.Context
@receiver authCtx @return context.Context
func (*AcquireContext) IsAccessResourceEmpty ¶
func (authCtx *AcquireContext) IsAccessResourceEmpty() bool
IsAccessResourceEmpty 判断当前待访问的资源,是否为空
func (*AcquireContext) IsFromClient ¶
func (authCtx *AcquireContext) IsFromClient() bool
IsFromClient 本次请求是否来自客户端
func (*AcquireContext) IsFromConsole ¶
func (authCtx *AcquireContext) IsFromConsole() bool
func (*AcquireContext) SetAccessResources ¶
func (authCtx *AcquireContext) SetAccessResources(accessRes map[api.ResourceType][]ResourceEntry)
SetAccessResources 设置本次请求的资源
@receiver authCtx @param accessRes
func (*AcquireContext) SetAttachment ¶
func (authCtx *AcquireContext) SetAttachment(key string, val interface{})
SetAttachment 设置附件
func (*AcquireContext) SetRequestContext ¶
func (authCtx *AcquireContext) SetRequestContext(requestContext context.Context)
SetRequestContext 重新设置 context.Context
@receiver authCtx @param requestContext
type Business ¶
type Business struct {
ID string
Name string
Token string
Owner string
Valid bool
CreateTime time.Time
ModifyTime time.Time
}
Business 业务结构体
type Callee ¶
type Callee struct {
ModID uint32
CmdID uint32
SetID string
IP uint32
Port uint32
Weight uint32
Location *Location
}
Callee 被调信息,对应t_server+t_ip_config
type CircuitBreaker ¶
type CircuitBreaker struct {
ID string
Version string
Name string
Namespace string
Business string
Department string
Comment string
Inbounds string
Outbounds string
Token string
Owner string
Revision string
Valid bool
CreateTime time.Time
ModifyTime time.Time
}
CircuitBreaker 熔断规则
type CircuitBreakerDetail ¶
type CircuitBreakerDetail struct {
Total uint32
CircuitBreakerInfos []*CircuitBreakerInfo
}
CircuitBreakerDetail 返回给控制台的熔断规则及服务数据
type CircuitBreakerInfo ¶
type CircuitBreakerInfo struct {
CircuitBreaker *CircuitBreaker
Services []*Service
}
CircuitBreakerInfo 熔断规则及绑定服务
type CircuitBreakerRelation ¶
type CircuitBreakerRelation struct {
ServiceID string
RuleID string
RuleVersion string
Valid bool
CreateTime time.Time
ModifyTime time.Time
}
CircuitBreakerRelation 熔断规则绑定关系
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
*
- Client 客户端上报信息表
func Store2Client ¶
func Store2Client(is *ClientStore) *Client
Store2Instance store的数据转换为组合了api的数据结构
func (*Client) ModifyTime ¶
type ClientStatStore ¶
type ClientStore ¶
type ClientStore struct {
ID string
Host string
Type string
Version string
Region string
Zone string
Campus string
Stat ClientStatStore
Flag int
CreateTime int64
ModifyTime int64
}
ClientStore 对应store层(database)的对象
type ConfigFile ¶
type ConfigFile struct {
Id uint64
Name string
Namespace string
Group string
Content string
Comment string
Format string
Flag int
CreateTime time.Time
CreateBy string
ModifyTime time.Time
ModifyBy string
Valid bool
}
ConfigFile 配置文件数据持久化对象
type ConfigFileGroup ¶
type ConfigFileGroup struct {
Id uint64
Name string
Namespace string
Comment string
CreateTime time.Time
Owner string
CreateBy string
ModifyTime time.Time
ModifyBy string
Valid bool
}
ConfigFileGroup 配置文件组数据持久化对象
type ConfigFileRelease ¶
type ConfigFileRelease struct {
Id uint64
Name string
Namespace string
Group string
FileName string
Content string
Comment string
Md5 string
Version uint64
Flag int
CreateTime time.Time
CreateBy string
ModifyTime time.Time
ModifyBy string
Valid bool
}
ConfigFileRelease 配置文件发布数据持久化对象
type ConfigFileReleaseHistory ¶
type ConfigFileReleaseHistory struct {
Id uint64
Name string
Namespace string
Group string
FileName string
Format string
Tags string
Content string
Comment string
Md5 string
Type string
Status string
CreateTime time.Time
CreateBy string
ModifyTime time.Time
ModifyBy string
Valid bool
}
ConfigFileReleaseHistory 配置文件发布历史记录数据持久化对象
type ConfigFileTag ¶
type ConfigFileTag struct {
Id uint64
Key string
Value string
Namespace string
Group string
FileName string
CreateTime time.Time
CreateBy string
ModifyTime time.Time
ModifyBy string
Valid bool
}
ConfigFileTag 配置文件标签数据持久化对象
type ConfigFileTemplate ¶
type ConfigFileTemplate struct {
Id uint64
Name string
Content string
Comment string
Format string
CreateTime time.Time
CreateBy string
ModifyTime time.Time
ModifyBy string
}
ConfigFileTemplate config file template data object
type DiscoverEventConfig ¶
type DiscoverEventConfig struct {
QueueSize int `json:"queueSize"`
OutputPath string `json:"outputPath"`
RotationMaxSize int `json:"rotationMaxSize"`
RotationMaxAge int `json:"rotationMaxAge"`
RotationMaxBackups int `json:"rotationMaxBackups"`
}
DiscoverEventConfig 服务实例事件插件配置
func DefaultDiscoverEventConfig ¶
func DefaultDiscoverEventConfig() *DiscoverEventConfig
DefaultDiscoverEventConfig 创建一个默认的服务事件插件配置
func (*DiscoverEventConfig) Validate ¶
func (c *DiscoverEventConfig) Validate() error
Validate 检查配置是否正确配置
type EnhancedService ¶
EnhancedService 服务增强数据
type ExpandInstanceStore ¶
type ExpandInstanceStore struct {
ServiceName string
Namespace string
ServiceToken string
ServicePlatformID string
ServiceInstance *InstanceStore
}
ExpandInstanceStore 包含服务名的store信息
type ExtendRateLimit ¶
ExtendRateLimit 包含服务信息的限流规则
type ExtendRoutingConfig ¶
type ExtendRoutingConfig struct {
ServiceName string
NamespaceName string
Config *RoutingConfig
}
ExtendRoutingConfig 路由配置的扩展结构体
type Instance ¶
type Instance struct {
Proto *api.Instance
ServiceID string
ServicePlatformID string
// Valid Whether it is deleted by logic
Valid bool
// ModifyTime Update time of instance
ModifyTime time.Time
// FirstRegis Whether the label instance is the first registration
FirstRegis bool
}
Instance 组合了api的Instance对象
func ExpandStore2Instance ¶
func ExpandStore2Instance(es *ExpandInstanceStore) *Instance
ExpandStore2Instance 扩展store转换
func Store2Instance ¶
func Store2Instance(is *InstanceStore) *Instance
Store2Instance store的数据转换为组合了api的数据结构
func (*Instance) EnableHealthCheck ¶
EnableHealthCheck get enables health check
func (*Instance) HealthCheck ¶
func (i *Instance) HealthCheck() *api.HealthCheck
HealthCheck get health check
func (*Instance) MallocProto ¶
func (i *Instance) MallocProto()
MallocProto malloc proto if proto is null
func (*Instance) ServiceToken ¶
ServiceToken get service token
type InstanceCount ¶
type InstanceCount struct {
// HealthyInstanceCount 健康实例数
HealthyInstanceCount uint32
// TotalInstanceCount 总实例数
TotalInstanceCount uint32
}
InstanceCount Service instance statistics
type InstanceEvent ¶
type InstanceEvent struct {
Id string
Namespace string
Service string
Instance *v1.Instance
EType InstanceEventType
CreateTime time.Time
}
InstanceEvent 服务实例事件
type InstanceEventType ¶
type InstanceEventType string
InstanceEventType 探测事件类型
const ( // EventDiscoverNone empty discover event EventDiscoverNone InstanceEventType = "EventDiscoverNone" // EventInstanceOnline instance becoming online EventInstanceOnline InstanceEventType = "InstanceOnline" // EventInstanceTurnUnHealth Instance becomes unhealthy EventInstanceTurnUnHealth InstanceEventType = "InstanceTurnUnHealth" // EventInstanceTurnHealth Instance becomes healthy EventInstanceTurnHealth InstanceEventType = "InstanceTurnHealth" // EventInstanceOpenIsolate Instance is in isolation EventInstanceOpenIsolate InstanceEventType = "InstanceOpenIsolate" // EventInstanceCloseIsolate Instance shutdown isolation state EventInstanceCloseIsolate InstanceEventType = "InstanceCloseIsolate" // EventInstanceOffline Instance offline EventInstanceOffline InstanceEventType = "InstanceOffline" // EventInstanceSendHeartbeat Instance send heartbeat package to server EventInstanceSendHeartbeat InstanceEventType = "InstanceSendHeartbeat" )
type InstanceStore ¶
type InstanceStore struct {
ID string
ServiceID string
Host string
VpcID string
Port uint32
Protocol string
Version string
HealthStatus int
Isolate int
Weight uint32
EnableHealthCheck int
CheckType int32
TTL uint32
Priority uint32
Revision string
LogicSet string
Region string
Zone string
Campus string
Meta map[string]string
Flag int
CreateTime int64
ModifyTime int64
}
InstanceStore 对应store层(database)的对象
type Location ¶
type Location struct {
Proto *v1.Location
RegionID uint32
ZoneID uint32
CampusID uint32
Valid bool
}
Location cmdb信息,对应内存结构体
type LocationStore ¶
type LocationStore struct {
IP string
Region string
Zone string
Campus string
RegionID uint32
ZoneID uint32
CampusID uint32
Flag int
ModifyTime int64
}
LocationStore 地域信息,对应数据库字段
type ModifyStrategyDetail ¶
type ModifyStrategyDetail struct {
ID string
Name string
Action string
Comment string
AddPrincipals []Principal
RemovePrincipals []Principal
AddResources []StrategyResource
RemoveResources []StrategyResource
ModifyTime time.Time
}
ModifyStrategyDetail 修改鉴权策略详细
type ModifyUserGroup ¶
type ModifyUserGroup struct {
ID string
Owner string
Token string
TokenEnable bool
Comment string
AddUserIds []string
RemoveUserIds []string
}
ModifyUserGroup 用户组修改
type Namespace ¶
type Namespace struct {
Name string
Comment string
Token string
Owner string
Valid bool
CreateTime time.Time
ModifyTime time.Time
}
Namespace 命名空间结构体
type NamespaceServiceCount ¶
type NamespaceServiceCount struct {
// ServiceCount 服务数量
ServiceCount uint32
// InstanceCnt 实例健康数/实例总数
InstanceCnt *InstanceCount
}
NamespaceServiceCount Namespace service data
type OperationType ¶
type OperationType string
OperationType 操作类型
const ( // OCreate 新建 OCreate OperationType = "Create" // ODelete 删除 ODelete OperationType = "Delete" // OUpdate 更新 OUpdate OperationType = "Update" // OUpdateIsolate 更新隔离状态 OUpdateIsolate OperationType = "UpdateIsolate" // OGetToken 查看token OGetToken OperationType = "GetToken" // OUpdateToken 更新token OUpdateToken OperationType = "UpdateToken" // OUpdateGroup 更新用户-用户组关联关系 OUpdateGroup OperationType = "UpdateGroup" )
定义包含的操作类型
type Principal ¶
type Principal struct {
StrategyID string
PrincipalID string
PrincipalRole PrincipalType
}
Principal 策略相关人
type PrincipalType ¶
type PrincipalType int
const ( PrincipalUser PrincipalType = 1 PrincipalGroup PrincipalType = 2 )
func (PrincipalType) String ¶
func (i PrincipalType) String() string
type PrometheusDiscoveryResponse ¶
type PrometheusDiscoveryResponse struct {
Code uint32
Response []PrometheusTarget
}
type PrometheusTarget ¶
type PrometheusTarget struct {
Targets []string `json:"targets"`
Labels map[string]string `json:"labels"`
}
PrometheusTarget 用于对接 prometheus service discovery 的数据结构
type RateLimit ¶
type RateLimit struct {
Proto *v1.Rule
ID string
ServiceID string
Name string
Method string
// Labels for old compatible, will be removed later
Labels string
Priority uint32
Rule string
Revision string
Disable bool
Valid bool
CreateTime time.Time
ModifyTime time.Time
EnableTime time.Time
}
RateLimit 限流规则
func (*RateLimit) AdaptArgumentsAndLabels ¶
AdaptArgumentsAndLabels 对存量标签进行兼容,同时将argument适配成标签
func (*RateLimit) AdaptLabels ¶
AdaptLabels 对存量标签进行兼容,对存量labels进行清空
func (*RateLimit) Labels2Arguments ¶
func (r *RateLimit) Labels2Arguments() (map[string]*v1.MatchString, error)
Labels2Arguments 适配老的标签到新的参数列表
type RateLimitRevision ¶
RateLimitRevision 包含最新版本号的限流规则
type RecordEntry ¶
type RecordEntry struct {
ResourceType Resource
OperationType OperationType
Namespace string
Service string
MeshID string
MeshName string
Context string
Operator string
Revision string
Username string
UserGroup string
StrategyName string
CreateTime time.Time
}
RecordEntry 操作记录entry
func (*RecordEntry) String ¶
func (r *RecordEntry) String() string
type Resource ¶
type Resource string
Resource 操作资源
const ( RNamespace Resource = "Namespace" RService Resource = "Service" RRouting Resource = "Routing" RRoutingV2 Resource = "RoutingV2" RInstance Resource = "Instance" RRateLimit Resource = "RateLimit" RMeshResource Resource = "MeshResource" RMesh Resource = "Mesh" RMeshService Resource = "MeshService" RFluxRateLimit Resource = "FluxRateLimit" RUser Resource = "User" RUserGroup Resource = "UserGroup" RUserGroupRelation Resource = "UserGroupRelation" RAuthStrategy Resource = "AuthStrategy" RConfigGroup Resource = "ConfigGroup" RConfigFile Resource = "ConfigFile" )
定义包含的资源类型
type ResourceOperation ¶
type ResourceOperation int16
ResourceOperation 资源操作
const ( // Read 只读动作 Read ResourceOperation = 10 // Create 创建动作 Create ResourceOperation = 20 // Modify 修改动作 Modify ResourceOperation = 30 // Delete 删除动作 Delete ResourceOperation = 40 )
type ResourceType ¶
type ResourceType int
ResourceType 资源类型
const ( // MeshType 网格类型资源 MeshType ResourceType = iota // ServiceType 北极星服务类型资源 ServiceType )
type RoutingConfig ¶
type RoutingConfig struct {
ID string
InBounds string
OutBounds string
Revision string
Valid bool
CreateTime time.Time
ModifyTime time.Time
}
* RoutingConfig 路由配置
type Service ¶
type Service struct {
ID string
Name string
Namespace string
Business string
Ports string
Meta map[string]string
Comment string
Department string
CmdbMod1 string
CmdbMod2 string
CmdbMod3 string
Token string
Owner string
Revision string
Reference string
ReferFilter string
PlatformID string
Valid bool
CreateTime time.Time
ModifyTime time.Time
Mtime int64
Ctime int64
}
Service 服务数据
type ServiceAlias ¶
type ServiceAlias struct {
ID string
Alias string
AliasNamespace string
ServiceID string
Service string
Namespace string
Owner string
Comment string
CreateTime time.Time
ModifyTime time.Time
}
ServiceAlias 服务别名结构体
type ServiceWithCircuitBreaker ¶
type ServiceWithCircuitBreaker struct {
ServiceID string
CircuitBreaker *CircuitBreaker
Valid bool
CreateTime time.Time
ModifyTime time.Time
}
ServiceWithCircuitBreaker 与服务关系绑定的熔断规则
type Strategy ¶
type Strategy struct {
ID string
Name string
Principal string
Action string
Comment string
Owner string
Default bool
Valid bool
CreateTime time.Time
ModifyTime time.Time
}
Strategy 策略main信息
type StrategyDetail ¶
type StrategyDetail struct {
ID string
Name string
Action string
Comment string
Principals []Principal
Default bool
Owner string
Resources []StrategyResource
Valid bool
Revision string
CreateTime time.Time
ModifyTime time.Time
}
StrategyDetail 鉴权策略详细
type StrategyDetailCache ¶
type StrategyDetailCache struct {
*StrategyDetail
UserPrincipal map[string]Principal
GroupPrincipal map[string]Principal
}
StrategyDetailCache 鉴权策略详细
type StrategyResource ¶
StrategyResource 策略资源
type User ¶
type User struct {
ID string
Name string
Password string
Owner string
Source string
Mobile string
Email string
Type UserRoleType
Token string
TokenEnable bool
Valid bool
Comment string
CreateTime time.Time
ModifyTime time.Time
}
User 用户
type UserGroup ¶
type UserGroup struct {
ID string
Name string
Owner string
Token string
TokenEnable bool
Valid bool
Comment string
CreateTime time.Time
ModifyTime time.Time
}
UserGroup 用户组
type UserGroupDetail ¶
UserGroupDetail 用户组详细(带用户列表)
func (*UserGroupDetail) ToUserIdSlice ¶
func (ugd *UserGroupDetail) ToUserIdSlice() []string
ToUserIdSlice 将用户ID Map 专为 slice
type UserGroupRelation ¶
type UserGroupRelation struct {
GroupID string
UserIds []string
CreateTime time.Time
ModifyTime time.Time
}
UserGroupRelation 用户-用户组关联关系具体信息
type UserRoleType ¶
type UserRoleType int
UserRoleType 用户角色类型
const ( UnknownUserRole UserRoleType = -1 AdminUserRole UserRoleType = 0 OwnerUserRole UserRoleType = 20 SubAccountUserRole UserRoleType = 50 )
type WeightType ¶
type WeightType uint32
WeightType 服务下实例的权重类型
const ( // WEIGHTDYNAMIC 动态权重 WEIGHTDYNAMIC WeightType = iota // WEIGHTSTATIC 静态权重 WEIGHTSTATIC )