コード例 #1
0
func (s *SchemaHTTPService) dashboardSchemaHandler(w http.ResponseWriter, r *http.Request) {
	skeleton := s.isSkeletonRequest(r)
	d := schemas.NewDashboard(skeleton)
	s.writeJsonReponse(w, r, d, 200)
}
コード例 #2
0
	"github.com/metrilyx/metrilyx-dashboarder/metrilyx/config"
	schemas "github.com/metrilyx/metrilyx-dashboarder/metrilyx/dashboards/schemas/v3"
	"io/ioutil"
	"path/filepath"
	"testing"
)

var (
	testLogger          = simplelog.NewStdLogger()
	testDashId          = "Metrilyx"
	testDashJsonFile, _ = filepath.Abs("../../../testdata/metrilyx.json")
	testConfigFile, _   = filepath.Abs("../../../etc/metrilyx/metrilyx.json.sample")
	testEssMapFile, _   = filepath.Abs("../../../etc/metrilyx/ess-dashboard-mapping.json")
	testConfig          *config.Config
	testEssDs           *ElasticsearchDatastore
	testDash            = schemas.NewDashboard(true)
)

func Test_ElasticsearchDatastore(t *testing.T) {
	var (
		err error
	)

	testConfig, err = config.LoadConfig(testConfigFile)
	if err != nil {
		t.Fatalf("FAILED: %s", err)
	}
	testConfig.Datastore.TypeConfig["mapping_file"] = testEssMapFile

	testEssDs, err = NewElasticsearchDatastore(&testConfig.Datastore, testLogger)
	if err != nil {