本文整理汇总了Golang中github.com/influxdb/influxdb/services/opentsdb.NewService函数的典型用法代码示例。如果您正苦于以下问题:Golang NewService函数的具体用法?Golang NewService怎么用?Golang NewService使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewService函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: appendOpenTSDBService
func (s *Server) appendOpenTSDBService(c opentsdb.Config) error {
if !c.Enabled {
return nil
}
srv, err := opentsdb.NewService(c)
if err != nil {
return err
}
srv.PointsWriter = s.PointsWriter
srv.MetaStore = s.MetaStore
s.Services = append(s.Services, srv)
return nil
}
示例2: appendOpenTSDBService
func (s *Server) appendOpenTSDBService(c opentsdb.Config) error {
if !c.Enabled {
return nil
}
l := s.LogService.NewStaticLevelLogger("[opentsdb] ", log.LstdFlags, wlog.INFO)
srv, err := opentsdb.NewService(c)
if err != nil {
return err
}
srv.SetLogger(l)
srv.PointsWriter = s.TaskMaster
srv.MetaStore = s.MetaStore
s.Services = append(s.Services, srv)
return nil
}
示例3: NewService
// NewService returns a new instance of Service.
func NewService(database string) *Service {
srv, _ := opentsdb.NewService(opentsdb.Config{
BindAddress: "127.0.0.1:0",
Database: database,
ConsistencyLevel: "one",
})
s := &Service{Service: srv}
s.Service.PointsWriter = &s.PointsWriter
s.Service.MetaClient = &DatabaseCreator{}
if !testing.Verbose() {
s.Logger = log.New(ioutil.Discard, "", log.LstdFlags)
}
return s
}