kv

package
v0.1.213 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentName = "kv"

	StorePort       = "store"
	QueryPort       = "query"
	QueryResultPort = "query_result"
	StoreAckPort    = "store_ack"

	OpStore  = "store"
	OpDelete = "delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Component added in v0.1.213

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

Component implements a metadata-backed key-value store

func (*Component) GetInfo added in v0.1.213

func (c *Component) GetInfo() module.ComponentInfo

func (*Component) Handle added in v0.1.213

func (c *Component) Handle(ctx context.Context, handler module.Handler, port string, msg any) any

func (*Component) Instance added in v0.1.213

func (c *Component) Instance() module.Component

func (*Component) Ports added in v0.1.213

func (c *Component) Ports() []module.Port

type Context added in v0.1.213

type Context any

Context type alias for schema generation

type Document added in v0.1.213

type Document map[string]interface{}

Document is the user-defined value structure

func (Document) PrepareJSONSchema added in v0.1.213

func (d Document) PrepareJSONSchema(schema *jsonschema.Schema) error

type QueryRequest added in v0.1.213

type QueryRequest struct {
	Context Context `json:"context,omitempty" configurable:"true" title:"Context"`
	Query   string  `` /* 142-byte string literal not displayed */
}

QueryRequest is the input for querying records

type QueryResult added in v0.1.213

type QueryResult struct {
	Context Context           `json:"context,omitempty" title:"Context"`
	Results []QueryResultItem `json:"results" title:"Results"`
	Count   int               `json:"count" title:"Count"`
	Query   string            `json:"query" title:"Query"`
}

QueryResult returns all matching records

type QueryResultItem added in v0.1.213

type QueryResultItem struct {
	Key      string   `json:"key" title:"Key"`
	Document Document `json:"document" title:"Document"`
}

QueryResultItem is a single matched record

type Settings added in v0.1.213

type Settings struct {
	Document       Document `` /* 217-byte string literal not displayed */
	PrimaryKey     string   `json:"primaryKey" title:"Primary Key" required:"true" default:"id"`
	MaxRecords     int      `json:"maxRecords" title:"Max Records" description:"Maximum number of records (0 = default 100)" default:"100"`
	EnableStoreAck bool     `` /* 136-byte string literal not displayed */
}

Settings configures the KV store

type StoreAck added in v0.1.213

type StoreAck struct {
	Context Context      `json:"context,omitempty" title:"Context"`
	Request StoreRequest `json:"request" title:"Request"`
}

StoreAck acknowledges a store/delete operation

type StoreRequest added in v0.1.213

type StoreRequest struct {
	Context   Context  `json:"context,omitempty" configurable:"true" title:"Context"`
	Operation string   `json:"operation" required:"true" enum:"store,delete" enumTitles:"Store,Delete" default:"store" title:"Operation"`
	Document  Document `json:"document" required:"true" title:"Document" description:"Document to store or delete"`
}

StoreRequest is the input for store/delete operations

Jump to

Keyboard shortcuts

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