Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver interface { // NewSpecStore returns a store for managing specifications. NewSpecStore(ctx context.Context, name string) (spec.Store, error) // NewValueStore returns a store for managing values. NewValueStore(ctx context.Context, name string) (value.Store, error) // Close terminates the connection and releases resources. Close(ctx context.Context) error }
Driver defines an interface for interacting with various storage mechanisms.
func NewInMemoryDriver ¶
func NewInMemoryDriver() Driver
NewInMemoryDriver creates and returns a new InMemoryDriver instance.
func NewMongoDriver ¶
NewMongoDriver initializes a new MongoDB connection and returns a Driver instance.
type InMemoryDriver ¶
type InMemoryDriver struct{}
InMemoryDriver is a mock driver that provides in-memory stores.
func (*InMemoryDriver) Close ¶
func (c *InMemoryDriver) Close(_ context.Context) error
Close is a no-op for InMemoryDriver, as there is no actual connection to close.
func (*InMemoryDriver) NewSpecStore ¶ added in v0.13.0
NewSpecStore creates and returns a new in-memory Spec Store.
func (*InMemoryDriver) NewValueStore ¶ added in v0.13.0
NewValueStore creates and returns a new in-memory Value Store.
type MongoDriver ¶
type MongoDriver struct {
// contains filtered or unexported fields
}
MongoDriver represents a MongoDB connection and provides methods to interact with the database.
func (*MongoDriver) Close ¶
func (d *MongoDriver) Close(ctx context.Context) error
Close closes the MongoDB connection.
func (*MongoDriver) NewSpecStore ¶ added in v0.13.0
NewSpecStore creates and returns a new Spec Store.
func (*MongoDriver) NewValueStore ¶ added in v0.13.0
NewValueStore creates and returns a new Value Store.