package local

import (
	db_schema "github.com/creativesoftwarefdn/weaviate/database/schema"
)

func (l *LocalSchemaManager) RegisterSchemaUpdateCallback(callback func(updatedSchema db_schema.Schema)) {
	l.callbacks = append(l.callbacks, callback)
}

func (l *LocalSchemaManager) triggerCallbacks() {
	schema := l.GetSchema()

	for _, cb := range l.callbacks {
		cb(schema)
	}
}

package local

import (
	db_schema "github.com/creativesoftwarefdn/weaviate/database/schema"
)

func (l *localSchemaManager) RegisterSchemaUpdateCallback(callback func(updatedSchema db_schema.Schema)) {
	l.callbacks = append(l.callbacks, callback)
}

func (l *localSchemaManager) triggerCallbacks() {
	schema := l.GetSchema()

	for _, cb := range l.callbacks {
		cb(schema)
	}
}

Extend schema to also be able to store state for a connector.
Extend schema to also be able to store state for a connector.

- Introduce two interfaces "database/connector_state".StateManager
  and "database/connector_state".Connector
- Make the database initialization connect those two.
- Convert local schema storage from struct to interface.

Closes gh-552.
