client

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: MIT Imports: 11 Imported by: 0

README

memory-tools-client-go

Memory tools client Go Repository

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
}

func NewClient

func NewClient(opts ClientOptions) *Client

func (*Client) Begin

func (c *Client) Begin() (*CommandResponse, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) CollectionCreate

func (c *Client) CollectionCreate(name string) (*CommandResponse, error)

func (*Client) CollectionDelete

func (c *Client) CollectionDelete(name string) (*CommandResponse, error)

func (*Client) CollectionIndexCreate

func (c *Client) CollectionIndexCreate(collectionName, fieldName string) (*CommandResponse, error)

func (*Client) CollectionIndexDelete

func (c *Client) CollectionIndexDelete(collectionName, fieldName string) (*CommandResponse, error)

func (*Client) CollectionIndexList

func (c *Client) CollectionIndexList(collectionName string) ([]string, error)

func (*Client) CollectionItemDelete

func (c *Client) CollectionItemDelete(collectionName, key string) (*CommandResponse, error)

func (*Client) CollectionItemDeleteMany

func (c *Client) CollectionItemDeleteMany(collectionName string, keys []string) (*CommandResponse, error)

func (*Client) CollectionItemGet

func (c *Client) CollectionItemGet(collectionName, key string) (*GetResult, error)

func (*Client) CollectionItemSet

func (c *Client) CollectionItemSet(collectionName, key string, value any, ttl time.Duration) (*CommandResponse, error)

func (*Client) CollectionItemSetMany

func (c *Client) CollectionItemSetMany(collectionName string, items []any) (*CommandResponse, error)

func (*Client) CollectionItemUpdate

func (c *Client) CollectionItemUpdate(collectionName, key string, patchValue any) (*CommandResponse, error)

func (*Client) CollectionItemUpdateMany

func (c *Client) CollectionItemUpdateMany(collectionName string, items []any) (*CommandResponse, error)

func (*Client) CollectionList

func (c *Client) CollectionList() ([]string, error)

func (*Client) CollectionQuery

func (c *Client) CollectionQuery(collectionName string, query Query) (*CommandResponse, error)

func (*Client) Commit

func (c *Client) Commit() (*CommandResponse, error)

func (*Client) Connect

func (c *Client) Connect() error

Connect establishes a connection.

func (*Client) IsAuthenticated

func (c *Client) IsAuthenticated() bool

func (*Client) Rollback

func (c *Client) Rollback() (*CommandResponse, error)

type ClientOptions

type ClientOptions struct {
	Host               string
	Port               int
	Username           string
	Password           string
	ServerCertPath     string
	InsecureSkipVerify bool
}

type CommandResponse

type CommandResponse struct {
	StatusCode byte
	Status     string
	Message    string
	RawData    []byte
}

func (*CommandResponse) JSON

func (r *CommandResponse) JSON(v any) error

func (*CommandResponse) OK

func (r *CommandResponse) OK() bool

type GetResult

type GetResult struct {
	*CommandResponse
}

func (*GetResult) Found

func (r *GetResult) Found() bool

func (*GetResult) Value

func (r *GetResult) Value(v any) error

type Query

type Query struct {
	Filter       map[string]any `json:"filter,omitempty"`
	OrderBy      []any          `json:"order_by,omitempty"`
	Limit        *int           `json:"limit,omitempty"`
	Offset       int            `json:"offset,omitempty"`
	Count        bool           `json:"count,omitempty"`
	Aggregations map[string]any `json:"aggregations,omitempty"`
	GroupBy      []string       `json:"group_by,omitempty"`
	Having       map[string]any `json:"having,omitempty"`
	Distinct     string         `json:"distinct,omitempty"`
	Projection   []string       `json:"projection,omitempty"`
	Lookups      []any          `json:"lookups,omitempty"`
}

Jump to

Keyboard shortcuts

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