Documentation ¶
Index ¶
- type ASNFinder
- type DNSTracker
- type IataFinder
- type MaxmindFinder
- type Server
- func (s *Server) Delete(rw http.ResponseWriter, req *http.Request)
- func (s *Server) List(rw http.ResponseWriter, req *http.Request)
- func (s *Server) Live(rw http.ResponseWriter, req *http.Request)
- func (s *Server) Lookup(rw http.ResponseWriter, req *http.Request)
- func (s *Server) Ready(rw http.ResponseWriter, req *http.Request)
- func (s *Server) Register(rw http.ResponseWriter, req *http.Request)
- func (s *Server) Reload(ctx context.Context)
- type ServiceAccountSecretManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DNSTracker ¶ added in v0.2.0
type IataFinder ¶
type IataFinder interface { Lookup(country string, lat, lon float64) (string, error) Find(iata string) (iata.Row, error) Load(ctx context.Context) error }
IataFinder is an interface used by the Server to manage IATA information.
type MaxmindFinder ¶
type MaxmindFinder interface { City(ip net.IP) (*geoip2.City, error) Reload(ctx context.Context) error }
MaxmindFinder is an interface used by the Server to manage Maxmind information.
type Server ¶
type Server struct { Project string Iata IataFinder Maxmind MaxmindFinder ASN ASNFinder DNS dnsiface.Service // contains filtered or unexported fields }
Server maintains shared state for the server.
func NewServer ¶
func NewServer(project string, finder IataFinder, maxmind MaxmindFinder, asn ASNFinder, ds dnsiface.Service, tracker DNSTracker, sm ServiceAccountSecretManager) *Server
NewServer creates a new Server instance for request handling.
func (*Server) Delete ¶
func (s *Server) Delete(rw http.ResponseWriter, req *http.Request)
Delete handler is used by operators to delete a previously registered hostname from DNS.
func (*Server) List ¶ added in v0.2.0
func (s *Server) List(rw http.ResponseWriter, req *http.Request)
List handler is used by monitoring to generate a list of known, active hostnames previously registered with the Autojoin API.
func (*Server) Live ¶
func (s *Server) Live(rw http.ResponseWriter, req *http.Request)
Live reports whether the system is live.
func (*Server) Lookup ¶
func (s *Server) Lookup(rw http.ResponseWriter, req *http.Request)
Lookup is a handler used to find the nearest IATA given client IP or lat/lon metadata.
func (*Server) Ready ¶
func (s *Server) Ready(rw http.ResponseWriter, req *http.Request)
Ready reports whether the server is ready.