database

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package database provides a database service provider for the Cortex platform.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBProvider

type DBProvider struct {
	*plugin.BaseProvider
	// contains filtered or unexported fields
}

DBProvider implements the plugin.Provider interface for database operations.

func NewDBProvider

func NewDBProvider(logger *log.Logger) (*DBProvider, error)

NewDBProvider creates a new database provider.

type SimpleDatabase

type SimpleDatabase struct {
	// contains filtered or unexported fields
}

SimpleDatabase is an in-memory key-value store for the example.

func NewSimpleDatabase

func NewSimpleDatabase() *SimpleDatabase

NewSimpleDatabase creates a new in-memory database.

func (*SimpleDatabase) Delete

func (db *SimpleDatabase) Delete(key string) bool

Delete removes a value from the database.

func (*SimpleDatabase) Get

func (db *SimpleDatabase) Get(key string) (interface{}, bool)

Get retrieves a value from the database.

func (*SimpleDatabase) Keys

func (db *SimpleDatabase) Keys() []string

Keys returns all keys in the database.

func (*SimpleDatabase) Set

func (db *SimpleDatabase) Set(key string, value interface{})

Set stores a value in the database.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL