Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetenvDefault ¶
GetenvDefault returns an environment variable or the default value if it is empty.
func ReadFileFromAllSources ¶ added in v0.0.322
ReadFileFromAllSources reads a file from base64, http, https, and file sources.
Using options, you can disable individual loaders. For example, the following will return an error:
ReadFileFromAllSources("https://foo.bar/baz.txt", WithDisableHTTPLoader())
Possible formats are:
- file:///path/to/file - https://host.com/path/to/file - http://host.com/path/to/file - base64://<base64 encoded string>
For more options, check:
- WithDisableFileLoader - WithDisableHTTPLoader - WithDisableBase64Loader - WithBase64Encoding - WithHTTPClient
Types ¶
type Option ¶ added in v0.0.322
type Option func(o *options)
func WithBase64Encoding ¶ added in v0.0.322
WithBase64Encoding sets the base64 encoding.
func WithDisableBase64Loader ¶ added in v0.0.322
func WithDisableBase64Loader() Option
WithDisableBase64Loader disables the base64 loader.
func WithDisableFileLoader ¶ added in v0.0.322
func WithDisableFileLoader() Option
WithDisableFileLoader disables the file loader.
func WithDisableHTTPLoader ¶ added in v0.0.322
func WithDisableHTTPLoader() Option
WithDisableHTTPLoader disables the HTTP loader.
func WithHTTPClient ¶ added in v0.0.322
func WithHTTPClient(hc *retryablehttp.Client) Option
WithHTTPClient sets the HTTP client.