Skip to content

Commit

Permalink
Merge pull request #16 from robotLJW/main
Browse files Browse the repository at this point in the history
Set default bson
  • Loading branch information
tianxiaoliang authored Feb 8, 2021
2 parents 814d35b + 3bccdf2 commit f81cd44
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions discovery/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
package discovery

type MicroServiceInstance struct {
InstanceId string `protobuf:"bytes,1,opt,name=instanceId" json:"instanceId,omitempty"`
ServiceId string `protobuf:"bytes,2,opt,name=serviceId" json:"serviceId,omitempty"`
InstanceId string `protobuf:"bytes,1,opt,name=instanceId" json:"instanceId,omitempty" bson:"instance_id"`
ServiceId string `protobuf:"bytes,2,opt,name=serviceId" json:"serviceId,omitempty" bson:"service_id"`
Endpoints []string `protobuf:"bytes,3,rep,name=endpoints" json:"endpoints,omitempty"`
HostName string `protobuf:"bytes,4,opt,name=hostName" json:"hostName,omitempty"`
Status string `protobuf:"bytes,5,opt,name=status" json:"status,omitempty"`
Properties map[string]string `protobuf:"bytes,6,rep,name=properties" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
HealthCheck *HealthCheck `protobuf:"bytes,7,opt,name=healthCheck" json:"healthCheck,omitempty"`
HealthCheck *HealthCheck `protobuf:"bytes,7,opt,name=healthCheck" json:"healthCheck,omitempty" bson:"health_check"`
Timestamp string `protobuf:"bytes,8,opt,name=timestamp" json:"timestamp,omitempty"`
DataCenterInfo *DataCenterInfo `protobuf:"bytes,9,opt,name=dataCenterInfo" json:"dataCenterInfo,omitempty"`
ModTimestamp string `protobuf:"bytes,10,opt,name=modTimestamp" json:"modTimestamp,omitempty"`
DataCenterInfo *DataCenterInfo `protobuf:"bytes,9,opt,name=dataCenterInfo" json:"dataCenterInfo,omitempty" bson:"data_center_info"`
ModTimestamp string `protobuf:"bytes,10,opt,name=modTimestamp" json:"modTimestamp,omitempty" bson:"mod_timestamp"`
Version string `protobuf:"bytes,11,opt,name=version" json:"version,omitempty"`
}
type RegisterInstanceRequest struct {
Expand Down
2 changes: 1 addition & 1 deletion discovery/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type ModifySchemasRequest struct {
}

type Schema struct {
SchemaId string `protobuf:"bytes,1,opt,name=schemaId" json:"schemaId,omitempty"`
SchemaId string `protobuf:"bytes,1,opt,name=schemaId" json:"schemaId,omitempty" bson:"schema_id"`
Summary string `protobuf:"bytes,2,opt,name=summary" json:"summary,omitempty"`
Schema string `protobuf:"bytes,3,opt,name=schema" json:"schema,omitempty"`
}
Expand Down
10 changes: 5 additions & 5 deletions discovery/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
package discovery

type MicroService struct {
ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty"`
ServiceId string `protobuf:"bytes,1,opt,name=serviceId" json:"serviceId,omitempty" bson:"service_id"`
AppId string `protobuf:"bytes,2,opt,name=appId" json:"appId,omitempty" bson:"app"`
ServiceName string `protobuf:"bytes,3,opt,name=serviceName" json:"serviceName,omitempty"`
ServiceName string `protobuf:"bytes,3,opt,name=serviceName" json:"serviceName,omitempty" bson:"service_name"`
Version string `protobuf:"bytes,4,opt,name=version" json:"version,omitempty"`
Description string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"`
Level string `protobuf:"bytes,6,opt,name=level" json:"level,omitempty"`
Expand All @@ -31,10 +31,10 @@ type MicroService struct {
Timestamp string `protobuf:"bytes,11,opt,name=timestamp" json:"timestamp,omitempty"`
Providers []*MicroServiceKey `protobuf:"bytes,12,rep,name=providers" json:"providers,omitempty"`
Alias string `protobuf:"bytes,13,opt,name=alias" json:"alias,omitempty"`
LBStrategy map[string]string `protobuf:"bytes,14,rep,name=LBStrategy" json:"LBStrategy,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
ModTimestamp string `protobuf:"bytes,15,opt,name=modTimestamp" json:"modTimestamp,omitempty"`
LBStrategy map[string]string `protobuf:"bytes,14,rep,name=LBStrategy" json:"LBStrategy,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value" bson:"lb_strategy"`
ModTimestamp string `protobuf:"bytes,15,opt,name=modTimestamp" json:"modTimestamp,omitempty" bson:"mod_timestamp"`
Environment string `protobuf:"bytes,16,opt,name=environment" json:"environment,omitempty" bson:"env"`
RegisterBy string `protobuf:"bytes,17,opt,name=registerBy" json:"registerBy,omitempty"`
RegisterBy string `protobuf:"bytes,17,opt,name=registerBy" json:"registerBy,omitempty" bson:"register_by"`
Framework *FrameWorkProperty `protobuf:"bytes,18,opt,name=framework" json:"framework,omitempty"`
}

Expand Down
14 changes: 7 additions & 7 deletions discovery/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ type GetServicesInfoResponse struct {
type MicroServiceKey struct {
// Tenant: The format is "{domain}/{project}"
Tenant string `protobuf:"bytes,1,opt,name=tenant" json:"tenant,omitempty"`
Environment string `protobuf:"bytes,2,opt,name=environment" json:"environment,omitempty"`
AppId string `protobuf:"bytes,3,opt,name=appId" json:"appId,omitempty"`
ServiceName string `protobuf:"bytes,4,opt,name=serviceName" json:"serviceName,omitempty"`
Environment string `protobuf:"bytes,2,opt,name=environment" json:"environment,omitempty" bson:"env"`
AppId string `protobuf:"bytes,3,opt,name=appId" json:"appId,omitempty" bson:"app"`
ServiceName string `protobuf:"bytes,4,opt,name=serviceName" json:"serviceName,omitempty" bson:"service_name"`
Alias string `protobuf:"bytes,5,opt,name=alias" json:"alias,omitempty"`
Version string `protobuf:"bytes,6,opt,name=version" json:"version,omitempty"`
}
Expand All @@ -125,13 +125,13 @@ type FrameWorkProperty struct {
}

type ServiceRule struct {
RuleId string `protobuf:"bytes,1,opt,name=ruleId" json:"ruleId,omitempty"`
RuleType string `protobuf:"bytes,2,opt,name=ruleType" json:"ruleType,omitempty"`
RuleId string `protobuf:"bytes,1,opt,name=ruleId" json:"ruleId,omitempty" bson:"rule_id"`
RuleType string `protobuf:"bytes,2,opt,name=ruleType" json:"ruleType,omitempty" bson:"rule_type"`
Attribute string `protobuf:"bytes,3,opt,name=attribute" json:"attribute,omitempty"`
Pattern string `protobuf:"bytes,4,opt,name=pattern" json:"pattern,omitempty"`
Description string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"`
Timestamp string `protobuf:"bytes,6,opt,name=timestamp" json:"timestamp,omitempty"`
ModTimestamp string `protobuf:"bytes,7,opt,name=modTimestamp" json:"modTimestamp,omitempty"`
ModTimestamp string `protobuf:"bytes,7,opt,name=modTimestamp" json:"modTimestamp,omitempty" bson:"mod_timestamp"`
}

type AddOrUpdateServiceRule struct {
Expand Down Expand Up @@ -330,7 +330,7 @@ type HealthCheck struct {
type DataCenterInfo struct {
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
Region string `protobuf:"bytes,2,opt,name=region" json:"region,omitempty"`
AvailableZone string `protobuf:"bytes,3,opt,name=availableZone" json:"availableZone,omitempty"`
AvailableZone string `protobuf:"bytes,3,opt,name=availableZone" json:"availableZone,omitempty" bson:"az"`
}

type MicroServiceInstanceKey struct {
Expand Down
4 changes: 2 additions & 2 deletions rbac/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ type Account struct {
//Deprecated
Role string `json:"role,omitempty"`
Roles []string `json:"roles,omitempty"`
TokenExpirationTime string `json:"tokenExpirationTime,omitempty"`
CurrentPassword string `json:"currentPassword,omitempty"`
TokenExpirationTime string `json:"tokenExpirationTime,omitempty" bson:"token_expiration_time"`
CurrentPassword string `json:"currentPassword,omitempty" bson:"current_password"`
Status string `json:"status,omitempty"`
}

Expand Down

0 comments on commit f81cd44

Please sign in to comment.