reverb

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: Apache-2.0 Imports: 3 Imported by: 4

README

reverb

A gRPC Server API Convenience Wrapper

About

Reverb is cheekily synonymized from the HTTPD package Echo and aims to serve a minimally similar purpose, though for gRPC instead of HTTP.

Example Use

In particular, see the StartgRPCD function below:

package app

import (
  "fmt"

  "github.com/labstack/echo/v4"
  "github.com/geomyidia/reverb"
)

// Application ...
type Application struct {
  Config *cfg.Config
  HTTPD  *echo.Echo
  GRPCD  *reverb.Reverb
}

// StartgRPCD ...
func (a *Application) StartgRPCD() {
  serverOpts := fmt.Sprintf("%s:%d", a.Config.GRPCD.Host, a.Config.GRPCD.Port)
  server := a.GRPCD.Start(serverOpts)
  a.SetupgRPCImplementation(server)
  server.Serve()
}

// Setup for other services, e.g., HTTPD
// ...

// Start all services
func (a *Application) Start() {
  a.StartgRPCD()
  a.StartHTTPD()
  ...
}

Documentation

Overview

Package reverb - name is cheekily synonymized from the HTTPD package "Echo" and aims to serve a minimally similar purpose, though for gRPC instead of HTTP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reverb

type Reverb struct {
	TCPListener net.Listener
	GRPCServer  *grpc.Server
}

Reverb ...

func New

func New() *Reverb

New ...

func (*Reverb) Close added in v0.2.0

func (r *Reverb) Close()

Close ...

func (*Reverb) Register

func (r *Reverb) Register()

Register ...

func (*Reverb) Serve

func (r *Reverb) Serve()

Serve ...

func (*Reverb) Start

func (r *Reverb) Start(opts string) *Reverb

Start ...

Jump to

Keyboard shortcuts

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