featurer/server/internal/services/core/datastore.go

29 lines
1.2 KiB
Go
Raw Permalink Normal View History

2024-10-12 13:04:09 +05:00
package core
import "errors"
2024-10-14 01:14:28 +05:00
const (
// DatastorePathDelimiter is a delimiter that should be used for path elements delimiter.
DatastorePathDelimiter = "/"
// ServiceNameDatastore is a service name for data storage implementation.
ServiceNameDatastore = "datastore"
)
2024-10-12 13:04:09 +05:00
var (
// ErrDatastore indicates that error appeared somewhere in data storage service.
ErrDatastore = errors.New("datastore")
2024-10-14 01:14:28 +05:00
// ErrDatastoreAppNotFound appears when requesting data for application which wasn't registered via API or loaded
// from disk.
ErrDatastoreAppNotFound = errors.New("application not found")
2024-10-12 13:04:09 +05:00
// ErrDatastoreServiceIsInvalid appears when data storage implementation isn't conforming to interface.
ErrDatastoreServiceIsInvalid = errors.New("invalid datastore implementation")
2024-10-14 01:14:28 +05:00
// ErrDatastoreValueInvalid appears when trying to get value from datastore using incompatible getter (e.g.
// when trying to get bool with GetString).
ErrDatastoreValueInvalid = errors.New("requested value is invalid")
// ErrDatastoreValueNotFound appears when trying to get value with path which isn't known.
ErrDatastoreValueNotFound = errors.New("requested value not found")
2024-10-12 13:04:09 +05:00
)
// DataStore is an interface for data storage implementations.
type DataStore interface{}