redistools

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPoolSize = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address  string `json:"address"`
	Password string `json:"password"`
	PoolSize int    `json:"pool_size"`
	DB       int    `json:"db"`
	UseTLS   bool   `json:"use_tls"`
}

func DefaultConfig

func DefaultConfig() Config

type DeleteResult

type DeleteResult struct {
	Deleted int64    `json:"deleted"`
	Keys    []string `json:"keys"`
}

type ExistsResult

type ExistsResult struct {
	Keys   []string `json:"keys"`
	Exists int64    `json:"exists"`
}

type GetResult

type GetResult struct {
	Key   string  `json:"key"`
	Value *string `json:"value,omitempty"`
	Found bool    `json:"found"`
}

type KeysResult

type KeysResult struct {
	Pattern string   `json:"pattern"`
	Keys    []string `json:"keys"`
	Count   int      `json:"count"`
}

type RedisClient

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

func NewRedisClient

func NewRedisClient(logger *slog.Logger, cfg Config) (*RedisClient, error)

func (*RedisClient) CallTool

func (c *RedisClient) CallTool(ctx context.Context, name string, args json.RawMessage) (interface{}, error)

func (*RedisClient) Close

func (c *RedisClient) Close()

func (*RedisClient) GetTools

func (c *RedisClient) GetTools() []ToolDefinition

type SetResult

type SetResult struct {
	Key    string `json:"key"`
	Status string `json:"status"`
}

type ToolDefinition

type ToolDefinition struct {
	Name        string          `json:"name"`
	Description string          `json:"description"`
	InputSchema json.RawMessage `json:"inputSchema"`
}

type ToolHandler

type ToolHandler func(ctx context.Context, args json.RawMessage) (interface{}, error)

Jump to

Keyboard shortcuts

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