fix indent

This commit is contained in:
yangzhouhan
2015-07-23 16:52:40 -07:00
parent ec53eba4e7
commit e9dfeb65b7
2 changed files with 5 additions and 6 deletions

View File

@ -9,7 +9,7 @@ message HealthCheckRequest {
message HealthCheckResponse {
enum ServingStatus {
UNKNOWN = 0;
UNKNOWN = 0;
SERVING = 1;
NOT_SERVING = 2;
}

View File

@ -12,9 +12,9 @@ import (
)
type HealthServer struct {
// statusMap stores the serving status of the services this HealthServer monitors
mu sync.Mutex
// statusMap stores the serving status of the services this HealthServer monitors.
statusMap map[string]int32
mu sync.Mutex
}
func NewHealthServer() *HealthServer {
@ -23,9 +23,8 @@ func NewHealthServer() *HealthServer {
}
}
func (s *HealthServer) Check(ctx context.Context, in *healthpb.HealthCheckRequest) (out *healthpb.HealthCheckResponse, err error) {
func (s *HealthServer) Check(ctx context.Context, in *healthpb.HealthCheckRequest) (*healthpb.HealthCheckResponse, error) {
service := in.Host + ":" + in.Service
out = new(healthpb.HealthCheckResponse)
s.mu.Lock()
defer s.mu.Unlock()
if status, ok := s.statusMap[service]; ok {
@ -37,7 +36,7 @@ func (s *HealthServer) Check(ctx context.Context, in *healthpb.HealthCheckReques
}
// SetServingStatus is called when need to reset the serving status of a service
// or insert a new service entry into the statusMap
// or insert a new service entry into the statusMap.
func (s *HealthServer) SetServingStatus(host string, service string, status int32) {
service = host + ":" + service
s.mu.Lock()