utils

package
v0.0.0-...-2e37a5a Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ERROR_MSG = "NORESPONSE"
View Source
const Localhost = "127.0.0.1"
View Source
const MaxPort = 47808
View Source
const MinPort = 1025

Inclusive

Variables

This section is empty.

Functions

func CheckPredecessorCommand

func CheckPredecessorCommand() string

func ComputeId

func ComputeId(input string) uint32

func CreateRingCommand

func CreateRingCommand() string

func Debug

func Debug(log string, args ...string)

func FindRingPredecessorCommand

func FindRingPredecessorCommand() string

func FindRingSuccessorCommand

func FindRingSuccessorCommand(id uint32, replyTo string) string

{"do": "find-ring-successor", "id": id, "reply-to": address}

func FixRingFingersCommand

func FixRingFingersCommand() string

func GetCommand

func GetCommand(key string, replyTo string) string

func GetRandomPort

func GetRandomPort() int

func InitRingFingersCommand

func InitRingFingersCommand() string

func IsBetween

func IsBetween(start uint32, end uint32, val uint32) bool

func JoinRingCommand

func JoinRingCommand(sponsoringNode string) string

func LeaveRingCommand

func LeaveRingCommand(mode string) string

func ListItemsCommand

func ListItemsCommand(replyTo string) string

func NotifyOrderlyLeaveCommand

func NotifyOrderlyLeaveCommand(leaver uint32, pred *uint32, succ *uint32) string

func ParseToUInt32

func ParseToUInt32(input string) (uint32, error)

func PingCommand

func PingCommand() string

func PutCommand

func PutCommand(key string, value string, replyTo string) string

func RemoveCommand

func RemoveCommand(key string, replyTo string) string

func RingNotifyCommand

func RingNotifyCommand(id uint32, replyTo string) string

func SendMessage

func SendMessage(msg string, address string) (string, error)

func StabilizeRingCommand

func StabilizeRingCommand() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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