httpclient

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package httpclient is a client of the memory's HTTP API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*client.Client
}

Client is a client of the memory's HTTP API, which wraps the base HTTP client, with typed methods for its requests

func New

func New(url string, opts ...client.ClientOpt) (*Client, error)

New returns a client of the memory's API, at the URL, which is the server's API endpoint, such as http://localhost:8084/api, with the options. Each method adds its own path, such as memory/detail, as the memory's handlers register them.

func (*Client) ForgetDetail

func (c *Client) ForgetDetail(ctx context.Context, field schema.Field) (*schema.Details, error)

ForgetDetail forgets the detail of the field, so it isn't known, and returns the details

func (*Client) ForgetMemory

func (c *Client) ForgetMemory(ctx context.Context, key, line string) (*schema.Memory, error)

ForgetMemory forgets the memory with the key, or, with a line, only the line of it, and returns the memory, as it is, or was, when it's forgotten

func (*Client) GetDetails

func (c *Client) GetDetails(ctx context.Context) (*schema.Details, error)

GetDetails returns the details, which are those which are known, or declined

func (*Client) GetMemory

func (c *Client) GetMemory(ctx context.Context, key string) (*schema.Memory, error)

GetMemory returns the memory with the key

func (*Client) ListMemories

func (c *Client) ListMemories(ctx context.Context, req schema.MemoryListRequest) (*schema.MemoryList, error)

ListMemories returns the memories, the most recently changed first, as the request selects, and how many there are

func (*Client) RememberMemory

func (c *Client) RememberMemory(ctx context.Context, key string, req schema.MemoryRequest) (*schema.Memory, error)

RememberMemory remembers the memory with the key, which is created, when the request has no version, or replaces the memory at the version, and returns it

func (*Client) SetDetail

func (c *Client) SetDetail(ctx context.Context, field schema.Field, detail schema.Detail) (*schema.Details, error)

SetDetail sets the detail of the field, which is its value, or that it's declined, and returns the details

Jump to

Keyboard shortcuts

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