Documentation ¶ Index ¶ func Serve(ctx context.Context, reqs <-chan *Query) type Query func NewQuery(ip string) *Query type Response Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Serve ¶ func Serve(ctx context.Context, reqs <-chan *Query) Serve execute Queries and provide their answer as channel-in-channel. Cancel the given context to stop the clockwork. Use NewQuery to create the requests in a way to avoid goroutine leaks. The internal cache table evicts entries older than 12h. Types ¶ type Query ¶ type Query struct { IP string Response chan *Response } Query holds what's the target that the ipwhoisserver should investigate for country ownership. func NewQuery ¶ func NewQuery(ip string) *Query NewQuery creates the query that the server can use to execute queries and not leak goroutines. type Response ¶ type Response struct { Country string Err error Cached bool } Response to a Query asking what country is owner of a given IP. Source Files ¶ View all Source files server.go Click to show internal directories. Click to hide internal directories.