client

package
v0.0.0-...-213eba4 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallOption

type CallOption func(co *callOptions)

CallOption are optional options for an RPC call.

func TraceID

func TraceID(s *string) CallOption

TraceID will cause the RPC call to execute a trace on the service and return "s" to the ID. If s == nil, this will ignore the option. If "s" is not set after the call finishes, then no trace was made.

type Client

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

Client is a client to the CRM service.

func New

func New(addr string) (*Client, error)

New is the constructor for Client. addr is the server's [host]:[port].

func (*Client) AddCustomers

func (c *Client) AddCustomers(ctx context.Context, customers []*pb.Customer, options ...CallOption) ([]string, error)

AddCustomers adds customers to the service and returns their unique identities in the same order as being added.

func (*Client) DeleteCustomers

func (c *Client) DeleteCustomers(ctx context.Context, ids []string, options ...CallOption) error

DeleteCustomers deletes pets with the IDs passed. If the ID doesn't exist, the system ignores it.

func (*Client) SearchCustomers

func (c *Client) SearchCustomers(ctx context.Context, filter *pb.SearchCustomersReq, options ...CallOption) (chan Customer, error)

SearchCustomers searches the pet store for pets matching the filter. If the filter contains no entries, then all pets will be returned.

func (*Client) UpdateCustomers

func (c *Client) UpdateCustomers(ctx context.Context, customers []*pb.Customer, options ...CallOption) error

UpdateCustomers updates customers that already exist in the system.

type Customer

type Customer struct {
	*pb.Customer
	// contains filtered or unexported fields
}

Customer is a wrapper around a *pb.Customer that can return Go versions of fields and errors if the returned stream has an error.

func (Customer) Error

func (c Customer) Error() error

Error indicates if there was an error in the Customer output stream.

func (Customer) Proto

func (c Customer) Proto() *pb.Customer

Proto will give the Customer's proto representation.

Jump to

Keyboard shortcuts

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