package
0.0.0-20241220201044-13237acdf989
Repository: https://github.com/dihedron/netcheck.git
Documentation: pkg.go.dev
# Functions
FromConsulKV fetches a resource from a Consul key/value store; the URL must contain the scheme (consulkv://, "consulkvs://" for TLS API calls, or "consulkvs-://" to skip TLS certificate verification), optional authentication info either as basic HTTP auth (in the form consulkv://<username>:<password>@consul.example.com:8200) or as a token (in the form consulkv://:[email protected]:8201), the name of the host or its IP address and the optional port; the query string can specify a datacenter ("dc") and must specify the key under which the bundle is stored ("key"); all in all, the URL looks something like the following:
consulkv://username:[email protected]:8200?dc=myDC&key=my_key
or
consulkvs-://:[email protected]:8200?dc=myDC&key=/path/to/my/my_key.
FromConsulSR fetches a resource from a Consul service registry; the URL must contain the scheme (consulsr://, "consulsrs://" for TLS API calls, or "consulsrs-://" to skip TLS certificate verification), optional authentication info either as basic HTTP auth (in the form consulsr://<username>:<password>@consul.example.com:8200) or as a token (in the form consulsr://:[email protected]:8201), the name of the host or its IP address and the optional port; the query string can specify a datacenter ("dc") and must specify the service under which the bundle is stored ("service") and the name of the metadata key ("meta"), and can specify a tag ("tag"), provided the query only returns a single result; all in all, the URL looks something like the following:
consulsr://username:[email protected]:8200?dc=myDC&service=my_service&tag=my_tag&meta=my_key
or
consulsrs-://:[email protected]:8200?dc=myDC&service=my_service&tag=my_tag&meta=my_key.
FromFile reads a Bundle from the file at the given path.
FromHTTP retrieves a bundle from an HTTP URL; the server must set the Content-Type header correctly in order to give the right hint about which parser to use to read and analyse the checks bundle.
FromRedis fetches a resource from a Redis service; the URL must contain the scheme (one of redis:// and rediss://), optional authentication info (in the form redis://<username>:<password>@host:6379), the name of the host or its IP address and the optional port; the query string can specify a db (if not the default, which is assumed to be 0) and the key under which the bundle is stored; all in all, the URL looks something like the following:
redis://username:[email protected]:6379?db=5&key=my_key
or
rediss://redis.example.com:6379?db=3&key=/path/to/my/my_key.