예제 #1
0
func (s *Server) appendRetentionPolicyService(c retention.Config) {
	if !c.Enabled {
		return
	}
	srv := retention.NewService(c)
	srv.MetaStore = s.MetaStore
	srv.DataStore = s.DataStore
	s.Services = append(s.Services, srv)
}
예제 #2
0
func TestServiceConstructor(t *testing.T) {

	config := retention.NewConfig()

	s := retention.NewService(config)
	if err := s.Open(); err != nil {
		t.Fatal(err)
	}
	defer s.Close()
}
예제 #3
0
func TestServiceSettingLogger(t *testing.T) {

	config := retention.NewConfig()
	s := retention.NewService(config)

	logger := log.New(os.Stderr, "[retention] ", log.LstdFlags)
	s.SetLogger(logger)
	if s.Logger() != logger {
		t.Fatalf("unexpected logger state: %v", s.Logger())
	}

}