weaviate

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps the Weaviate client with additional functionality

func NewClient

func NewClient(config *Config) (*Client, error)

NewClient creates a new Weaviate client

func (*Client) DeleteCollection

func (c *Client) DeleteCollection(ctx context.Context, collectionName string) error

DeleteCollection deletes all objects from a collection

func (*Client) DeleteDocument

func (c *Client) DeleteDocument(ctx context.Context, collectionName, documentID string) error

DeleteDocument deletes a specific document by ID

func (*Client) GetCollectionSchema

func (c *Client) GetCollectionSchema(ctx context.Context, collectionName string) ([]string, error)

GetCollectionSchema returns the schema for a collection

func (*Client) GetDocument

func (c *Client) GetDocument(ctx context.Context, collectionName, documentID string) (*Document, error)

GetDocument retrieves a specific document by ID

func (*Client) Health

func (c *Client) Health(ctx context.Context) error

Health checks the health of the Weaviate instance

func (*Client) ListCollections

func (c *Client) ListCollections(ctx context.Context) ([]string, error)

ListCollections returns a list of all collections

func (*Client) ListDocuments

func (c *Client) ListDocuments(ctx context.Context, collectionName string, limit int) ([]Document, error)

ListDocuments returns a list of documents in a collection Note: Currently shows document IDs only. To show actual document content/metadata, we would need to implement dynamic schema discovery for each collection.

type Config

type Config struct {
	URL    string
	APIKey string
}

Config holds Weaviate client configuration

type Document

type Document struct {
	ID       string                 `json:"id"`
	Content  string                 `json:"content"`
	Metadata map[string]interface{} `json:"metadata"`
}

Document represents a document in Weaviate

Jump to

Keyboard shortcuts

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