dnetserver

package
v0.0.0-...-1a6bc1e Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2017 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package dnetserver implements the DiscoveryNetwork gRPC server. globals.go contains data used by each gRPC handler in dnetserver.

Index

Constants

View Source
const (
	PASSWORD_SALT_LENGTH int = 64
)

Variables

View Source
var PoolLock sync.RWMutex

PoolLock is locked when acessing the pool map

View Source
var Pools map[string]*Pool

Pools map

View Source
var RenewInterval time.Duration

RenewInterval global containing the time after which the nodes will be marked as inactive

View Source
var StateDirectoryPath string

StateDirectoryPath is the path to the directory in which the discovery server stores its state

View Source
var TempDirectoryPath string

TempDirecotryPath is the path to the directory where temporary state files are stored

Functions

func LoadState

func LoadState()

LoadState loads the state from the statefiles in the state directory

Types

type DiscoveryServer

type DiscoveryServer struct{}

DiscoveryServer struct

func (*DiscoveryServer) Disconnect

func (s *DiscoveryServer) Disconnect(ctx context.Context, req *pb.DisconnectRequest) (*pb.EmptyMessage, error)

Disconnect method for Discovery Server

func (*DiscoveryServer) Join

Join method for Discovery Server

type Pool

type Pool struct {
	PoolLock sync.Mutex
	Info     PoolInfo
}

type PoolInfo

type PoolInfo struct {
	PasswordSalt []byte `json:"passwordsalt"`
	PasswordHash []byte `json:"passwordhash"`
	Nodes        map[string]*pb.Node
}

PoolInfo struct to hold the pool data

Jump to

Keyboard shortcuts

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