api

package
v0.0.0-...-eee30f5 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPServer

func NewHTTPServer(i *inventory.Service, tel telemetry.Provider) http.Handler

NewHTTPServer creates an HTTP server for the API.

Types

type HTTPServer

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

HTTPServer exposes inventory.Service via HTTP.

type InventoryGRPC

type InventoryGRPC struct {
	apipb.UnimplementedInventoryServer
	Inventory *inventory.Service
}

InventoryGRPC services.

func (*InventoryGRPC) CreateProduct

CreateProduct on the inventory.

func (*InventoryGRPC) CreateProductReview

CreateProductReview on the inventory.

func (*InventoryGRPC) DeleteProduct

DeleteProduct on the inventory.

func (*InventoryGRPC) DeleteProductReview

func (*InventoryGRPC) GetProduct

GetProduct on the inventory.

func (*InventoryGRPC) GetProductReview

func (*InventoryGRPC) SearchProducts

func (*InventoryGRPC) UpdateProduct

UpdateProduct on the inventory.

func (*InventoryGRPC) UpdateProductReview

type Server

type Server struct {
	HTTPAddress  string
	GRPCAddress  string
	ProbeAddress string

	Log        *slog.Logger
	Tracer     trace.TracerProvider
	Meter      metric.MeterProvider
	Propagator propagation.TextMapPropagator

	Inventory *inventory.Service
	// contains filtered or unexported fields
}

Server for the API.

func (*Server) Run

func (s *Server) Run(ctx context.Context) (err error)

Run starts the HTTP and gRPC servers.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context)

Shutdown HTTP and gRPC servers.

Jump to

Keyboard shortcuts

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