memorycore

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package memorycore is the thin Go SDK for memory.v1.MemoryCore. It mirrors the public RPCs and deliberately contains no Memory state machine.

Index

Constants

View Source
const DefaultTimeout = 10 * time.Second

Variables

View Source
var (
	ErrInvalidRequest = errors.New("invalid MemoryCore request")
	ErrInvalidToken   = errors.New("invalid MemoryCore bearer token")
)

Functions

This section is empty.

Types

type Client

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

func Dial

func Dial(_ context.Context, config Config) (*Client, error)

Dial creates and owns one gRPC connection. Transport credentials are always explicit; the SDK has no implicit insecure network default.

func New

func New(rpc memoryv1.MemoryCoreClient, config Config) (*Client, error)

New wraps an existing generated client. Callers retain transport ownership.

func NewFromConnection

func NewFromConnection(connection grpc.ClientConnInterface, config Config) (*Client, error)

NewFromConnection builds a caller-owned client from an explicit connection.

func (*Client) Close

func (client *Client) Close() error

Close releases a Dial-owned connection once. It is a safe no-op for caller-owned transports.

func (*Client) ObserveSourceEvent

func (client *Client) ObserveSourceEvent(ctx context.Context, request *memoryv1.ObserveSourceEventRequest, options ...grpc.CallOption) (*memoryv1.SourceEventReceipt, error)

func (*Client) RecordMemoryDelivery

func (client *Client) RecordMemoryDelivery(ctx context.Context, request *memoryv1.MemoryDeliveryReceipt, options ...grpc.CallOption) (*memoryv1.ReceiptAck, error)

func (*Client) ReportOutcome

func (client *Client) ReportOutcome(ctx context.Context, request *memoryv1.ReportOutcomeRequest, options ...grpc.CallOption) (*memoryv1.OutcomeReceipt, error)

func (*Client) SelectMemory

func (client *Client) SelectMemory(ctx context.Context, request *memoryv1.SelectMemoryRequest, options ...grpc.CallOption) (*memoryv1.MemoryContext, error)

type Config

type Config struct {
	Endpoint             string
	DefaultTimeout       time.Duration
	TokenProvider        TokenProvider
	TransportCredentials credentials.TransportCredentials
	DialOptions          []grpc.DialOption
}

type TokenProvider

type TokenProvider interface {
	Token(context.Context, string) (string, error)
}

TokenProvider returns one bearer token for the exact request tenant.

type TokenProviderFunc

type TokenProviderFunc func(context.Context, string) (string, error)

TokenProviderFunc adapts a function to TokenProvider.

func (TokenProviderFunc) Token

func (provider TokenProviderFunc) Token(ctx context.Context, tenantRef string) (string, error)

Jump to

Keyboard shortcuts

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