dnetserver

package
v0.0.0-...-dde4a86 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 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 (
	// PasswordSaltLength is the length of the generated password salt.
	PasswordSaltLength 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

TempDirectoryPath 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 {
	pb.UnimplementedDiscoveryNetworkServiceServer
}

DiscoveryServer struct

func (*DiscoveryServer) Disconnect

Disconnect method for Discovery Server

func (*DiscoveryServer) Join

Join method for Discovery Server

type Pool

type Pool struct {
	PoolLock sync.Mutex
	Info     PoolInfo
}

Pool is the safe wrapper around PoolInfo with a mutex.

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