server

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	pb.UnimplementedCRMServer
	// contains filtered or unexported fields
}

API that implements our grpc server API

func New

func New(addr string, store storage.Data, options ...Option) (*API, error)

New constructor for the API

func (*API) AddCustomers

func (a *API) AddCustomers(ctx context.Context, req *pb.AddCustomersReq) (resp *pb.AddCustomersResp, err error)

AddCustomers adds customers to the CRM

func (*API) DeleteCustomers

func (a *API) DeleteCustomers(ctx context.Context, req *pb.DeleteCustomersReq) (resp *pb.DeleteCustomersResp, err error)

DeleteCustomers deletes customers from the CRM.

func (*API) SearchCustomers

func (a *API) SearchCustomers(req *pb.SearchCustomersReq, stream pb.CRM_SearchCustomersServer) error

SearchCustomers finds customers in the CRM.

func (*API) Start

func (a *API) Start() error

Start starts the server. This blocks until Stop() is called.

func (*API) Stop

func (a *API) Stop()

Stop stops the server.

func (*API) UpdateCustomers

func (a *API) UpdateCustomers(ctx context.Context, req *pb.UpdateCustomersReq) (resp *pb.UpdateCustomersResp, err error)

UpdateCustomers updates customers on the CRM

type Option

type Option func(a *API)

Option to customize grpc

func WithGRPCOpts

func WithGRPCOpts(opts ...grpc.ServerOption) Option

WithGRPCOpts creates the gRPC server with the options passed.

Directories

Path Synopsis
mem

Jump to

Keyboard shortcuts

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