24 lines
318 B
Go
24 lines
318 B
Go
|
package manager
|
||
|
|
||
|
import (
|
||
|
"sync"
|
||
|
|
||
|
"github.com/patrickmn/go-cache"
|
||
|
)
|
||
|
|
||
|
type Manager struct {
|
||
|
// antiflood variables
|
||
|
cache *cache.Cache
|
||
|
|
||
|
// topic variables
|
||
|
topicStateLock sync.RWMutex
|
||
|
topicMap map[string]string
|
||
|
}
|
||
|
|
||
|
func NewManager() *Manager {
|
||
|
m := new(Manager)
|
||
|
m.initAntiflood()
|
||
|
m.initTopic()
|
||
|
return m
|
||
|
}
|