Esempio n. 1
0
// GetMetaDataController returns an already configured meta data controller.
func GetMetaDataController(conf *config.Config) (metadatacontroller.MetaDataController, error) {
	dirs := conf.GetDirectives()
	switch dirs.MetaData.Type {
	case "simple":
		return simple.New(conf)
	case "ocsql":
		return ocsql.New(conf)
	default:
		return nil, errors.New("metadata type " + dirs.MetaData.Type + "does not exist")
	}
}
Esempio n. 2
0
// New returns an implementation of DataController.
func New(conf *config.Config) (datacontroller.DataController, error) {

	c, err := ocsql.New(conf)
	if err != nil {
		return nil, err
	}
	metaDataController := c.(*ocsql.Controller)

	return &controller{
		conf:               conf,
		metaDataController: metaDataController,
	}, nil
}