Documentation ¶
Index ¶
- func CSV(args ...string) [][]string
- func CSVByColumn(args ...string) (cols map[string][]string)
- func CSVByRow(args ...string) (rows []map[string]string)
- func JSON(in string) map[string]interface{}
- func JSONArray(in string) []interface{}
- func TOML(in string) interface{}
- func ToCSV(args ...interface{}) string
- func ToJSON(in interface{}) string
- func ToJSONPretty(indent string, in interface{}) string
- func ToTOML(in interface{}) string
- func ToYAML(in interface{}) string
- func YAML(in string) map[string]interface{}
- func YAMLArray(in string) []interface{}
- type AWSSMPGetter
- type Data
- func (d *Data) Cleanup()
- func (d *Data) Datasource(alias string, args ...string) (interface{}, error)
- func (d *Data) DatasourceExists(alias string) bool
- func (d *Data) DatasourceReachable(alias string, args ...string) bool
- func (d *Data) Include(alias string, args ...string) (string, error)
- func (d *Data) ReadSource(source *Source, args ...string) ([]byte, error)
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSV ¶
CSV - Unmarshal CSV parameters:
delim - (optional) the (single-character!) field delimiter, defaults to "," in - the CSV-format string to parse
returns:
an array of rows, which are arrays of cells (strings)
func CSVByColumn ¶
CSVByColumn - Unmarshal CSV in a Columnar form parameters:
delim - (optional) the (single-character!) field delimiter, defaults to "," hdr - (optional) comma-separated list of column names, set to "" to get auto-named columns (A-Z), omit to use the first line in - the CSV-format string to parse
returns:
a map of columns, indexed by the header name. values are arrays of strings
func CSVByRow ¶
CSVByRow - Unmarshal CSV in a row-oriented form parameters:
delim - (optional) the (single-character!) field delimiter, defaults to "," hdr - (optional) comma-separated list of column names, set to "" to get auto-named columns (A-Z), omit to use the first line in - the CSV-format string to parse
returns:
an array of rows, indexed by the header name
func ToJSONPretty ¶
ToJSONPretty - Stringify a struct as JSON (indented)
Types ¶
type AWSSMPGetter ¶
type AWSSMPGetter interface {
GetParameter(*ssm.GetParameterInput) (*ssm.GetParameterOutput, error)
}
AWSSMPGetter - A subset of SSM API for use in unit testing
type Data ¶
Data -
func (*Data) Cleanup ¶
func (d *Data) Cleanup()
Cleanup - clean up datasources before shutting the process down - things like Logging out happen here
func (*Data) Datasource ¶
Datasource -
func (*Data) DatasourceExists ¶
DatasourceExists -
func (*Data) DatasourceReachable ¶
DatasourceReachable - Determines if the named datasource is reachable with the given arguments. Reads from the datasource, and discards the returned data.
type Source ¶
type Source struct { Alias string URL *url.URL Ext string Type string Params map[string]string FS vfs.Filesystem // used for file: URLs, nil otherwise HC *http.Client // used for http[s]: URLs, nil otherwise VC *vault.Vault // used for vault: URLs, nil otherwise KV *libkv.LibKV // used for consul:, etcd:, zookeeper: & boltdb: URLs, nil otherwise ASMPG AWSSMPGetter // used for aws+smp:, nil otherwise Header http.Header // used for http[s]: URLs, nil otherwise }
Source - a data source
Click to show internal directories.
Click to hide internal directories.