server

package
v0.2.1-0...-a6904e9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2015 License: MIT Imports: 20 Imported by: 1

Documentation

Overview

Package server implements the dcounter server

For example usage see: https://github.com/atomx/dcounter/blob/master/server.go#L128

Index

Constants

View Source
const VERSION = "master"

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	Up       float64
	Down     float64
	Revision uint32
}

type Counters

type Counters map[string]map[string]*Counter

type Errors

type Errors []error

func (Errors) Error

func (errs Errors) Error() string

func (Errors) Len

func (errs Errors) Len() int

func (Errors) Merge

func (errs Errors) Merge() error

type Server

type Server struct {
	Config *memberlist.Config
	// contains filtered or unexported fields
}

func New

func New(name, bind, advertise, client string) (*Server, error)

func (*Server) GetBroadcasts

func (s *Server) GetBroadcasts(overhead, limit int) [][]byte

func (*Server) Join

func (s *Server) Join(hosts []string) error

func (*Server) Kill

func (s *Server) Kill() error

func (*Server) Load

func (s *Server) Load(filename string) error

func (*Server) LocalState

func (s *Server) LocalState(join bool) []byte

LocalState is called when memberlist wants to do a full TCP state transfer to one random node. Since it's only one random node we shouldn't reset s.changes here.

func (*Server) MergeRemoteState

func (s *Server) MergeRemoteState(buf []byte, join bool)

func (*Server) NodeMeta

func (s *Server) NodeMeta(limit int) []byte

func (*Server) NotifyJoin

func (s *Server) NotifyJoin(node *memberlist.Node)

func (*Server) NotifyLeave

func (s *Server) NotifyLeave(node *memberlist.Node)

func (*Server) NotifyMsg

func (s *Server) NotifyMsg(msg []byte)

func (*Server) NotifyUpdate

func (s *Server) NotifyUpdate(node *memberlist.Node)

func (*Server) Save

func (s *Server) Save(filename string) (err error)

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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