mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
663 B
33 lines
663 B
1 year ago
|
// Copyright 2023 ROC. All rights reserved.
|
||
|
// Use of this source code is governed by a MIT style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
|
package service
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/bufbuild/connect-go"
|
||
|
)
|
||
|
|
||
|
type baseConnectService struct {
|
||
|
baseService
|
||
|
|
||
|
server *connectServer
|
||
|
}
|
||
|
|
||
|
func (s *baseConnectService) registerServer(srv Service, h func(func(string, http.Handler), ...connect.HandlerOption)) {
|
||
|
h(s.server.register, s.server.handlerOpts...)
|
||
|
s.server.addService(srv)
|
||
|
}
|
||
|
|
||
|
func (s *baseConnectService) OnStart() error {
|
||
|
// do nothing default
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func (s *baseConnectService) OnStop() error {
|
||
|
// do nothing default
|
||
|
return nil
|
||
|
}
|