예제 #1
0
func (us *TimedUserSet) AddUser(user config.User) error {
	id := user.ID()
	idx := len(us.validUsers)
	us.validUsers = append(us.validUsers, user)

	nowSec := time.Now().Unix()
	lastSec := nowSec - cacheDurationSec
	us.generateNewHashes(lastSec, nowSec+cacheDurationSec, idx, id)

	return nil
}
예제 #2
0
func (us *MockUserSet) AddUser(user config.User) error {
	us.UserIds = append(us.UserIds, user.ID())
	return nil
}