popozy commented on a change in pull request #695: URL: https://github.com/apache/servicecomb-service-center/pull/695#discussion_r493986079
########## File path: server/service/auth/etcd/etcd.go ########## @@ -0,0 +1,125 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package etcd + +import ( + "context" + "github.com/apache/servicecomb-service-center/pkg/log" + pb "github.com/apache/servicecomb-service-center/pkg/registry" + "github.com/apache/servicecomb-service-center/server/core/proto" + scerr "github.com/apache/servicecomb-service-center/server/scerror" +) + +// TODO: define error with names here + +func init() { + // TODO: set logger + // TODO: register storage plugin to plugin manager +} + +type DataSource struct{} + +func NewDataSource() *DataSource { + // TODO: construct a reasonable DataSource instance + log.Warnf("auth data source enable etcd mode") + + inst := &DataSource{} + // TODO: deal with exception + if err := inst.initialize(); err != nil { + return inst + } + return inst +} + +func (ds *DataSource) initialize() error { + // TODO: init DataSource members + return nil +} + +func (ds *DataSource) Stop() { + panic("implement me") +} + +func (ds *DataSource) Ready() <-chan struct{} { + panic("implement me") +} + +func (ds *DataSource) Err() <-chan error { + panic("implement me") +} + +func (ds *DataSource) Close() { + panic("implement me") +} + +func (ds *DataSource) RegisterService(ctx context.Context, service *pb.CreateServiceRequest) (*pb.CreateServiceResponse, error) { Review comment: sorry, my fault. has been removed. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
