12 lines
188 B
Go
12 lines
188 B
Go
package inmemorycache
|
|
|
|
type Cache map[uint64][]string
|
|
|
|
func (c Cache) Get(id uint64) []string {
|
|
return c[id]
|
|
}
|
|
|
|
func (c Cache) Append(id uint64, ip string) {
|
|
c[id] = append(c[id], ip)
|
|
}
|