Documentation ¶
Index ¶
- Variables
- func IsEqual(f1, f2 *big.Rat) bool
- type Doorman
- func (w *Doorman) GenerateRandomProbabilityFromInteger(data uint64) *big.Rat
- func (w *Doorman) GetCase(choosenRandomPosition *big.Rat) uint
- func (w *Doorman) GetCaseFromData(data ...[]byte) uint
- func (w *Doorman) GetCaseFromString(data string) uint
- func (w *Doorman) GetRandomCase() uint
- func (w *Doorman) Hash(data ...[]byte) uint64
- func (w *Doorman) Length() int
- func (w *Doorman) NSQSubscriber(NSQLookupdURl string) error
- func (w *Doorman) NanoMsgSubscriber(NanoMsgUrlLookupdURl string) error
- func (w *Doorman) Subscriber(serverUrl string) error
- func (w *Doorman) Update(wu *shared.DoormanUpdater) error
- func (w *Doorman) UpdateHard(baseURL string) error
- func (w *Doorman) Validate() error
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
View Source
var ONE *big.Rat = big.NewRat(1, 1)
Functions ¶
Types ¶
type Doorman ¶
type Doorman struct { Id string // the id of the doorman LastChangeTimestamp int64 // an always increasing int that represent the last time the doorman has beed updated Probabilities []*big.Rat // The probability of each cases. The sum of probabilities needs to be one // contains filtered or unexported fields }
func (*Doorman) GenerateRandomProbabilityFromInteger ¶
func (*Doorman) GetCaseFromData ¶
func (*Doorman) GetCaseFromString ¶
func (*Doorman) GetRandomCase ¶
func (*Doorman) NSQSubscriber ¶
func (*Doorman) NanoMsgSubscriber ¶
func (*Doorman) Subscriber ¶
func (*Doorman) UpdateHard ¶
type Subscriber ¶
type Subscriber interface {
Subscribe(doormanId string, update shared.UpdateHandlerFunc) error
}
Click to show internal directories.
Click to hide internal directories.