server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package server implements the internal server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(peerDB *discovery.Peers, p2pNode *p2p.Node, addr string) (*http.Server, error)

func Run

func Run(ctx context.Context, opts Options) error

Run starts the internal server and blocks until a fatal error occurs or the context is canceled.

Types

type Handler

type Handler struct {
	PeerDB *discovery.Peers
	Node   *p2p.Node

	api.UnimplementedControlPlaneServer
}

Handler implements gRPC APIs.

func (Handler) GetSelf

type Options

type Options struct {
	Addr    string   // address exposing REST API
	Handler *Handler // gRPC handler

	Log zerolog.Logger
}

Options contains the server options.

Jump to

Keyboard shortcuts

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