client

package
v0.0.0-...-a78c8b9 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Aggregate(context.Context, *types.AggregateRequest) error //being used by distance calaculator to aggregate the tolls
	GetInvoice(context.Context, int) (*types.Invoice, error)  //being used by gateway to get the invoice
}

type GRPCClient

type GRPCClient struct {
	Endpoint string
	Client   types.AggregatorClient
}

func NewGRPCClient

func NewGRPCClient(endpoint string) (*GRPCClient, error)

func (*GRPCClient) Aggregate

func (c *GRPCClient) Aggregate(ctx context.Context, req *types.AggregateRequest) error

type HTTPClient

type HTTPClient struct {
	EndPoint string
}

func NewHTTPClient

func NewHTTPClient(endpoint string) *HTTPClient

func (*HTTPClient) Aggregate

func (c *HTTPClient) Aggregate(ctx context.Context, aggReq *types.AggregateRequest) error

the client here is putting all the distance data coming from distance calculator to the aggregator service

func (*HTTPClient) GetInvoice

func (c *HTTPClient) GetInvoice(ctx context.Context, id int) (*types.Invoice, error)

Jump to

Keyboard shortcuts

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