Documentation
¶
Index ¶
- Constants
- type AsyncGCounter
- type ClusterObserver
- type CountEvent
- type CounterObserver
- type EmergencyPersistence
- type GCounter
- type GCounterState
- type GCounterStateSink
- type GCounterStateSource
- type Incrementable
- type NetworkedGCounterState
- type Persistent
- type PersistentGCounter
- func NewPersistentGCounter(identity, filename string) *PersistentGCounter
- func NewPersistentGCounterWithSink(identity, filename string, sink GCounterStateSink) *PersistentGCounter
- func NewPersistentGCounterWithSinkAndObserver(identity, filename string, sink GCounterStateSink, observer CounterObserver) *PersistentGCounter
- func (c *PersistentGCounter) GetState() GCounterState
- func (c *PersistentGCounter) Increment()
- func (c *PersistentGCounter) IncrementFromActor(anotherActor phony.Actor)
- func (c *PersistentGCounter) MergeWith(other GCounterStateSource)
- func (c *PersistentGCounter) PersistSync()
- func (c *PersistentGCounter) Value() int64
- type QueryableCounter
- type ValueSource
- type ZmqMultiGcounter
- func NewObservableZmqMultiGcounter(identity, dirname, bindAddr string, observer CounterObserver) *ZmqMultiGcounter
- func NewObservableZmqMultiGcounterInCluster(identity, dirname string, cluster zmqcluster.Cluster, observer CounterObserver) *ZmqMultiGcounter
- func NewZmqMultiGcounter(identity, dirname, bindAddr string) *ZmqMultiGcounter
- func NewZmqMultiGcounterInCluster(identity, dirname string, cluster zmqcluster.Cluster) *ZmqMultiGcounter
- func (c *ZmqMultiGcounter) GetCounter(name string) *PersistentGCounter
- func (z *ZmqMultiGcounter) Increment(name string)
- func (z *ZmqMultiGcounter) LoadAllSync() error
- func (c *ZmqMultiGcounter) MergeWith(other GCounterStateSource)
- func (z *ZmqMultiGcounter) OnMessage(identity []byte, message []byte)
- func (z *ZmqMultiGcounter) OnMessageSent(peer string, message []byte)
- func (z *ZmqMultiGcounter) OnNewPeerConnected(c zmqcluster.Cluster, peer string)
- func (c *ZmqMultiGcounter) PersistOneSync(name string)
- func (c *ZmqMultiGcounter) PersistSync()
- func (z *ZmqMultiGcounter) SetClusterObserver(o ClusterObserver)
- func (z *ZmqMultiGcounter) SetState(s GCounterState)
- func (z *ZmqMultiGcounter) ShouldPersistOnSignal()
- func (z *ZmqMultiGcounter) Start() error
- func (z *ZmqMultiGcounter) Stop()
- func (z *ZmqMultiGcounter) UpdatePeers(peers []string)
- func (c *ZmqMultiGcounter) Value(name string) int64
- type ZmqSingleGcounter
- func NewObservableZmqSingleGcounter(identity, filename, bindAddr string, observer CounterObserver) *ZmqSingleGcounter
- func NewZmqSingleGcounter(identity, filename, bindAddr string) *ZmqSingleGcounter
- func NewZmqSingleGcounterInCluster(identity, filename string, cluster zmqcluster.Cluster) *ZmqSingleGcounter
- func (z *ZmqSingleGcounter) Increment()
- func (c *ZmqSingleGcounter) MergeWith(other GCounterStateSource)
- func (z *ZmqSingleGcounter) OnMessage(_ []byte, message []byte)
- func (z *ZmqSingleGcounter) OnMessageSent(peer string, message []byte)
- func (z *ZmqSingleGcounter) OnNewPeerConnected(c zmqcluster.Cluster, peer string)
- func (c *ZmqSingleGcounter) PersistSync()
- func (z *ZmqSingleGcounter) SetState(s GCounterState)
- func (z *ZmqSingleGcounter) Start() error
- func (z *ZmqSingleGcounter) Stop()
- func (z *ZmqSingleGcounter) UpdatePeers(peers []string)
- func (c *ZmqSingleGcounter) Value() int64
Constants ¶
View Source
const GCounterNetworkMessage = "g-counter.network.message"
View Source
const MyIPKey = "my_ip"
View Source
const MyTcpPortKey = "my_tcp_port"
View Source
const PeerHelloNetworkMessage = "peer.hello.network.message"
View Source
const PeerOhaiNetworkMessage = "peer.ohai.network.message"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncGCounter ¶
func NewAsyncGCounter ¶
func NewAsyncGCounter(identity string) *AsyncGCounter
func NewAsyncGCounterWithSink ¶
func NewAsyncGCounterWithSink(identity string, sink GCounterStateSink) *AsyncGCounter
func NewAsyncGCounterWithSinkFromState ¶
func NewAsyncGCounterWithSinkFromState(identity string, state GCounterState, sink GCounterStateSink) *AsyncGCounter
func (*AsyncGCounter) GetState ¶
func (c *AsyncGCounter) GetState() GCounterState
func (*AsyncGCounter) Increment ¶
func (c *AsyncGCounter) Increment()
func (*AsyncGCounter) MergeWith ¶
func (c *AsyncGCounter) MergeWith(other GCounterStateSource)
func (*AsyncGCounter) Value ¶
func (c *AsyncGCounter) Value() int64
type ClusterObserver ¶ added in v0.0.12
type CountEvent ¶ added in v0.0.6
type CounterObserver ¶ added in v0.0.3
type CounterObserver interface {
OnNewCount(ev CountEvent)
}
type EmergencyPersistence ¶ added in v0.0.12
type EmergencyPersistence struct {
// contains filtered or unexported fields
}
func GlobalEmergencyPersistence ¶ added in v0.0.12
func GlobalEmergencyPersistence() *EmergencyPersistence
func (*EmergencyPersistence) AddForPersistence ¶ added in v0.0.12
func (s *EmergencyPersistence) AddForPersistence(p Persistent)
func (*EmergencyPersistence) Init ¶ added in v0.0.12
func (s *EmergencyPersistence) Init()
func (*EmergencyPersistence) PersistAndExitOnSignal ¶ added in v0.0.12
func (s *EmergencyPersistence) PersistAndExitOnSignal()
type GCounter ¶
type GCounter struct {
// contains filtered or unexported fields
}
func NewGCounter ¶
func NewGCounterFromState ¶
func NewGCounterFromState(identity string, state GCounterState) *GCounter
func (*GCounter) GetState ¶
func (c *GCounter) GetState() GCounterState
func (*GCounter) MergeWith ¶
func (c *GCounter) MergeWith(other GCounterStateSource)
type GCounterState ¶
func NewGcounterState ¶
func NewGcounterState() GCounterState
func NewNamedGcounterState ¶ added in v0.0.5
func NewNamedGcounterState(name string) GCounterState
func (GCounterState) Copy ¶ added in v0.0.7
func (s GCounterState) Copy() GCounterState
type GCounterStateSink ¶
type GCounterStateSink interface {
SetState(s GCounterState)
}
type GCounterStateSource ¶
type GCounterStateSource interface {
GetState() GCounterState
}
type Incrementable ¶ added in v0.0.2
type Incrementable interface {
Increment()
}
type NetworkedGCounterState ¶ added in v0.0.12
type Persistent ¶ added in v0.0.12
type Persistent interface {
PersistSync()
}
type PersistentGCounter ¶
func NewPersistentGCounter ¶
func NewPersistentGCounter(identity, filename string) *PersistentGCounter
func NewPersistentGCounterWithSink ¶
func NewPersistentGCounterWithSink(identity, filename string, sink GCounterStateSink) *PersistentGCounter
func NewPersistentGCounterWithSinkAndObserver ¶ added in v0.0.3
func NewPersistentGCounterWithSinkAndObserver(identity, filename string, sink GCounterStateSink, observer CounterObserver) *PersistentGCounter
func (*PersistentGCounter) GetState ¶
func (c *PersistentGCounter) GetState() GCounterState
func (*PersistentGCounter) Increment ¶
func (c *PersistentGCounter) Increment()
func (*PersistentGCounter) IncrementFromActor ¶ added in v0.0.7
func (c *PersistentGCounter) IncrementFromActor(anotherActor phony.Actor)
func (*PersistentGCounter) MergeWith ¶
func (c *PersistentGCounter) MergeWith(other GCounterStateSource)
func (*PersistentGCounter) PersistSync ¶
func (c *PersistentGCounter) PersistSync()
func (*PersistentGCounter) Value ¶
func (c *PersistentGCounter) Value() int64
type QueryableCounter ¶ added in v0.0.2
type QueryableCounter interface { Incrementable ValueSource }
type ValueSource ¶
type ValueSource interface {
Value() int64
}
type ZmqMultiGcounter ¶ added in v0.0.5
func NewObservableZmqMultiGcounter ¶ added in v0.0.5
func NewObservableZmqMultiGcounter(identity, dirname, bindAddr string, observer CounterObserver) *ZmqMultiGcounter
func NewObservableZmqMultiGcounterInCluster ¶ added in v0.0.7
func NewObservableZmqMultiGcounterInCluster(identity, dirname string, cluster zmqcluster.Cluster, observer CounterObserver) *ZmqMultiGcounter
func NewZmqMultiGcounter ¶ added in v0.0.5
func NewZmqMultiGcounter(identity, dirname, bindAddr string) *ZmqMultiGcounter
func NewZmqMultiGcounterInCluster ¶ added in v0.0.7
func NewZmqMultiGcounterInCluster(identity, dirname string, cluster zmqcluster.Cluster) *ZmqMultiGcounter
func (*ZmqMultiGcounter) GetCounter ¶ added in v0.0.5
func (c *ZmqMultiGcounter) GetCounter(name string) *PersistentGCounter
func (*ZmqMultiGcounter) Increment ¶ added in v0.0.5
func (z *ZmqMultiGcounter) Increment(name string)
func (*ZmqMultiGcounter) LoadAllSync ¶ added in v0.0.11
func (z *ZmqMultiGcounter) LoadAllSync() error
func (*ZmqMultiGcounter) MergeWith ¶ added in v0.0.5
func (c *ZmqMultiGcounter) MergeWith(other GCounterStateSource)
func (*ZmqMultiGcounter) OnMessage ¶ added in v0.0.7
func (z *ZmqMultiGcounter) OnMessage(identity []byte, message []byte)
func (*ZmqMultiGcounter) OnMessageSent ¶ added in v0.0.26
func (z *ZmqMultiGcounter) OnMessageSent(peer string, message []byte)
func (*ZmqMultiGcounter) OnNewPeerConnected ¶ added in v0.0.7
func (z *ZmqMultiGcounter) OnNewPeerConnected(c zmqcluster.Cluster, peer string)
func (*ZmqMultiGcounter) PersistOneSync ¶ added in v0.0.5
func (c *ZmqMultiGcounter) PersistOneSync(name string)
func (*ZmqMultiGcounter) PersistSync ¶ added in v0.0.5
func (c *ZmqMultiGcounter) PersistSync()
func (*ZmqMultiGcounter) SetClusterObserver ¶ added in v0.0.12
func (z *ZmqMultiGcounter) SetClusterObserver(o ClusterObserver)
func (*ZmqMultiGcounter) SetState ¶ added in v0.0.5
func (z *ZmqMultiGcounter) SetState(s GCounterState)
callback once the inner counter state is changed
func (*ZmqMultiGcounter) ShouldPersistOnSignal ¶ added in v0.0.14
func (z *ZmqMultiGcounter) ShouldPersistOnSignal()
func (*ZmqMultiGcounter) Start ¶ added in v0.0.5
func (z *ZmqMultiGcounter) Start() error
func (*ZmqMultiGcounter) Stop ¶ added in v0.0.5
func (z *ZmqMultiGcounter) Stop()
func (*ZmqMultiGcounter) UpdatePeers ¶ added in v0.0.5
func (z *ZmqMultiGcounter) UpdatePeers(peers []string)
func (*ZmqMultiGcounter) Value ¶ added in v0.0.5
func (c *ZmqMultiGcounter) Value(name string) int64
type ZmqSingleGcounter ¶
func NewObservableZmqSingleGcounter ¶ added in v0.0.4
func NewObservableZmqSingleGcounter(identity, filename, bindAddr string, observer CounterObserver) *ZmqSingleGcounter
func NewZmqSingleGcounter ¶
func NewZmqSingleGcounter(identity, filename, bindAddr string) *ZmqSingleGcounter
func NewZmqSingleGcounterInCluster ¶ added in v0.0.7
func NewZmqSingleGcounterInCluster(identity, filename string, cluster zmqcluster.Cluster) *ZmqSingleGcounter
func (*ZmqSingleGcounter) Increment ¶
func (z *ZmqSingleGcounter) Increment()
func (*ZmqSingleGcounter) MergeWith ¶
func (c *ZmqSingleGcounter) MergeWith(other GCounterStateSource)
func (*ZmqSingleGcounter) OnMessage ¶ added in v0.0.7
func (z *ZmqSingleGcounter) OnMessage(_ []byte, message []byte)
func (*ZmqSingleGcounter) OnMessageSent ¶ added in v0.0.26
func (z *ZmqSingleGcounter) OnMessageSent(peer string, message []byte)
func (*ZmqSingleGcounter) OnNewPeerConnected ¶ added in v0.0.7
func (z *ZmqSingleGcounter) OnNewPeerConnected(c zmqcluster.Cluster, peer string)
func (*ZmqSingleGcounter) PersistSync ¶
func (c *ZmqSingleGcounter) PersistSync()
func (*ZmqSingleGcounter) SetState ¶
func (z *ZmqSingleGcounter) SetState(s GCounterState)
callback once the inner counter state is changed
func (*ZmqSingleGcounter) Start ¶
func (z *ZmqSingleGcounter) Start() error
func (*ZmqSingleGcounter) Stop ¶
func (z *ZmqSingleGcounter) Stop()
func (*ZmqSingleGcounter) UpdatePeers ¶
func (z *ZmqSingleGcounter) UpdatePeers(peers []string)
func (*ZmqSingleGcounter) Value ¶
func (c *ZmqSingleGcounter) Value() int64
Source Files
¶
Click to show internal directories.
Click to hide internal directories.