storagerpc

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(
	addr net.Addr, m docmarshal.Marshaler, opts ...grpc.DialOption,
) (storageapi.Service, error)

NewClient returns a grpc-based client that satisfies Service by relaying operations to remote datastore server. See NewServer for more details.

func RegisterCollectionDocumentService added in v0.0.2

func RegisterCollectionDocumentService(
	registrar grpc.ServiceRegistrar, srv docpb.DocumentStoreServer, collection string,
)

RegisterCollectionDocumentService registers the given srv with the given registrar with a custom service description name, that enables registering one service per collection. Client.InitWithCollection should be used on the client side to talk to a service registered via this function.

Types

type Client

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

func (*Client) Close

func (c *Client) Close() error

func (*Client) Create

func (c *Client) Create(
	ctx context.Context, ID string, data interface{},
) error

func (*Client) Delete

func (c *Client) Delete(
	ctx context.Context, ID string,
) error

func (*Client) Get

func (c *Client) Get(
	ctx context.Context, ID string, doc interface{},
) error

func (*Client) Init

func (*Client) InitWithCollection added in v0.0.2

func (c *Client) InitWithCollection(
	cc grpc.ClientConnInterface, m docmarshal.Marshaler, collection string,
)

InitWithCollection initializes this Client with the given grpc connection, encoding marhshaler, and uses collection to suffix the service descriptor to enable multiple collection services registered in the same server. Server should be registered with grpc via RegisterCollectionDocumentService.

func (*Client) List

func (c *Client) List(
	ctx context.Context, filters []storageapi.Filter,
) (storageapi.Iterator, error)

func (*Client) Set

func (c *Client) Set(
	ctx context.Context, ID string, data interface{},
) error

func (*Client) Update

func (c *Client) Update(
	ctx context.Context, ID string, updates []storageapi.Update,
	preconds ...storageapi.Precondition,
) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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