fetch

package
v0.0.0-...-e099475 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromConsulKV

func FromConsulKV(path string) ([]byte, format.Format, error)

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://:token@consul.example.com: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:password@consul.example.com:8200?dc=myDC&key=my_key

or

consulkvs-://:token@redis.example.com:8200?dc=myDC&key=/path/to/my/my_key

func FromConsulSR

func FromConsulSR(path string) ([]byte, format.Format, error)

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://:token@consul.example.com: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:password@consul.example.com:8200?dc=myDC&service=my_service&tag=my_tag&meta=my_key

or

consulsrs-://:token@redis.example.com:8200?dc=myDC&service=my_service&tag=my_tag&meta=my_key

func FromFile

func FromFile(path string) ([]byte, format.Format, error)

FromFile reads a Bundle from the file at the given path.

func FromHTTP

func FromHTTP(path string) ([]byte, format.Format, error)

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. If the URL has the "https-://" scheme, the certificate verification is skipped.

func FromRedis

func FromRedis(path string) ([]byte, format.Format, error)

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:password@redis.example.com:6379?db=5&key=my_key

or

rediss://redis.example.com:6379?db=3&key=/path/to/my/my_key

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL