portssvc

package
v0.0.0-...-80b0eab Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package portssvc implement Ports that exposes a gRPC API that allows to store and list Ports in persistence layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// GRPCServerAddress is a TCP address of the server. Env var: GRPC_SERVER_ADDRESS. Default: ":9090".
	GRPCServerAddress string `env:"GRPC_SERVER_ADDRESS" envDefault:":9090"`
}

Config is a configuration for GRPCServer.

type GRPCServer

type GRPCServer struct {
	portsgrpc.UnimplementedPortServiceServer
	// contains filtered or unexported fields
}

GRPCServer is a gRPC server for Ports domain service.

func NewServer

func NewServer(cfg Config) *GRPCServer

NewServer creates new GRPCServer with given configuration.

func (*GRPCServer) Address

func (s *GRPCServer) Address() net.Addr

Address return the TCP address of the server.

func (*GRPCServer) ListPorts

ListPorts handles the list ports request.

func (*GRPCServer) Serve

func (s *GRPCServer) Serve(ctx context.Context) error

Serve starts the gRPC Ports server. The server is gracefully stopped on context cancel/timeout. TODO(dfurman): support request/response logging.

func (*GRPCServer) StorePort

func (s *GRPCServer) StorePort(ctx context.Context, req *portsgrpc.StorePortRequest) (*emptypb.Empty, error)

StorePort handles the store port request.

Directories

Path Synopsis
domain
ports
Package ports contains objects and services for Ports domain.
Package ports contains objects and services for Ports domain.

Jump to

Keyboard shortcuts

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