Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) CreateNamespace(req *CreateNamespaceRequest) (bool, error)
- func (c *Client) CreatePermission(req *CreatePermissionRequest) error
- func (c *Client) CreateRoles(req *CreateRoleRequest) error
- func (c *Client) CreateService(req *CreateServiceRequest) (bool, error)
- func (c *Client) CreateUser(req *User) error
- func (c *Client) DeleteConfig(req *ConfigBase) error
- func (c *Client) DeleteNamespace(req *DeleteNamespaceRequest) (bool, error)
- func (c *Client) DeletePermission(req *DeletePermissionRequest) error
- func (c *Client) DeleteRoles(req *DeleteRoleRequest) error
- func (c *Client) DeleteService(req *DeleteServiceRequest) (bool, error)
- func (c *Client) DeleteUser(req *DeleteUserRequest) error
- func (c *Client) DeregisterInstance(req *DeregisterInstanceRequest) error
- func (c *Client) GetConfig(req *ConfigBase) (string, error)
- func (c *Client) GetConfigHistory(req *GetConfigHistoryRequest) (*GetConfigHistoryResponse, error)
- func (c *Client) GetConfigHistoryDetail(req *GetConfigHistoryDetailRequest) (*GetConfigHistoryDetailResponse, error)
- func (c *Client) GetConfigHistoryPrevious(req *GetConfigHistoryPreviousRequest) (*GetConfigHistoryDetailResponse, error)
- func (c *Client) GetInstance(req *GetInstanceRequest) (*GetInstanceResponse, error)
- func (c *Client) GetInstances(req *GetInstancesRequest) (*GetInstancesResponse, error)
- func (c *Client) GetNamespaces() (*GetNamespacesResponse, error)
- func (c *Client) GetOperatorLeader() (*GetLeaderResponse, error)
- func (c *Client) GetOperatorMetrics() (*GetMetricsResponse, error)
- func (c *Client) GetOperatorServerList(req *GetServerListRequest) (*GetServerListResponse, error)
- func (c *Client) GetOperatorSwitch() (*GetOperatorSwitchResponse, error)
- func (c *Client) GetPermissions(req *Page) (*GetPermissions, error)
- func (c *Client) GetRoles(req *Page) (*GetRolesResponse, error)
- func (c *Client) GetService(req *ServiceBase) (*ServiceBaseResponse, error)
- func (c *Client) GetServiceList(req *GetServiceListRequest) (*GetServiceListResponse, error)
- func (c *Client) GetUsers(req *Page) (*GetUsersResponse, error)
- func (c *Client) Health() error
- func (c *Client) ListenConfig(req *ListeningConfigs) (string, error)
- func (c *Client) Login() error
- func (c *Client) ModifyInstance(req *ModifyInstanceRequest) error
- func (c *Client) ModifyOperatorSwitch(req *ModifyOperatorSwitchRequest) (bool, error)
- func (c *Client) ModifyService(req *ModifyServiceRequest) (bool, error)
- func (c *Client) PublishConfig(req *PublishConfigRequest) error
- func (c *Client) PutNamespace(req *PutNamespaceRequest) (bool, error)
- func (c *Client) PutUser(req *User) error
- func (c *Client) RegisterInstance(req *RegisterInstanceRequest) error
- func (c *Client) SendHeartbeat(req *SendHeartbeatRequest) (bool, error)
- func (c *Client) UpdateInstanceHealthStatus(req *UpdateInstanceHealthStatusRequest) (bool, error)
- type Config
- type ConfigBase
- type CreateNamespaceRequest
- type CreatePermissionRequest
- type CreateRoleRequest
- type CreateServiceRequest
- type CreateServiceSelector
- type DeleteNamespaceRequest
- type DeletePermissionRequest
- type DeleteRoleRequest
- type DeleteServiceRequest
- type DeleteUserRequest
- type DeregisterInstanceRequest
- type DoParams
- type GetConfigHistoryDetailRequest
- type GetConfigHistoryDetailResponse
- type GetConfigHistoryPreviousRequest
- type GetConfigHistoryRequest
- type GetConfigHistoryResponse
- type GetInstanceRequest
- type GetInstanceResponse
- type GetInstancesRequest
- type GetInstancesResponse
- type GetLeaderResponse
- type GetMetricsResponse
- type GetNamespacesResponse
- type GetOperatorSwitchResponse
- type GetPermissions
- type GetRolesResponse
- type GetServerListRequest
- type GetServerListResponse
- type GetServiceListRequest
- type GetServiceListResponse
- type GetUsersResponse
- type HeartBeat
- type InstanceBase
- type ListeningConfigs
- type LoginResponse
- type ModifyInstanceRequest
- type ModifyOperatorSwitchRequest
- type ModifyServiceRequest
- type Page
- type PublishConfigRequest
- type PutNamespaceRequest
- type RegisterInstanceRequest
- type SendHeartbeatRequest
- type ServiceBase
- type ServiceBaseResponse
- type UpdateInstanceHealthStatusRequest
- type User
Constants ¶
const ( Scheme = "client" WebContext = "/" HttpClientTimeout = 10 AccessToken = "accessToken" TokenTtl = "tokenTtl" TokenRefreshWindow = "tokenRefreshWindow" PageNo = "pageNo" PageSize = "pageSize" ServiceIP = "ip" // 服务IP, string ServicePort = "port" // 服务端口, int ServiceNamespaceId = "namespaceId" // 命名空间ID, string ServiceWeight = "weight" // 权重, double ServiceEnable = "enable" // 是否上线, bool ServiceHealthy = "healthy" // 是否只健康, bool ServiceMetadata = "metadata" // 元数据, string ServiceClusterName = "clusterName" // 集群名称, string ServiceName = "serviceName" // 服务名称, string ServiceGroupName = "groupName" // 分组名称, string ServiceEphemeral = "ephemeral" // 是否临时实例, bool ServiceClusters = "clusters" // 集群名称, string,多个集群用逗号分隔 ServiceProtectThreshold = "protectThreshold" // 保护阈值, float64 ServiceSelector = "selector" // 选择器, 服务访问策略 OperatorEntry = "entry" // 开关名 OperatorValue = "value" // 开关值 OperatorDebug = "debug" // 开关值 PermissionSuffix = ":*:*" Search = "search" SearchType = "accurate" Username = "username" Password = "password" NewPassword = "newPassword" Role = "role" NameSpace = "namespace" Tenant = "tenant" // tenant 租户信息,对应 Nacos 的命名空间ID字段,命名空间ID字段与命名空间名保持一致 Resource = "resource" // 添加权限时资源字段,该值与命名空间名称保持一致 ConfigDataId = "dataId" // Nacos 配置 ID ConfigGroup = "group" // Nacos 配置分组 ConfigContent = "content" // Nacos 配置内置 ConfigContentType = "type" // Nacos 配置类型 ConfigNid = "nid" // Nacos 配置历史版本ID ConfigId = "id" // Nacos 配置历史版本ID PermissionAction = "action" // 添加权限,动作字段[r, w, rw] PermissionCustomNamespaceId = "customNamespaceId" // 命名空间ID,与命名空间名保持一致 PermissionNamespaceName = "namespaceName" // 命名空间名 PermissionNamespaceShowName = "namespaceShowName" // 命名空间名 PermissionNamespaceDesc = "namespaceDesc" // 命名空间描述,与命名空间名保持一致 PermissionNamespaceId = "namespaceId" //命名空间ID,删除命名空间时所需参数 Env = "env" //环境 ServerAddr = "nacosUrl" // nacos服务器地址,example: http://xxx.com:80 DefaultGroup = "DEFAULT_GROUP" // Nacos 默认 ConfigGroup DefaultTenant = "public" // Nacos 默认 Tenant IPathAuth = "/nacos/v1/auth/login" // 鉴权 IPathNamespaces = "/nacos/v1/console/namespaces" // 命名空间 IPathUser = "/nacos/v1/auth/users" // 用户 IPathRoles = "/nacos/v1/auth/roles" // 角色 IPathPermission = "/nacos/v1/auth/permissions" // 权限 IPathConfig = "/nacos/v1/cs/configs" //获取配置 ,发布配置 ,删除配置 IPathConfigListener = "/nacos/v1/cs/configs/listener" //监听配置 IPathConfigHistory = "/nacos/v1/cs/history?search=accurate" //查询历史配置 IPathConfigHistoryDetail = "/nacos/v1/cs/history" //查询历史版本详情 IPathConfigHistoryPrevious = "/nacos/v1/cs/history/previous" //查询配置上一版本信息 IPathInstance = "/nacos/v1/ns/instance" //注册实例,查询实例详情,修改实例,注销实例 IPathInstanceList = "/nacos/v1/ns/instance/list" //查询实例列表 IPathInstanceBeat = "/nacos/v1/ns/instance/beat" //发送实例心跳 IPathService = "/nacos/v1/ns/service" //创建服务,查询服务,修改服务,删除服务 IPathServiceList = "/nacos/v1/ns/service/list" //查询服务列表 IPathOperatorSwitch = "/nacos/v1/ns/operator/switches" //查询系统开关,修改系统开关 IPathOperatorMetrics = "/nacos/v1/ns/operator/metrics" //查看系统当前数据指标 IPathOperatorServers = "/nacos/v1/ns/operator/servers" //查看集群server列表 IPathOperatorLeader = "/nacos/v1/ns/raft/leader" //查看集群leader IPathInstanceHealth = "/nacos/v1/ns/health/instance" //更新实例健康状态 )
Variables ¶
var BoolResult bool
var StringResult string
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Config *Config
// contains filtered or unexported fields
}
func (*Client) CreateNamespace ¶
func (c *Client) CreateNamespace(req *CreateNamespaceRequest) (bool, error)
CreateNamespace 创建命名空间
func (*Client) CreatePermission ¶
func (c *Client) CreatePermission(req *CreatePermissionRequest) error
CreatePermission 创建权限
func (*Client) CreateRoles ¶
func (c *Client) CreateRoles(req *CreateRoleRequest) error
func (*Client) CreateService ¶
func (c *Client) CreateService(req *CreateServiceRequest) (bool, error)
CreateService 创建服务 //todo
func (*Client) DeleteConfig ¶
func (c *Client) DeleteConfig(req *ConfigBase) error
DeleteConfig 删除配置
func (*Client) DeleteNamespace ¶
func (c *Client) DeleteNamespace(req *DeleteNamespaceRequest) (bool, error)
DeleteNamespace 删除命名空间
func (*Client) DeletePermission ¶
func (c *Client) DeletePermission(req *DeletePermissionRequest) error
func (*Client) DeleteRoles ¶
func (c *Client) DeleteRoles(req *DeleteRoleRequest) error
func (*Client) DeleteService ¶
func (c *Client) DeleteService(req *DeleteServiceRequest) (bool, error)
DeleteService 删除服务
func (*Client) DeleteUser ¶
func (c *Client) DeleteUser(req *DeleteUserRequest) error
DeleteUser 删除用户
func (*Client) DeregisterInstance ¶
func (c *Client) DeregisterInstance(req *DeregisterInstanceRequest) error
DeregisterInstance 注销实例
func (*Client) GetConfig ¶
func (c *Client) GetConfig(req *ConfigBase) (string, error)
GetConfig 获取配置
func (*Client) GetConfigHistory ¶
func (c *Client) GetConfigHistory(req *GetConfigHistoryRequest) (*GetConfigHistoryResponse, error)
GetConfigHistory 配置历史
func (*Client) GetConfigHistoryDetail ¶
func (c *Client) GetConfigHistoryDetail(req *GetConfigHistoryDetailRequest) (*GetConfigHistoryDetailResponse, error)
GetConfigHistoryDetail 查询历史版本详情
func (*Client) GetConfigHistoryPrevious ¶
func (c *Client) GetConfigHistoryPrevious(req *GetConfigHistoryPreviousRequest) (*GetConfigHistoryDetailResponse, error)
GetConfigHistoryPrevious 查询配置上一版本信息
func (*Client) GetInstance ¶
func (c *Client) GetInstance(req *GetInstanceRequest) (*GetInstanceResponse, error)
GetInstance 查询实例详情
func (*Client) GetInstances ¶
func (c *Client) GetInstances(req *GetInstancesRequest) (*GetInstancesResponse, error)
GetInstances 查询实例列表
func (*Client) GetNamespaces ¶
func (c *Client) GetNamespaces() (*GetNamespacesResponse, error)
GetNamespaces 查询命名空间列表
func (*Client) GetOperatorLeader ¶
func (c *Client) GetOperatorLeader() (*GetLeaderResponse, error)
GetOperatorLeader 查看当前集群leader
func (*Client) GetOperatorMetrics ¶
func (c *Client) GetOperatorMetrics() (*GetMetricsResponse, error)
GetOperatorMetrics 查看系统当前数据指标
func (*Client) GetOperatorServerList ¶
func (c *Client) GetOperatorServerList(req *GetServerListRequest) (*GetServerListResponse, error)
GetOperatorServerList 查看当前集群Server列表
func (*Client) GetOperatorSwitch ¶
func (c *Client) GetOperatorSwitch() (*GetOperatorSwitchResponse, error)
GetOperatorSwitch 查询系统开关
func (*Client) GetPermissions ¶
func (c *Client) GetPermissions(req *Page) (*GetPermissions, error)
GetPermissions 查询权限列表
func (*Client) GetService ¶
func (c *Client) GetService(req *ServiceBase) (*ServiceBaseResponse, error)
GetService 查询服务详情
func (*Client) GetServiceList ¶
func (c *Client) GetServiceList(req *GetServiceListRequest) (*GetServiceListResponse, error)
GetServiceList 查询服务列表
func (*Client) GetUsers ¶
func (c *Client) GetUsers(req *Page) (*GetUsersResponse, error)
GetUsers 查询用户列表 //todo
func (*Client) ListenConfig ¶
func (c *Client) ListenConfig(req *ListeningConfigs) (string, error)
ListenConfig 监听配置 TODO: 未完成
func (*Client) ModifyInstance ¶
func (c *Client) ModifyInstance(req *ModifyInstanceRequest) error
ModifyInstance 修改实例
func (*Client) ModifyOperatorSwitch ¶
func (c *Client) ModifyOperatorSwitch(req *ModifyOperatorSwitchRequest) (bool, error)
ModifyOperatorSwitch 修改系统开关
func (*Client) ModifyService ¶
func (c *Client) ModifyService(req *ModifyServiceRequest) (bool, error)
ModifyService 修改服务 //todo
func (*Client) PublishConfig ¶
func (c *Client) PublishConfig(req *PublishConfigRequest) error
PublishConfig 发布配置
func (*Client) PutNamespace ¶
func (c *Client) PutNamespace(req *PutNamespaceRequest) (bool, error)
PutNamespace 修改命名空间
func (*Client) RegisterInstance ¶
func (c *Client) RegisterInstance(req *RegisterInstanceRequest) error
RegisterInstance 注册实例
func (*Client) SendHeartbeat ¶
func (c *Client) SendHeartbeat(req *SendHeartbeatRequest) (bool, error)
SendHeartbeat 发送心跳
func (*Client) UpdateInstanceHealthStatus ¶
func (c *Client) UpdateInstanceHealthStatus(req *UpdateInstanceHealthStatusRequest) (bool, error)
UpdateInstanceHealthStatus 更新实例的健康状态
type ConfigBase ¶
type CreateNamespaceRequest ¶
type CreateNamespaceRequest struct {
//customNamespaceId 字符串 是 命名空间ID
//namespaceName 字符串 是 命名空间名
//namespaceDesc 字符串 否 命名空间描述
CustomNamespaceId string `json:"customNamespaceId" validate:"required"`
NamespaceName string `json:"namespaceName" validate:"required"`
NamespaceDesc string `json:"namespaceDesc" validate:"omitempty"`
}
type CreatePermissionRequest ¶
type CreateRoleRequest ¶
type CreateServiceRequest ¶
type CreateServiceRequest struct {
ServiceBase
ProtectThreshold float64 `json:"protectThreshold" validate:"omitempty,gte=0,lte=1" default:"0"` // 保护阈值,取值0到1,默认0
Metadata string `json:"metadata" validate:"omitempty"` // 元数据
Selector CreateServiceSelector `json:"selector" validate:"omitempty"` // 访问策略
}
type CreateServiceSelector ¶
type CreateServiceSelector struct {
Default bool `json:"default"`
}
CreateServiceSelector 服务访问策略
type DeleteNamespaceRequest ¶
type DeleteNamespaceRequest struct {
NamespaceId string `json:"namespaceId" validate:"required"` // 命名空间 ID
}
type DeletePermissionRequest ¶
type DeleteRoleRequest ¶
type DeleteServiceRequest ¶
type DeleteServiceRequest struct {
ServiceBase
}
type DeleteUserRequest ¶
type DeleteUserRequest struct {
Username string `json:"username" validate:"required"`
}
type DeregisterInstanceRequest ¶
type DeregisterInstanceRequest struct {
IP string `json:"ip" validate:"required"`
Port int `json:"port" validate:"required"`
NamespaceId string `json:"namespaceId" validate:"omitempty"`
ClusterName string `json:"clusterName" validate:"omitempty"`
ServiceName string `json:"serviceName" validate:"required"`
GroupName string `json:"groupName" validate:"omitempty"`
Ephemeral bool `json:"ephemeral" validate:"omitempty"`
}
type GetConfigHistoryDetailRequest ¶
type GetConfigHistoryDetailRequest struct {
Nid string `json:"nid" validate:"required"`
ConfigBase
}
type GetConfigHistoryDetailResponse ¶
type GetConfigHistoryDetailResponse struct {
Id string `json:"id"`
LastId int `json:"lastId"`
DataId string `json:"dataId"`
Group string `json:"group"`
Tenant string `json:"tenant"`
AppName string `json:"appName"`
Md5 string `json:"md5"`
Content string `json:"content"`
SrcIp string `json:"srcIp"`
SrcUser interface{} `json:"srcUser"`
OpType string `json:"opType"`
CreatedTime string `json:"createdTime"`
LastModifiedTime string `json:"lastModifiedTime"`
}
type GetConfigHistoryPreviousRequest ¶
type GetConfigHistoryPreviousRequest struct {
Id int `json:"id" validate:"required"` // 配置 ID
ConfigBase
}
type GetConfigHistoryRequest ¶
type GetConfigHistoryRequest struct {
ConfigBase
Page
}
type GetConfigHistoryResponse ¶
type GetConfigHistoryResponse struct {
TotalCount int `json:"totalCount"`
PageNumber int `json:"pageNumber"`
PagesAvailable int `json:"pagesAvailable"`
PageItems []struct {
Id string `json:"id"`
LastId int `json:"lastId"`
DataId string `json:"dataId"`
Group string `json:"group"`
Tenant string `json:"tenant"`
AppName string `json:"appName"`
Md5 interface{} `json:"md5"` //
Content interface{} `json:"content"`
SrcIp string `json:"srcIp"`
SrcUser string `json:"srcUser"`
OpType string `json:"opType"`
CreatedTime string `json:"createdTime"`
LastModifiedTime string `json:"lastModifiedTime"`
} `json:"pageItems"`
}
type GetInstanceRequest ¶
type GetInstanceRequest struct {
InstanceBase
Healthy bool `json:"healthy" validate:"omitempty"`
}
type GetInstanceResponse ¶
type GetInstancesRequest ¶
type GetInstancesRequest struct {
ServiceName string `json:"serviceName" validate:"required"`
GroupName string `json:"groupName" validate:"omitempty"`
NamespaceId string `json:"namespaceId" validate:"omitempty"`
Clusters string `json:"clusters" validate:"omitempty"`
HealthyOnly bool `json:"healthyOnly" validate:"omitempty"`
}
type GetInstancesResponse ¶
type GetInstancesResponse struct {
Name string `json:"name"`
GroupName string `json:"groupName"`
Clusters string `json:"clusters"`
CacheMillis int `json:"cacheMillis"`
Hosts []struct {
InstanceId string `json:"instanceId"`
Ip string `json:"ip"`
Port int `json:"port"`
Weight float64 `json:"weight"`
Healthy bool `json:"healthy"`
Enabled bool `json:"enabled"`
Ephemeral bool `json:"ephemeral"`
ClusterName string `json:"clusterName"`
ServiceName string `json:"serviceName"`
Metadata struct {
} `json:"metadata"`
InstanceHeartBeatInterval int `json:"instanceHeartBeatInterval"`
InstanceIdGenerator string `json:"instanceIdGenerator"`
InstanceHeartBeatTimeOut int `json:"instanceHeartBeatTimeOut"`
IpDeleteTimeout int `json:"ipDeleteTimeout"`
} `json:"hosts"`
LastRefTime int64 `json:"lastRefTime"`
Checksum string `json:"checksum"`
AllIPs bool `json:"allIPs"`
ReachProtectionThreshold bool `json:"reachProtectionThreshold"`
Valid bool `json:"valid"`
}
type GetLeaderResponse ¶
type GetMetricsResponse ¶
type GetMetricsResponse struct {
ServiceCount int `json:"serviceCount"`
Load float64 `json:"load"`
Mem float64 `json:"mem"`
ResponsibleServiceCount int `json:"responsibleServiceCount"`
InstanceCount int `json:"instanceCount"`
Cpu float64 `json:"cpu"`
Status string `json:"status"`
ResponsibleInstanceCount int `json:"responsibleInstanceCount"`
}
type GetNamespacesResponse ¶
type GetNamespacesResponse struct {
Code int `json:"code"`
Message interface{} `json:"message"`
Data []struct {
Namespace string `json:"namespace"`
NamespaceShowName string `json:"namespaceShowName"`
Quota int `json:"quota"`
ConfigCount int `json:"configCount"`
Type int `json:"type"`
} `json:"data"`
}
type GetOperatorSwitchResponse ¶
type GetOperatorSwitchResponse struct {
Name string `json:"name"`
Masters interface{} `json:"masters"`
AdWeightMap struct {
} `json:"adWeightMap"`
DefaultPushCacheMillis int `json:"defaultPushCacheMillis"`
ClientBeatInterval int `json:"clientBeatInterval"`
DefaultCacheMillis int `json:"defaultCacheMillis"`
DistroThreshold float64 `json:"distroThreshold"`
HealthCheckEnabled bool `json:"healthCheckEnabled"`
DistroEnabled bool `json:"distroEnabled"`
EnableStandalone bool `json:"enableStandalone"`
PushEnabled bool `json:"pushEnabled"`
CheckTimes int `json:"checkTimes"`
HttpHealthParams struct {
Max int `json:"max"`
Min int `json:"min"`
Factor float64 `json:"factor"`
} `json:"httpHealthParams"`
TcpHealthParams struct {
Max int `json:"max"`
Min int `json:"min"`
Factor float64 `json:"factor"`
} `json:"tcpHealthParams"`
MysqlHealthParams struct {
Max int `json:"max"`
Min int `json:"min"`
Factor float64 `json:"factor"`
} `json:"mysqlHealthParams"`
IncrementalList []string `json:"incrementalList"`
ServerStatusSynchronizationPeriodMillis int `json:"serverStatusSynchronizationPeriodMillis"`
ServiceStatusSynchronizationPeriodMillis int `json:"serviceStatusSynchronizationPeriodMillis"`
DisableAddIP bool `json:"disableAddIP"`
SendBeatOnly bool `json:"sendBeatOnly"`
LimitedUrlMap struct {
} `json:"limitedUrlMap"`
DistroServerExpiredMillis int `json:"distroServerExpiredMillis"`
PushGoVersion string `json:"pushGoVersion"`
PushJavaVersion string `json:"pushJavaVersion"`
PushPythonVersion string `json:"pushPythonVersion"`
PushCVersion string `json:"pushCVersion"`
EnableAuthentication bool `json:"enableAuthentication"`
OverriddenServerStatus string `json:"overriddenServerStatus"`
DefaultInstanceEphemeral bool `json:"defaultInstanceEphemeral"`
HealthCheckWhiteList []string `json:"healthCheckWhiteList"`
Checksum string `json:"checksum"`
}
type GetPermissions ¶
type GetRolesResponse ¶
type GetServerListRequest ¶
type GetServerListRequest struct {
Healthy bool `json:"healthy" validate:"omitempty"` // 是否只返回健康Server节点
}
type GetServerListResponse ¶
type GetServerListResponse struct {
Servers []struct {
Ip string `json:"ip"`
ServePort int `json:"servePort"`
Site string `json:"site"`
Weight int `json:"weight"`
AdWeight int `json:"adWeight"`
Alive bool `json:"alive"`
LastRefTime int `json:"lastRefTime"`
LastRefTimeStr string `json:"lastRefTimeStr"`
Key string `json:"key"`
} `json:"servers"`
}
type GetServiceListRequest ¶
type GetServiceListResponse ¶
type GetUsersResponse ¶
type InstanceBase ¶
type InstanceBase struct {
IP string `json:"ip" validate:"required"` // 实例 IP
Port int `json:"port" validate:"required"` // 实例端口
NamespaceId string `json:"namespaceId" validate:"omitempty"` // 命名空间 ID
ClusterName string `json:"clusterName" validate:"omitempty"` // 集群名称
ServiceName string `json:"serviceName" validate:"required"` // 服务名称
GroupName string `json:"groupName" validate:"omitempty"` // 分组名称
Ephemeral bool `json:"ephemeral" validate:"omitempty"` // 是否临时实例
}
type ListeningConfigs ¶
type ListeningConfigs struct {
ConfigBase
ContentMD5 string `json:"contentMD5" validate:"required"`
}
type LoginResponse ¶
type ModifyInstanceRequest ¶
type ModifyInstanceRequest struct {
IP string `json:"ip" validate:"required"`
Port int `json:"port" validate:"required"`
NamespaceId string `json:"namespaceId" validate:"omitempty"`
Weight float64 `json:"weight" validate:"omitempty"`
Enable bool `json:"enable" validate:"omitempty"`
Healthy bool `json:"healthy" validate:"omitempty"`
Metadata string `json:"metadata" validate:"omitempty"`
ClusterName string `json:"clusterName" validate:"omitempty"`
ServiceName string `json:"serviceName" validate:"required"`
GroupName string `json:"groupName" validate:"omitempty"`
Ephemeral bool `json:"ephemeral" validate:"omitempty"`
}
type ModifyServiceRequest ¶
type ModifyServiceRequest struct {
ServiceBase
ProtectThreshold float64 `json:"protectThreshold" validate:"omitempty,gte=0,lte=1" default:"0"` // 保护阈值,取值0到1,默认0
Metadata string `json:"metadata" validate:"omitempty"` // 元数据
Selector CreateServiceSelector `json:"selector" validate:"omitempty"`
}
type PublishConfigRequest ¶
type PublishConfigRequest struct {
ConfigBase
Content string `json:"content" validate:"required"`
ContentType string `json:"contentType" validate:"omitempty"`
}
type PutNamespaceRequest ¶
type RegisterInstanceRequest ¶
type RegisterInstanceRequest struct {
IP string `json:"ip" validate:"required"`
Port int `json:"port" validate:"required"`
NamespaceId string `json:"namespaceId" validate:"omitempty"`
Weight float64 `json:"weight" validate:"omitempty"`
Enable bool `json:"enable" validate:"omitempty"`
Healthy bool `json:"healthy" validate:"omitempty"`
Metadata string `json:"metadata" validate:"omitempty"`
ClusterName string `json:"clusterName" validate:"omitempty"`
ServiceName string `json:"serviceName" validate:"required"`
GroupName string `json:"groupName" validate:"omitempty"`
Ephemeral bool `json:"ephemeral" validate:"omitempty"`
}
type SendHeartbeatRequest ¶
type SendHeartbeatRequest struct {
InstanceBase
HeartBeat HeartBeat `json:"beat" validate:"required"`
}
type ServiceBase ¶
type ServiceBaseResponse ¶
type ServiceBaseResponse struct {
Metadata struct {
} `json:"metadata"`
GroupName string `json:"groupName"`
NamespaceId string `json:"namespaceId"`
Name string `json:"name"`
Selector struct {
Type string `json:"type"`
} `json:"selector"`
ProtectThreshold int `json:"protectThreshold"`
Clusters []struct {
HealthChecker struct {
Type string `json:"type"`
} `json:"healthChecker"`
Metadata struct {
} `json:"metadata"`
Name string `json:"name"`
} `json:"clusters"`
}
type UpdateInstanceHealthStatusRequest ¶
type UpdateInstanceHealthStatusRequest struct {
IP string `json:"ip" validate:"required"` // 实例 IP
Port int `json:"port" validate:"required"` // 实例端口
NamespaceId string `json:"namespaceId" validate:"omitempty"` // 命名空间 ID
ClusterName string `json:"clusterName" validate:"omitempty"` // 集群名称
ServiceName string `json:"serviceName" validate:"required"` // 服务名称
GroupName string `json:"groupName" validate:"omitempty"` // 分组名称
Healthy bool `json:"healthy" validate:"required"` // 是否健康
}