Commit 7fc9220c by lancet

node kind is now private

parent 93df9f43
...@@ -12,7 +12,7 @@ type Message struct { ...@@ -12,7 +12,7 @@ type Message struct {
// node - узел данных для очереди устаревания // node - узел данных для очереди устаревания
type node struct { type node struct {
Kind bool // 0 - таймаут, 1 - данные kind bool // 0 - таймаут, 1 - данные
Key string // Ключ Key string // Ключ
Value interface{} // Хранимое значение Value interface{} // Хранимое значение
Prev *node // Ближе к голове, извлекается раньше Prev *node // Ближе к голове, извлекается раньше
......
...@@ -34,7 +34,7 @@ func (store *Store) addNode(key string, value interface{}, kind bool) error { ...@@ -34,7 +34,7 @@ func (store *Store) addNode(key string, value interface{}, kind bool) error {
if store.tail != nil { if store.tail != nil {
prev = store.tail prev = store.tail
} }
store.tail = &node{Key: key, Value: value, Prev: prev, Kind: kind} store.tail = &node{Key: key, Value: value, Prev: prev, kind: kind}
if store.head == nil { if store.head == nil {
store.head = store.tail store.head = store.tail
} }
...@@ -68,7 +68,7 @@ func (store *Store) popNode() error { ...@@ -68,7 +68,7 @@ func (store *Store) popNode() error {
if store.head == nil { if store.head == nil {
return errors.New("No nodes") return errors.New("No nodes")
} }
if store.head.Kind == false { if store.head.kind == false {
err = errors.New("Decay timeout") err = errors.New("Decay timeout")
} }
if store.head.Key != "" { if store.head.Key != "" {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment