...

Package mesh

import "github.com/Diarkis/diarkis/mesh/lib/udp"
Overview
Index

Overview ▾

Constants

DefaultPort Default port

const DefaultPort string = "8100"

Variables

RcvCnt used to measure how many packets are being received every second

var RcvCnt = 0

func Config

func Config()

Config Loads a configuration file into memory it assumes mesh/mesh.go loads config first

func GetMyEndPoint

func GetMyEndPoint() string

GetMyEndPoint Returns the end point

func IsMyself

func IsMyself(addr string) bool

IsMyself Returns true if the given address is its own

func NoMeshAddrFileOutput

func NoMeshAddrFileOutput()

NoMeshAddrFileOutput this will prevent from mesh to write its own addrss to MESH_DIARKIS_ADDR in /tmp

func OnShutdownMeshNetwork

func OnShutdownMeshNetwork(callback func(func()))

OnShutdownMeshNetwork registers a callback on ShutdownMeshNetwork

func SetValidator

func SetValidator(v func(string) bool)

SetValidator [INTERNAL USE ONLY] this is called in mesh.go to pass validator function to see if the message sender is in the same cluster or not

func ShutdownMeshNetwork

func ShutdownMeshNetwork()

ShutdownMeshNetwork Stops mesh network

func Start

func Start(next func(error))

Start Starts mesh network