add pkgs from core

This commit is contained in:
ginuerzh
2022-04-04 12:44:35 +08:00
parent 7eb3687e0e
commit a3346ad246
188 changed files with 6084 additions and 283 deletions

20
registry/service.go Normal file
View File

@ -0,0 +1,20 @@
package registry
import (
"github.com/go-gost/core/service"
)
type serviceRegistry struct {
registry
}
func (r *serviceRegistry) Register(name string, v service.Service) error {
return r.registry.Register(name, v)
}
func (r *serviceRegistry) Get(name string) service.Service {
if v := r.registry.Get(name); v != nil {
return v.(service.Service)
}
return nil
}