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.
41 lines
604 B
41 lines
604 B
package service |
|
|
|
import ( |
|
"context" |
|
|
|
"go-common/app/admin/main/bfs/conf" |
|
"go-common/app/admin/main/bfs/dao" |
|
) |
|
|
|
// Service struct |
|
type Service struct { |
|
c *conf.Config |
|
d *dao.Dao |
|
} |
|
|
|
// New init |
|
func New(c *conf.Config) (s *Service) { |
|
s = &Service{ |
|
c: c, |
|
d: dao.New(c), |
|
} |
|
return s |
|
} |
|
|
|
// Clusters . |
|
func (s *Service) Clusters(c context.Context) (clusters []string) { |
|
for name := range s.c.Zookeepers { |
|
clusters = append(clusters, name) |
|
} |
|
return |
|
} |
|
|
|
// Ping . |
|
func (s *Service) Ping(c context.Context) (err error) { |
|
return s.d.Ping(c) |
|
} |
|
|
|
// Close . |
|
func (s *Service) Close() { |
|
s.d.Close() |
|
}
|
|
|