transport

package module
v0.0.0-...-3d1347b Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: BSD-2-Clause Imports: 8 Imported by: 1

README

raft-grpc-transport

Godoc

This library provides a Transport for https://github.com/hashicorp/raft over gRPC.

One benefit of this is that gRPC is easy to multiplex over a single port.

Usage

// ...
tm := transport.New(raft.ServerAddress(myAddress), []grpc.DialOption{grpc.WithInsecure()})
s := grpc.NewServer()
tm.Register(s)
r, err := raft.NewRaft(..., tm.Transport())
// ...

Want more example code? Check out main.go at https://github.com/Jille/raft-grpc-example

Documentation

Overview

Package transport provides a Transport for github.com/hashicorp/raft over gRPC.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func New

func New(localAddress raft.ServerAddress, dialOptions []grpc.DialOption) *Manager

New creates both components of raft-grpc-transport: a gRPC service and a Raft Transport.

func (*Manager) Register

func (m *Manager) Register(s *grpc.Server)

Register the RaftTransport gRPC service on a gRPC server.

func (*Manager) Transport

func (m *Manager) Transport() raft.Transport

Transport returns a raft.Transport that communicates over gRPC.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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