| 59 | } |
| 60 | |
| 61 | type APIServer struct { |
| 62 | port uint16 |
| 63 | apiKeys []string |
| 64 | apiKeysMap map[string]bool |
| 65 | updaterState *UpdaterState |
| 66 | updates *Topic[Update] |
| 67 | mapData *MapData |
| 68 | listRecordsFunc func() ([]Record, error) |
| 69 | addrRateLimiter throttled.RateLimiter |
| 70 | apiKeyRateLimiter throttled.RateLimiter |
| 71 | staticDirFS fs.FS |
| 72 | } |
| 73 | |
| 74 | func CreateRateLimiter(perSec int, burst int) throttled.RateLimiter { |
| 75 | store, err := memstore.New(16384) |
nothing calls this directly
no outgoing calls
no test coverage detected