Documentation ¶
Index ¶
- Constants
- Variables
- type Conf
- type DB
- func (pdb *DB) Cleanup()
- func (p *DB) ClockBoot() uint64
- func (p *DB) ClockNow() uint64
- func (p *DB) Datacenter() string
- func (p *DB) DomOK(dom string) bool
- func (p *DB) Env() string
- func (pdb *DB) ForAllData(fnc func(string, bool, interface{}))
- func (pdb *DB) ForAllExport(fnc func(*Export))
- func (pdb *DB) Get(id string) *Peer
- func (pdb *DB) GetAll() []*Peer
- func (pdb *DB) GetExportSelf() *Export
- func (p *DB) Host() string
- func (p *DB) Id() string
- func (pdb *DB) IsOwnAddr(addr string) bool
- func (pdb *DB) MyInfo() *PeerInfo
- func (pdb *DB) Myself() PeerImport
- func (pdb *DB) PeerDn(id string)
- func (pdb *DB) PeerUp(id string)
- func (p *DB) Rack() string
- func (pdb *DB) Start()
- func (pdb *DB) Stop()
- func (pdb *DB) Update(px PeerImport)
- func (pdb *DB) UpdateSceptical(px PeerImport)
- type Export
- type NetInfo
- func (*NetInfo) Descriptor() ([]byte, []int)
- func (m *NetInfo) GetAddr() string
- func (m *NetInfo) GetNatdom() string
- func (m *NetInfo) Marshal() (dAtA []byte, err error)
- func (m *NetInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *NetInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*NetInfo) ProtoMessage()
- func (m *NetInfo) Reset()
- func (m *NetInfo) Size() (n int)
- func (m *NetInfo) String() string
- func (m *NetInfo) Unmarshal(dAtA []byte) error
- func (m *NetInfo) XXX_DiscardUnknown()
- func (m *NetInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NetInfo) XXX_Merge(src proto.Message)
- func (m *NetInfo) XXX_Size() int
- func (m *NetInfo) XXX_Unmarshal(b []byte) error
- type Peer
- type PeerImport
- type PeerInfo
- func (*PeerInfo) Descriptor() ([]byte, []int)
- func (m *PeerInfo) GetDatacenter() string
- func (m *PeerInfo) GetEnvironment() string
- func (m *PeerInfo) GetHostname() string
- func (m *PeerInfo) GetNetInfo() []*NetInfo
- func (m *PeerInfo) GetRack() string
- func (m *PeerInfo) GetServerId() string
- func (m *PeerInfo) GetStatusCode() int32
- func (m *PeerInfo) GetSubsystem() string
- func (m *PeerInfo) GetTimeChecked() uint64
- func (m *PeerInfo) GetTimeConf() uint64
- func (m *PeerInfo) GetTimeCreated() uint64
- func (m *PeerInfo) GetTimeLastUp() uint64
- func (m *PeerInfo) GetTimeUpSince() uint64
- func (m *PeerInfo) GetVia() string
- func (m *PeerInfo) Marshal() (dAtA []byte, err error)
- func (m *PeerInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *PeerInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PeerInfo) ProtoMessage()
- func (m *PeerInfo) Reset()
- func (p *PeerInfo) SetStatusCode(st PeerStatus)
- func (m *PeerInfo) Size() (n int)
- func (m *PeerInfo) String() string
- func (m *PeerInfo) Unmarshal(dAtA []byte) error
- func (m *PeerInfo) XXX_DiscardUnknown()
- func (m *PeerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PeerInfo) XXX_Merge(src proto.Message)
- func (m *PeerInfo) XXX_Size() int
- func (m *PeerInfo) XXX_Unmarshal(b []byte) error
- type PeerStatus
Constants ¶
View Source
const ( TIMEOUT = 15 * time.Second OLDTIMER = 9 * time.Minute // less than KEEPLOST )
View Source
const ( MAXFAIL = 3 MAXVIA = 1024 )
View Source
const ( KEEPDOWN = 10 * lamport.Minute // keep data about down servers for how long? KEEPLOST = 10 * lamport.Minute // keep data about servers we have not heard about for how long? )
View Source
const STALE = int64(2 * time.Minute)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) Datacenter ¶
func (*DB) ForAllData ¶
func (*DB) ForAllExport ¶
func (*DB) GetExportSelf ¶
func (*DB) Myself ¶
func (pdb *DB) Myself() PeerImport
type NetInfo ¶
type NetInfo struct { Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` Natdom string `protobuf:"bytes,2,opt,name=natdom,proto3" json:"natdom,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*NetInfo) Descriptor ¶
func (*NetInfo) MarshalToSizedBuffer ¶
func (*NetInfo) ProtoMessage ¶
func (*NetInfo) ProtoMessage()
func (*NetInfo) XXX_DiscardUnknown ¶
func (m *NetInfo) XXX_DiscardUnknown()
func (*NetInfo) XXX_Marshal ¶
func (*NetInfo) XXX_Unmarshal ¶
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
func (*Peer) SetMaybeDn ¶
type PeerImport ¶
type PeerInfo ¶
type PeerInfo struct { StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` Subsystem string `protobuf:"bytes,2,opt,name=subsystem,proto3" json:"subsystem,omitempty"` Environment string `protobuf:"bytes,3,opt,name=environment,proto3" json:"environment,omitempty"` ServerId string `protobuf:"bytes,4,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"` Hostname string `protobuf:"bytes,5,opt,name=hostname,proto3" json:"hostname,omitempty"` Datacenter string `protobuf:"bytes,6,opt,name=datacenter,proto3" json:"datacenter,omitempty"` Rack string `protobuf:"bytes,7,opt,name=rack,proto3" json:"rack,omitempty"` // lamport clocks (see lamport.go) TimeChecked uint64 `protobuf:"varint,8,opt,name=time_checked,json=timeChecked,proto3" json:"time_checked,omitempty"` TimeLastUp uint64 `protobuf:"varint,9,opt,name=time_last_up,json=timeLastUp,proto3" json:"time_last_up,omitempty"` TimeCreated uint64 `protobuf:"varint,10,opt,name=time_created,json=timeCreated,proto3" json:"time_created,omitempty"` TimeConf uint64 `protobuf:"varint,11,opt,name=time_conf,json=timeConf,proto3" json:"time_conf,omitempty"` TimeUpSince uint64 `protobuf:"varint,12,opt,name=time_up_since,json=timeUpSince,proto3" json:"time_up_since,omitempty"` Via string `protobuf:"bytes,17,opt,name=via,proto3" json:"via,omitempty"` NetInfo []*NetInfo `protobuf:"bytes,20,rep,name=net_info,json=netInfo,proto3" json:"net_info,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PeerInfo) Descriptor ¶
func (*PeerInfo) GetDatacenter ¶
func (*PeerInfo) GetEnvironment ¶
func (*PeerInfo) GetHostname ¶
func (*PeerInfo) GetNetInfo ¶
func (*PeerInfo) GetServerId ¶
func (*PeerInfo) GetStatusCode ¶
func (*PeerInfo) GetSubsystem ¶
func (*PeerInfo) GetTimeChecked ¶
func (*PeerInfo) GetTimeConf ¶
func (*PeerInfo) GetTimeCreated ¶
func (*PeerInfo) GetTimeLastUp ¶
func (*PeerInfo) GetTimeUpSince ¶
func (*PeerInfo) MarshalToSizedBuffer ¶
func (*PeerInfo) ProtoMessage ¶
func (*PeerInfo) ProtoMessage()
func (*PeerInfo) SetStatusCode ¶
func (p *PeerInfo) SetStatusCode(st PeerStatus)
func (*PeerInfo) XXX_DiscardUnknown ¶
func (m *PeerInfo) XXX_DiscardUnknown()
func (*PeerInfo) XXX_Marshal ¶
func (*PeerInfo) XXX_Unmarshal ¶
type PeerStatus ¶
type PeerStatus int
const ( STATUS_UNKNOWN PeerStatus = 0 STATUS_UP PeerStatus = 2 STATUS_MAYBEDN PeerStatus = 3 STATUS_DOWN PeerStatus = 4 STATUS_SCEPTICAL PeerStatus = 5 STATUS_DEAD PeerStatus = 6 )
func (PeerStatus) String ¶
func (s PeerStatus) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.