[
  {
    "path": "README.md",
    "content": "# journald-cloudwatch-logs\n\nThis small utility monitors the systemd journal, managed by `journald`, and writes journal entries into\n[AWS Cloudwatch Logs](https://aws.amazon.com/cloudwatch/details/#log-monitoring).\n\nThis program is an alternative to the AWS-provided logs agent. The official logs agent copies data from\non-disk text log files into Cloudwatch, while this utility reads directly from the systemd journal.\n\nThe journal event data is written to Cloudwatch Logs in JSON format, making it amenable to filtering\nusing the JSON filter syntax. Log records are translated to Cloudwatch JSON events using a\nstructure like the following:\n\n```js\n{\n    \"instanceId\": \"i-xxxxxxxx\",\n    \"pid\": 12354,\n    \"uid\": 0,\n    \"gid\": 0,\n    \"cmdName\": \"cron\",\n    \"exe\": \"/usr/sbin/cron\",\n    \"cmdLine\": \"/usr/sbin/CRON -f\",\n    \"systemdUnit\": \"cron.service\",\n    \"bootId\": \"fa58079c7a6d12345678b6ebf1234567\",\n    \"hostname\": \"ip-10-1-0-15\",\n    \"transport\": \"syslog\",\n    \"priority\": \"INFO\",\n    \"message\": \"pam_unix(cron:session): session opened for user root by (uid=0)\",\n    \"syslog\": {\n        \"facility\": 10,\n        \"ident\": \"CRON\",\n        \"pid\": 12354\n    },\n    \"kernel\": {}\n}\n```\n\nThe JSON-formatted log events could also be exported into an AWS ElasticSearch instance using the built-in\nsync mechanism, to obtain more elaborate filtering and query capabilities.\n\n## Installation\n\nIf you have a binary distribution, you just need to drop the executable file somewhere.\n\nThis tool assumes that it is running on an EC2 instance.\n\nThis tool uses `libsystemd` to access the journal. systemd-based distributions generally ship\nwith this already installed, but if yours doesn't you must manually install the library somehow before\nthis tool will work.\n\n## Configuration\n\nThis tool uses a small configuration file to set some values that are required for its operation.\nMost of the configuration values are optional and have default settings, but a couple are required.\n\nThe configuration file uses a syntax like this:\n\n```js\nlog_group = \"my-awesome-app\"\n\n// (you'll need to create this directory before starting the program)\nstate_file = \"/var/lib/journald-cloudwatch-logs/state\"\n```\n\nThe following configuration settings are supported:\n\n* `aws_region`: (Optional) The AWS region whose CloudWatch Logs API will be written to. If not provided,\n  this defaults to the region where the host EC2 instance is running.\n  \n* `ec2_instance_id`: (Optional) The id of the EC2 instance on which the tool is running. There is very\n  little reason to set this, since it will be automatically set to the id of the host EC2 instance.\n\n* `journal_dir`: (Optional) Override the directory where the systemd journal can be found. This is\n  useful in conjunction with remote log aggregation, to work with journals synced from other systems.\n  The default is to use the local system's journal.\n  \n* `log_group`: (Required) The name of the cloudwatch log group to write logs into. This log group must\n  be created before running the program.\n\n* `log_priority`: (Optional) The highest priority of the log messages to read (on a 0-7 scale). This defaults\n    to DEBUG (all messages). This has a behaviour similar to `journalctl -p <priority>`. At the moment, only\n    a single value can be specified, not a range. Possible values are: `0,1,2,3,4,5,6,7` or one of the corresponding\n    `\"emerg\", \"alert\", \"crit\", \"err\", \"warning\", \"notice\", \"info\", \"debug\"`.\n    When a single log level is specified, all messages with this log level or a lower (hence more important)\n    log level are read and pushed to CloudWatch. For more information about priority levels, look at\n    https://www.freedesktop.org/software/systemd/man/journalctl.html\n\n* `log_stream`: (Optional) The name of the cloudwatch log stream to write logs into. This defaults to\n  the EC2 instance id. Each running instance of this application (along with any other applications\n  writing logs into the same log group) must have a unique `log_stream` value. If the given log stream\n  doesn't exist then it will be created before writing the first set of journal events.\n  \n* `state_file`: (Required) Path to a location where the program can write, and later read, some\n  state it needs to preserve between runs. (The format of this file is an implementation detail.)\n  \n* `buffer_size`: (Optional) The size of the local event buffer where journal events will be kept\n  in order to write batches of events to the CloudWatch Logs API. The default is 100. A batch of\n  new events will be written to CloudWatch Logs every second even if the buffer does not fill, but\n  this setting provides a maximum batch size to use when clearing a large backlog of events, e.g.\n  from system boot when the program starts for the first time.\n\nAdditionally values in the configuration file can contain variable expansions of the form\n${instance.<key>} which will be exapnded from the AWS Instance Identity Document or ${env.<name>}\nwhich will be expanded from the operating system environment variables, if a key does not exist\nit expands to the empty string.\n\nAt the time of writing, in early 2017, the supported InstanceIdentityDocument variables are:\n\n* `${instance.AvailabilityZone}`: The name of the availability zone the instance is running, eg `ap-southeast-2b`\n* `${instance.PrivateIP}`: The AWS internal private IP address of the instance, eg `172.1.2.3`\n* `${instance.Version}`: The version of the InstanceIdentityDocument definition?, eg `2010-08-31`\n* `${instance.Region}`: The name of the region the instance is running in, eg `ap-southeast-2`\n* `${instance.InstanceID}`: The instance identifier, eg `i-0123456789abcdef0`\n* `${instance.InstanceType}`: The type of the instance, eg `x1.32xlarge`\n* `${instance.AccountID}`: The amazon web services account the instance is running under, eg `098765432123`\n* `${instance.ImageID}`: The AMI (image) id the instance was launched from, eg `ami-a1b2c3d4`\n* `${instance.KernelID}`: The kernel ID used to launch the instance (PV instances only)\n* `${instance.RamdiskID}`: The ramdisk ID used to launch the instance (PV instances only)\n* `${instance.Architecture}`: The CPU architecture of the instance, eg `x86_64`\n  \n### AWS API access\n\nThis program requires access to call some of the Cloudwatch API functions. The recommended way to\nachieve this is to create an\n[IAM Instance Profile](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html)\nthat grants your EC2 instance a role that has Cloudwatch API access. The program will automatically\ndiscover and make use of instance profile credentials.\n\nThe following IAM policy grants the required access across all log groups in all regions:\n\n```js\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"logs:CreateLogStream\",\n                \"logs:PutLogEvents\",\n                \"logs:DescribeLogStreams\"\n            ],\n            \"Resource\": [\n                \"arn:aws:logs:*:*:log-group:*\",\n                \"arn:aws:logs:*:*:log-group:*:log-stream:*\"\n            ]\n        }\n    ]\n}\n```\n\nIn more complex environments you may want to restrict further which regions, groups and streams\nthe instance can write to. You can do this by adjusting the two ARN strings in the `\"Resource\"` section:\n\n* The first `*` in each string can be replaced with an AWS region name like `us-east-1`\n  to grant access only within the given region.\n* The `*` after `log-group` in each string can be replaced with a Cloudwatch Logs log group name\n  to grant access only to the named group.\n* The `*` after `log-stream` in the second string can be replaced with a Cloudwatch Logs log stream\n  name to grant access only to the named stream.\n\nOther combinations are possible too. For more information, see\n[the reference on ARNs and namespaces](http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-cloudwatch-logs).\n\n\n\n### Coexisting with the official Cloudwatch Logs agent\n\nThis application can run on the same host as the official Cloudwatch Logs agent but care must be taken\nto ensure that they each use a different log stream name. Only one process may write into each log\nstream.\n\n## Running on System Boot\n\nThis program is best used as a persistent service that starts on boot and keeps running until the\nsystem is shut down. If you're using `journald` then you're presumably using systemd; you can create\na systemd unit for this service. For example:\n\n```\n[Unit]\nDescription=journald-cloudwatch-logs\nWants=basic.target\nAfter=basic.target network.target\n\n[Service]\nUser=nobody\nGroup=nobody\nExecStart=/usr/local/bin/journald-cloudwatch-logs /usr/local/etc/journald-cloudwatch-logs.conf\nKillMode=process\nRestart=on-failure\nRestartSec=42s\n```\n\nThis program is designed under the assumption that it will run constantly from some point during\nsystem boot until the system shuts down.\n\nIf the service is stopped while the system is running and then later started again, it will\n\"lose\" any journal entries that were written while it wasn't running. However, on the initial\nrun after each boot it will clear the backlog of logs created during the boot process, so it\nis not necessary to run the program particularly early in the boot process unless you wish\nto *promptly* capture startup messages.\n\n## Licence\n\nCopyright (c) 2015 Say Media Inc\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "config.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\tawsCredentials \"github.com/aws/aws-sdk-go/aws/credentials\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds\"\n\t\"github.com/aws/aws-sdk-go/aws/ec2metadata\"\n\tawsSession \"github.com/aws/aws-sdk-go/aws/session\"\n\n\t\"github.com/hashicorp/hcl\"\n)\n\ntype Config struct {\n\tAWSCredentials *awsCredentials.Credentials\n\tAWSRegion      string\n\tEC2InstanceId  string\n\tLogGroupName   string\n\tLogStreamName  string\n\tLogPriority    Priority\n\tStateFilename  string\n\tJournalDir     string\n\tBufferSize     int\n}\n\ntype fileConfig struct {\n\tAWSRegion     string `hcl:\"aws_region\"`\n\tEC2InstanceId string `hcl:\"ec2_instance_id\"`\n\tLogGroupName  string `hcl:\"log_group\"`\n\tLogStreamName string `hcl:\"log_stream\"`\n\tLogPriority   string `hcl:\"log_priority\"`\n\tStateFilename string `hcl:\"state_file\"`\n\tJournalDir    string `hcl:\"journal_dir\"`\n\tBufferSize    int    `hcl:\"buffer_size\"`\n}\n\nfunc getLogLevel(priority string) (Priority, error) {\n\n\tlogLevels := map[Priority][]string{\n\t\tEMERGENCY: {\"0\", \"emerg\"},\n\t\tALERT:     {\"1\", \"alert\"},\n\t\tCRITICAL:  {\"2\", \"crit\"},\n\t\tERROR:     {\"3\", \"err\"},\n\t\tWARNING:   {\"4\", \"warning\"},\n\t\tNOTICE:    {\"5\", \"notice\"},\n\t\tINFO:      {\"6\", \"info\"},\n\t\tDEBUG:     {\"7\", \"debug\"},\n\t}\n\n\tfor i, s := range logLevels {\n\t\tif s[0] == priority || s[1] == priority {\n\t\t\treturn i, nil\n\t\t}\n\t}\n\n\treturn DEBUG, fmt.Errorf(\"'%s' is unsupported log priority\", priority)\n}\n\nfunc LoadConfig(filename string) (*Config, error) {\n\tconfigBytes, err := ioutil.ReadFile(filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar fConfig fileConfig\n\terr = hcl.Decode(&fConfig, string(configBytes))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif fConfig.LogGroupName == \"\" {\n\t\treturn nil, fmt.Errorf(\"log_group is required\")\n\t}\n\tif fConfig.StateFilename == \"\" {\n\t\treturn nil, fmt.Errorf(\"state_file is required\")\n\t}\n\n\tmetaClient := ec2metadata.New(awsSession.New(&aws.Config{}))\n\n\texpandFileConfig(&fConfig, metaClient)\n\n\tconfig := &Config{}\n\n\tif fConfig.AWSRegion != \"\" {\n\t\tconfig.AWSRegion = fConfig.AWSRegion\n\t} else {\n\t\tregion, err := metaClient.Region()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to detect AWS region: %s\", err)\n\t\t}\n\t\tconfig.AWSRegion = region\n\t}\n\n\tif fConfig.EC2InstanceId != \"\" {\n\t\tconfig.EC2InstanceId = fConfig.EC2InstanceId\n\t} else {\n\t\tinstanceId, err := metaClient.GetMetadata(\"instance-id\")\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to detect EC2 instance id: %s\", err)\n\t\t}\n\t\tconfig.EC2InstanceId = instanceId\n\t}\n\n\tif fConfig.LogPriority == \"\" {\n\t\t// Log everything\n\t\tconfig.LogPriority = DEBUG\n\t} else {\n\t\tconfig.LogPriority, err = getLogLevel(fConfig.LogPriority)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"The provided log filtering '%s' is unsupported by systemd!\", fConfig.LogPriority)\n\t\t}\n\t}\n\n\tconfig.LogGroupName = fConfig.LogGroupName\n\n\tif fConfig.LogStreamName != \"\" {\n\t\tconfig.LogStreamName = fConfig.LogStreamName\n\t} else {\n\t\t// By default we use the instance id as the stream name.\n\t\tconfig.LogStreamName = config.EC2InstanceId\n\t}\n\n\tconfig.StateFilename = fConfig.StateFilename\n\tconfig.JournalDir = fConfig.JournalDir\n\n\tif fConfig.BufferSize != 0 {\n\t\tconfig.BufferSize = fConfig.BufferSize\n\t} else {\n\t\tconfig.BufferSize = 100\n\t}\n\n\tconfig.AWSCredentials = awsCredentials.NewChainCredentials([]awsCredentials.Provider{\n\t\t&awsCredentials.EnvProvider{},\n\t\t&ec2rolecreds.EC2RoleProvider{\n\t\t\tClient: metaClient,\n\t\t},\n\t})\n\n\treturn config, nil\n}\n\nfunc (c *Config) NewAWSSession() *awsSession.Session {\n\tconfig := &aws.Config{\n\t\tCredentials: c.AWSCredentials,\n\t\tRegion:      aws.String(c.AWSRegion),\n\t\tMaxRetries:  aws.Int(3),\n\t}\n\treturn awsSession.New(config)\n}\n\n\n/*\n * Expand variables of the form $Foo or ${Foo} in the user provided config\n * from the EC2Metadata Instance Identity Document\n * [ https://docs.aws.amazon.com/sdk-for-go/api/aws/ec2metadata/#EC2InstanceIdentityDocument ]\n * or the environment\n */\nfunc expandFileConfig(config *fileConfig, metaClient *ec2metadata.EC2Metadata) {\n\tvars := make(map[string]string)\n\n\t// If we can fetch the InstanceIdentityDocument then iterate over the\n\t// struct extracting the string fields and their values into the vars map\n\tdata, err := metaClient.GetInstanceIdentityDocument()\n\tif err == nil {\n\t\tmetadata := reflect.ValueOf( data )\n\n\t\tfor i := 0; i < metadata.NumField(); i++ {\n\t\t\tfield := metadata.Field(i)\n\t\t\tftype := metadata.Type().Field(i)\n\t\t\tif (field.Type() != reflect.TypeOf(\"\")) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvars[ftype.Name] = fmt.Sprintf(\"%v\", field.Interface())\n\t\t}\n\t}\n\n\t// Iterate over all the string fields in the fileConfig struct performing\n\t// Variable expansion on them, with EC2 Instance Identity fields overriding\n\t// the OS environment\n\trconfig := reflect.ValueOf(config)\n\tfor i := 0; i < rconfig.Elem().NumField(); i++ {\n\t\tfield := rconfig.Elem().Field(i)\n\t\tif field.Type() != reflect.TypeOf(\"\") {\n\t\t\tcontinue\n\t\t}\n\t\tval := field.Interface().(string)\n\t\tif val != \"\" {\n\t\t\tfield.SetString(\n\t\t\t\texpandBraceVars(\n\t\t\t\t\tval,\n\t\t\t\t\tfunc(varname string) string {\n\t\t\t\t\t\tif strings.HasPrefix(varname, \"instance.\") {\n\t\t\t\t\t\t\tif val, exists := vars[strings.TrimPrefix(varname, \"instance.\")]; exists {\n\t\t\t\t\t\t\t\treturn val\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Unknown key => empty string\n\t\t\t\t\t\t\treturn \"\" \n\t\t\t\t\t\t} else if (strings.HasPrefix(varname, \"env.\")) {\n\t\t\t\t\t\t\treturn os.Getenv(strings.TrimPrefix(varname, \"env.\"))\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Unknown prefix => empty string\n\t\t\t\t\t\t\treturn \"\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n}\n\n\n// Modified version of os.Expand() that only expands ${name} and not $name\nfunc expandBraceVars(s string, mapping func(string) string) string {\n\tbuf := make([]byte, 0, 2*len(s))\n\t// ${} is all ASCII, so bytes are fine for this operation.\n\ti := 0\n\tfor j := 0; j < len(s); j++ {\n\t\tif s[j] == '$' && j+3 < len(s) && s[j+1] == '{' {\n\t\t\tbuf = append(buf, s[i:j]...)\n\t\t\tidx := strings.Index(s[j+2:], \"}\")\n\t\t\tif (idx >= 0) {\n\t\t\t\t// We have a full ${name} string\n\t\t\t\tbuf = append(buf, mapping(s[j+2:j+2+idx])...)\n\t\t\t\tj += 2+idx\n\t\t\t} else {\n\t\t\t\t// We ran out of string (unclosed ${)\n\t\t\t\treturn string(buf)\n\t\t\t}\n\t\t\ti = j + 1\n\t\t}\n\t}\n\treturn string(buf) + s[i:]\n}\n\n\n\n"
  },
  {
    "path": "journal.go",
    "content": "package main\n\nimport (\n\t\"github.com/coreos/go-systemd/sdjournal\"\n\t\"strconv\"\n)\n\nfunc AddLogFilters(journal *sdjournal.Journal, config *Config) {\n\n\t// Add Priority Filters\n\tif config.LogPriority < DEBUG {\n\t\tfor p, _ := range PriorityJSON {\n\t\t\tif p <= config.LogPriority {\n\t\t\t\tjournal.AddMatch(\"PRIORITY=\" + strconv.Itoa(int(p)))\n\t\t\t}\n\t\t}\n\t\tjournal.AddDisjunction()\n\t}\n}\n"
  },
  {
    "path": "main.go",
    "content": "package main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/coreos/go-systemd/sdjournal\"\n)\n\nvar help = flag.Bool(\"help\", false, \"set to true to show this help\")\n\nfunc main() {\n\tflag.Parse()\n\n\tif *help {\n\t\tusage()\n\t\tos.Exit(0)\n\t}\n\n\tconfigFilename := flag.Arg(0)\n\tif configFilename == \"\" {\n\t\tusage()\n\t\tos.Exit(1)\n\t}\n\n\terr := run(configFilename)\n\tif err != nil {\n\t\tos.Stderr.WriteString(err.Error())\n\t\tos.Stderr.Write([]byte{'\\n'})\n\t\tos.Exit(2)\n\t}\n}\n\nfunc usage() {\n\tos.Stderr.WriteString(\"Usage: journald-cloudwatch-logs <config-file>\\n\\n\")\n\tflag.PrintDefaults()\n\tos.Stderr.WriteString(\"\\n\")\n}\n\nfunc run(configFilename string) error {\n\tconfig, err := LoadConfig(configFilename)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error reading config: %s\", err)\n\t}\n\n\tvar journal *sdjournal.Journal\n\tif config.JournalDir == \"\" {\n\t\tjournal, err = sdjournal.NewJournal()\n\t} else {\n\t\tlog.Printf(\"using journal dir: %s\", config.JournalDir)\n\t\tjournal, err = sdjournal.NewJournalFromDir(config.JournalDir)\n\t}\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error opening journal: %s\", err)\n\t}\n\tdefer journal.Close()\n\n\tAddLogFilters(journal, config)\n\n\tstate, err := OpenState(config.StateFilename)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to open %s: %s\", config.StateFilename, err)\n\t}\n\n\tlastBootId, nextSeq := state.LastState()\n\n\tawsSession := config.NewAWSSession()\n\n\twriter, err := NewWriter(\n\t\tawsSession,\n\t\tconfig.LogGroupName,\n\t\tconfig.LogStreamName,\n\t\tnextSeq,\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error initializing writer: %s\", err)\n\t}\n\n\tseeked, err := journal.Next()\n\tif seeked == 0 || err != nil {\n\t\treturn fmt.Errorf(\"unable to seek to first item in journal\")\n\t}\n\n\tbootId, err := journal.GetData(\"_BOOT_ID\")\n\tbootId = bootId[9:] // Trim off \"_BOOT_ID=\" prefix\n\n\t// If the boot id has changed since our last run then we'll start from\n\t// the beginning of the stream, but if we're starting up with the same\n\t// boot id then we'll seek to the end of the stream to avoid repeating\n\t// anything. However, we will miss any items that were added while we\n\t// weren't running.\n\tskip := uint64(0)\n\tif bootId == lastBootId {\n\t\t// If we're still in the same \"boot\" as we were last time then\n\t\t// we were stopped and started again, so we'll seek to the last\n\t\t// item in the log as an approximation of resuming streaming,\n\t\t// though we will miss any logs that were added while we were\n\t\t// running.\n\t\tjournal.SeekTail()\n\t\t// Skip the last item so our log will resume only when we get\n\t\t// the *next item.\n\t\tskip = 1\n\t}\n\n\terr = state.SetState(bootId, nextSeq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to write state: %s\", err)\n\t}\n\n\tbufSize := config.BufferSize\n\n\trecords := make(chan Record)\n\tbatches := make(chan []Record)\n\n\tgo ReadRecords(config.EC2InstanceId, journal, records, skip)\n\tgo BatchRecords(records, batches, bufSize)\n\n\tfor batch := range batches {\n\n\t\tnextSeq, err = writer.WriteBatch(batch)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to write to cloudwatch: %s\", err)\n\t\t}\n\n\t\terr = state.SetState(bootId, nextSeq)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to write state: %s\", err)\n\t\t}\n\n\t}\n\n\t// We fall out here when interrupted by a signal.\n\t// Last chance to write the state.\n\terr = state.SetState(bootId, nextSeq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to write state on exit: %s\", err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "reader.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/coreos/go-systemd/sdjournal\"\n)\n\nfunc ReadRecords(instanceId string, journal *sdjournal.Journal, c chan<- Record, skip uint64) {\n\trecord := &Record{}\n\n\ttermC := MakeTerminateChannel()\n\tcheckTerminate := func() bool {\n\t\tselect {\n\t\tcase <-termC:\n\t\t\tclose(c)\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\t}\n\n\tfor {\n\t\tif checkTerminate() {\n\t\t\treturn\n\t\t}\n\t\terr := UnmarshalRecord(journal, record)\n\t\tif err != nil {\n\t\t\tc <- synthRecord(\n\t\t\t\tfmt.Errorf(\"error unmarshalling record: %s\", err),\n\t\t\t)\n\t\t\tcontinue\n\t\t}\n\n\t\tif skip > 0 {\n\t\t\tskip--\n\t\t} else {\n\t\t\trecord.InstanceId = instanceId\n\t\t\tc <- *record\n\t\t}\n\n\t\tfor {\n\t\t\tif checkTerminate() {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tseeked, err := journal.Next()\n\t\t\tif err != nil {\n\t\t\t\tc <- synthRecord(\n\t\t\t\t\tfmt.Errorf(\"error reading from journal: %s\", err),\n\t\t\t\t)\n\t\t\t\t// It's likely that we didn't actually advance here, so\n\t\t\t\t// we should wait a bit so we don't spin the CPU at 100%\n\t\t\t\t// when we run into errors.\n\t\t\t\ttime.Sleep(2 * time.Second)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif seeked == 0 {\n\t\t\t\t// If there's nothing new in the stream then we'll\n\t\t\t\t// wait for something new to show up.\n\t\t\t\t// FIXME: We can actually end up waiting up to 2 seconds\n\t\t\t\t// to gracefully terminate because of this. It'd be nicer\n\t\t\t\t// to stop waiting if we get a termination signal, but\n\t\t\t\t// this will do for now.\n\t\t\t\tjournal.Wait(2 * time.Second)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// BatchRecords consumes a channel of individual records and produces\n// a channel of slices of record pointers in sizes up to the given\n// batch size.\n// If records don't show up fast enough, smaller batches will be returned\n// each second as long as at least one item is in the buffer.\nfunc BatchRecords(records <-chan Record, batches chan<- []Record, batchSize int) {\n\t// We have two buffers here so that we can fill one while the\n\t// caller is working on the other. The caller is therefore\n\t// guaranteed that the returned slice will remain valid until\n\t// the next read of the batches channel.\n\tvar bufs [2][]Record\n\tbufs[0] = make([]Record, batchSize)\n\tbufs[1] = make([]Record, batchSize)\n\tvar record Record\n\tvar more bool\n\tcurrentBuf := 0\n\tnext := 0\n\ttimer := time.NewTimer(time.Second)\n\ttimer.Stop()\n\n\tfor {\n\t\tselect {\n\t\tcase record, more = <-records:\n\t\t\tif !more {\n\t\t\t\tclose(batches)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tbufs[currentBuf][next] = record\n\t\t\tnext++\n\t\t\tif next < batchSize {\n\t\t\t\t// If we've just added our first record then we'll\n\t\t\t\t// start the batch timer.\n\t\t\t\tif next == 1 {\n\t\t\t\t\ttimer.Reset(time.Second)\n\t\t\t\t}\n\t\t\t\t// Not enough records yet, so wait again.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\tcase <-timer.C:\n\t\t\tbreak\n\t\t}\n\n\t\ttimer.Stop()\n\t\tif next == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\t// If we manage to fall out here then either the buffer is fuull\n\t\t// or the batch timer expired. Either way it's time for us to\n\t\t// emit a batch.\n\t\tbatches <- bufs[currentBuf][0:next]\n\n\t\t// Switch buffers before we start building the next batch.\n\t\tcurrentBuf = (currentBuf + 1) % 2\n\t\tnext = 0\n\t}\n}\n\n// synthRecord produces synthetic records to report errors, so that\n// we can stream our own errors directly into cloudwatch rather than\n// emitting them through journald and risking feedback loops.\nfunc synthRecord(err error) Record {\n\treturn Record{\n\t\tCommand:  \"journald-cloudwatch-logs\",\n\t\tPriority: ERROR,\n\t\tMessage:  err.Error(),\n\t}\n}\n"
  },
  {
    "path": "record.go",
    "content": "package main\n\ntype Priority int\n\nvar (\n\tEMERGENCY Priority = 0\n\tALERT     Priority = 1\n\tCRITICAL  Priority = 2\n\tERROR     Priority = 3\n\tWARNING   Priority = 4\n\tNOTICE    Priority = 5\n\tINFO      Priority = 6\n\tDEBUG     Priority = 7\n)\n\nvar PriorityJSON = map[Priority][]byte{\n\tEMERGENCY: []byte(\"\\\"EMERG\\\"\"),\n\tALERT:     []byte(\"\\\"ALERT\\\"\"),\n\tCRITICAL:  []byte(\"\\\"CRITICAL\\\"\"),\n\tERROR:     []byte(\"\\\"ERROR\\\"\"),\n\tWARNING:   []byte(\"\\\"WARNING\\\"\"),\n\tNOTICE:    []byte(\"\\\"NOTICE\\\"\"),\n\tINFO:      []byte(\"\\\"INFO\\\"\"),\n\tDEBUG:     []byte(\"\\\"DEBUG\\\"\"),\n}\n\ntype Record struct {\n\tInstanceId     string       `json:\"instanceId,omitempty\"`\n\tTimeUsec       int64        `json:\"-\"`\n\tPID            int          `json:\"pid\" journald:\"_PID\"`\n\tUID            int          `json:\"uid\" journald:\"_UID\"`\n\tGID            int          `json:\"gid\" journald:\"_GID\"`\n\tCommand        string       `json:\"cmdName,omitempty\" journald:\"_COMM\"`\n\tExecutable     string       `json:\"exe,omitempty\" journald:\"_EXE\"`\n\tCommandLine    string       `json:\"cmdLine,omitempty\" journald:\"_CMDLINE\"`\n\tSystemdUnit    string       `json:\"systemdUnit,omitempty\" journald:\"_SYSTEMD_UNIT\"`\n\tBootId         string       `json:\"bootId,omitempty\" journald:\"_BOOT_ID\"`\n\tMachineId      string       `json:\"machineId,omitempty\" journald:\"_MACHINE_ID\"`\n\tHostname       string       `json:\"hostname,omitempty\" journald:\"_HOSTNAME\"`\n\tTransport      string       `json:\"transport,omitempty\" journald:\"_TRANSPORT\"`\n\tPriority       Priority     `json:\"priority\" journald:\"PRIORITY\"`\n\tMessage        string       `json:\"message\" journald:\"MESSAGE\"`\n\tMessageId      string       `json:\"messageId,omitempty\" journald:\"MESSAGE_ID\"`\n\tErrno          int          `json:\"machineId,omitempty\" journald:\"ERRNO\"`\n\tSyslog         RecordSyslog `json:\"syslog,omitempty\"`\n\tKernel         RecordKernel `json:\"kernel,omitempty\"`\n\tContainer_Name string       `json:\"containerName,omitempty\" journald:\"CONTAINER_NAME\"`\n\tContainer_Tag  string       `json:\"containerTag,omitempty\" journald:\"CONTAINER_TAG\"`\n\tContainer_ID   string       `json:\"containerID,omitempty\" journald:\"CONTAINER_ID\"`\n}\n\ntype RecordSyslog struct {\n\tFacility   int    `json:\"facility,omitempty\" journald:\"SYSLOG_FACILITY\"`\n\tIdentifier string `json:\"ident,omitempty\" journald:\"SYSLOG_IDENTIFIER\"`\n\tPID        int    `json:\"pid,omitempty\" journald:\"SYSLOG_PID\"`\n}\n\ntype RecordKernel struct {\n\tDevice    string `json:\"device,omitempty\" journald:\"_KERNEL_DEVICE\"`\n\tSubsystem string `json:\"subsystem,omitempty\" journald:\"_KERNEL_SUBSYSTEM\"`\n\tSysName   string `json:\"sysName,omitempty\" journald:\"_UDEV_SYSNAME\"`\n\tDevNode   string `json:\"devNode,omitempty\" journald:\"_UDEV_DEVNODE\"`\n}\n\nfunc (p Priority) MarshalJSON() ([]byte, error) {\n\treturn PriorityJSON[p], nil\n}\n"
  },
  {
    "path": "state.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nconst stateFormat = \"%s\\n%s\\n\"\nconst mapSize = 64\n\ntype State struct {\n\tfile *os.File\n}\n\nfunc OpenState(fn string) (State, error) {\n\ts := State{}\n\tf, err := os.OpenFile(fn, os.O_RDWR|os.O_CREATE, 0700)\n\tif err != nil {\n\t\treturn s, err\n\t}\n\ts.file = f\n\treturn s, nil\n}\n\nfunc (s State) Close() error {\n\treturn s.file.Close()\n}\n\nfunc (s State) Sync() error {\n\treturn s.file.Sync()\n}\n\nfunc (s State) LastState() (string, string) {\n\tvar bootId string\n\tvar seqToken string\n\t_, err := s.file.Seek(0, 0)\n\tif err != nil {\n\t\treturn \"\", \"\"\n\t}\n\tn, err := fmt.Fscanf(s.file, stateFormat, &bootId, &seqToken)\n\tif err != nil || n < 2 {\n\t\treturn \"\", \"\"\n\t}\n\treturn bootId, seqToken\n}\n\nfunc (s State) SetState(bootId, seqToken string) error {\n\t_, err := s.file.Seek(0, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = fmt.Fprintf(s.file, stateFormat, bootId, seqToken)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "terminate.go",
    "content": "package main\n\nimport (\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n)\n\n// MakeTerminateChannel returns a channel that will become readable if\n// the process is interrupted or terminated via a signal.\n//\n// This is used to gracefully exit the reader loop, which in turn causes\n// the rest of the program to gracefully terminate, flushing any remaining\n// buffers and writing its persistent state to disk.\nfunc MakeTerminateChannel() <-chan os.Signal {\n\tch := make(chan os.Signal, 1)\n\tsignal.Notify(ch, syscall.SIGINT, syscall.SIGTERM)\n\treturn ch\n}\n"
  },
  {
    "path": "unmarshal.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/coreos/go-systemd/sdjournal\"\n)\n\nfunc UnmarshalRecord(journal *sdjournal.Journal, to *Record) error {\n\terr := unmarshalRecord(journal, reflect.ValueOf(to).Elem())\n\tif err == nil {\n\t\t// FIXME: Should use the realtime from the log record,\n\t\t// but for some reason journal.GetRealtimeUsec always fails.\n\t\tto.TimeUsec = time.Now().Unix() * 1000\n\t}\n\treturn err\n}\n\nfunc unmarshalRecord(journal *sdjournal.Journal, toVal reflect.Value) error {\n\ttoType := toVal.Type()\n\n\tnumField := toVal.NumField()\n\n\t// This intentionally supports only the few types we actually\n\t// use on the Record struct. It's not intended to be generic.\n\n\tfor i := 0; i < numField; i++ {\n\t\tfieldVal := toVal.Field(i)\n\t\tfieldDef := toType.Field(i)\n\t\tfieldType := fieldDef.Type\n\t\tfieldTag := fieldDef.Tag\n\t\tfieldTypeKind := fieldType.Kind()\n\n\t\tif fieldTypeKind == reflect.Struct {\n\t\t\t// Recursively unmarshal from the same journal\n\t\t\tunmarshalRecord(journal, fieldVal)\n\t\t}\n\n\t\tjdKey := fieldTag.Get(\"journald\")\n\t\tif jdKey == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tvalue, err := journal.GetData(jdKey)\n\t\tif err != nil || value == \"\" {\n\t\t\tfieldVal.Set(reflect.Zero(fieldType))\n\t\t\tcontinue\n\t\t}\n\n\t\t// The value is returned with the key and an equals sign on\n\t\t// the front, so we'll trim those off.\n\t\tvalue = value[len(jdKey)+1:]\n\n\t\tswitch fieldTypeKind {\n\t\tcase reflect.Int:\n\t\t\tintVal, err := strconv.Atoi(value)\n\t\t\tif err != nil {\n\t\t\t\t// Should never happen, but not much we can do here.\n\t\t\t\tfieldVal.Set(reflect.Zero(fieldType))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfieldVal.SetInt(int64(intVal))\n\t\t\tbreak\n\t\tcase reflect.String:\n\t\t\tfieldVal.SetString(value)\n\t\t\tbreak\n\t\tdefault:\n\t\t\t// Should never happen\n\t\t\tpanic(fmt.Errorf(\"Can't unmarshal to %s\", fieldType))\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/NOTICE.txt",
    "content": "AWS SDK for Go\nCopyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. \nCopyright 2014-2015 Stripe, Inc.\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go",
    "content": "// Package awserr represents API error interface accessors for the SDK.\npackage awserr\n\n// An Error wraps lower level errors with code, message and an original error.\n// The underlying concrete error type may also satisfy other interfaces which\n// can be to used to obtain more specific information about the error.\n//\n// Calling Error() or String() will always include the full information about\n// an error based on its underlying type.\n//\n// Example:\n//\n//     output, err := s3manage.Upload(svc, input, opts)\n//     if err != nil {\n//         if awsErr, ok := err.(awserr.Error); ok {\n//             // Get error details\n//             log.Println(\"Error:\", awsErr.Code(), awsErr.Message())\n//\n//             // Prints out full error message, including original error if there was one.\n//             log.Println(\"Error:\", awsErr.Error())\n//\n//             // Get original error\n//             if origErr := awsErr.OrigErr(); origErr != nil {\n//                 // operate on original error.\n//             }\n//         } else {\n//             fmt.Println(err.Error())\n//         }\n//     }\n//\ntype Error interface {\n\t// Satisfy the generic error interface.\n\terror\n\n\t// Returns the short phrase depicting the classification of the error.\n\tCode() string\n\n\t// Returns the error details message.\n\tMessage() string\n\n\t// Returns the original error if one was set.  Nil is returned if not set.\n\tOrigErr() error\n}\n\n// BatchError is a batch of errors which also wraps lower level errors with\n// code, message, and original errors. Calling Error() will include all errors\n// that occurred in the batch.\n//\n// Deprecated: Replaced with BatchedErrors. Only defined for backwards\n// compatibility.\ntype BatchError interface {\n\t// Satisfy the generic error interface.\n\terror\n\n\t// Returns the short phrase depicting the classification of the error.\n\tCode() string\n\n\t// Returns the error details message.\n\tMessage() string\n\n\t// Returns the original error if one was set.  Nil is returned if not set.\n\tOrigErrs() []error\n}\n\n// BatchedErrors is a batch of errors which also wraps lower level errors with\n// code, message, and original errors. Calling Error() will include all errors\n// that occurred in the batch.\n//\n// Replaces BatchError\ntype BatchedErrors interface {\n\t// Satisfy the base Error interface.\n\tError\n\n\t// Returns the original error if one was set.  Nil is returned if not set.\n\tOrigErrs() []error\n}\n\n// New returns an Error object described by the code, message, and origErr.\n//\n// If origErr satisfies the Error interface it will not be wrapped within a new\n// Error object and will instead be returned.\nfunc New(code, message string, origErr error) Error {\n\tvar errs []error\n\tif origErr != nil {\n\t\terrs = append(errs, origErr)\n\t}\n\treturn newBaseError(code, message, errs)\n}\n\n// NewBatchError returns an BatchedErrors with a collection of errors as an\n// array of errors.\nfunc NewBatchError(code, message string, errs []error) BatchedErrors {\n\treturn newBaseError(code, message, errs)\n}\n\n// A RequestFailure is an interface to extract request failure information from\n// an Error such as the request ID of the failed request returned by a service.\n// RequestFailures may not always have a requestID value if the request failed\n// prior to reaching the service such as a connection error.\n//\n// Example:\n//\n//     output, err := s3manage.Upload(svc, input, opts)\n//     if err != nil {\n//         if reqerr, ok := err.(RequestFailure); ok {\n//             log.Println(\"Request failed\", reqerr.Code(), reqerr.Message(), reqerr.RequestID())\n//         } else {\n//             log.Println(\"Error:\", err.Error())\n//         }\n//     }\n//\n// Combined with awserr.Error:\n//\n//    output, err := s3manage.Upload(svc, input, opts)\n//    if err != nil {\n//        if awsErr, ok := err.(awserr.Error); ok {\n//            // Generic AWS Error with Code, Message, and original error (if any)\n//            fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())\n//\n//            if reqErr, ok := err.(awserr.RequestFailure); ok {\n//                // A service error occurred\n//                fmt.Println(reqErr.StatusCode(), reqErr.RequestID())\n//            }\n//        } else {\n//            fmt.Println(err.Error())\n//        }\n//    }\n//\ntype RequestFailure interface {\n\tError\n\n\t// The status code of the HTTP response.\n\tStatusCode() int\n\n\t// The request ID returned by the service for a request failure. This will\n\t// be empty if no request ID is available such as the request failed due\n\t// to a connection error.\n\tRequestID() string\n}\n\n// NewRequestFailure returns a new request error wrapper for the given Error\n// provided.\nfunc NewRequestFailure(err Error, statusCode int, reqID string) RequestFailure {\n\treturn newRequestError(err, statusCode, reqID)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go",
    "content": "package awserr\n\nimport \"fmt\"\n\n// SprintError returns a string of the formatted error code.\n//\n// Both extra and origErr are optional.  If they are included their lines\n// will be added, but if they are not included their lines will be ignored.\nfunc SprintError(code, message, extra string, origErr error) string {\n\tmsg := fmt.Sprintf(\"%s: %s\", code, message)\n\tif extra != \"\" {\n\t\tmsg = fmt.Sprintf(\"%s\\n\\t%s\", msg, extra)\n\t}\n\tif origErr != nil {\n\t\tmsg = fmt.Sprintf(\"%s\\ncaused by: %s\", msg, origErr.Error())\n\t}\n\treturn msg\n}\n\n// A baseError wraps the code and message which defines an error. It also\n// can be used to wrap an original error object.\n//\n// Should be used as the root for errors satisfying the awserr.Error. Also\n// for any error which does not fit into a specific error wrapper type.\ntype baseError struct {\n\t// Classification of error\n\tcode string\n\n\t// Detailed information about error\n\tmessage string\n\n\t// Optional original error this error is based off of. Allows building\n\t// chained errors.\n\terrs []error\n}\n\n// newBaseError returns an error object for the code, message, and errors.\n//\n// code is a short no whitespace phrase depicting the classification of\n// the error that is being created.\n//\n// message is the free flow string containing detailed information about the\n// error.\n//\n// origErrs is the error objects which will be nested under the new errors to\n// be returned.\nfunc newBaseError(code, message string, origErrs []error) *baseError {\n\tb := &baseError{\n\t\tcode:    code,\n\t\tmessage: message,\n\t\terrs:    origErrs,\n\t}\n\n\treturn b\n}\n\n// Error returns the string representation of the error.\n//\n// See ErrorWithExtra for formatting.\n//\n// Satisfies the error interface.\nfunc (b baseError) Error() string {\n\tsize := len(b.errs)\n\tif size > 0 {\n\t\treturn SprintError(b.code, b.message, \"\", errorList(b.errs))\n\t}\n\n\treturn SprintError(b.code, b.message, \"\", nil)\n}\n\n// String returns the string representation of the error.\n// Alias for Error to satisfy the stringer interface.\nfunc (b baseError) String() string {\n\treturn b.Error()\n}\n\n// Code returns the short phrase depicting the classification of the error.\nfunc (b baseError) Code() string {\n\treturn b.code\n}\n\n// Message returns the error details message.\nfunc (b baseError) Message() string {\n\treturn b.message\n}\n\n// OrigErr returns the original error if one was set. Nil is returned if no\n// error was set. This only returns the first element in the list. If the full\n// list is needed, use BatchedErrors.\nfunc (b baseError) OrigErr() error {\n\tswitch len(b.errs) {\n\tcase 0:\n\t\treturn nil\n\tcase 1:\n\t\treturn b.errs[0]\n\tdefault:\n\t\tif err, ok := b.errs[0].(Error); ok {\n\t\t\treturn NewBatchError(err.Code(), err.Message(), b.errs[1:])\n\t\t}\n\t\treturn NewBatchError(\"BatchedErrors\",\n\t\t\t\"multiple errors occurred\", b.errs)\n\t}\n}\n\n// OrigErrs returns the original errors if one was set. An empty slice is\n// returned if no error was set.\nfunc (b baseError) OrigErrs() []error {\n\treturn b.errs\n}\n\n// So that the Error interface type can be included as an anonymous field\n// in the requestError struct and not conflict with the error.Error() method.\ntype awsError Error\n\n// A requestError wraps a request or service error.\n//\n// Composed of baseError for code, message, and original error.\ntype requestError struct {\n\tawsError\n\tstatusCode int\n\trequestID  string\n}\n\n// newRequestError returns a wrapped error with additional information for\n// request status code, and service requestID.\n//\n// Should be used to wrap all request which involve service requests. Even if\n// the request failed without a service response, but had an HTTP status code\n// that may be meaningful.\n//\n// Also wraps original errors via the baseError.\nfunc newRequestError(err Error, statusCode int, requestID string) *requestError {\n\treturn &requestError{\n\t\tawsError:   err,\n\t\tstatusCode: statusCode,\n\t\trequestID:  requestID,\n\t}\n}\n\n// Error returns the string representation of the error.\n// Satisfies the error interface.\nfunc (r requestError) Error() string {\n\textra := fmt.Sprintf(\"status code: %d, request id: %s\",\n\t\tr.statusCode, r.requestID)\n\treturn SprintError(r.Code(), r.Message(), extra, r.OrigErr())\n}\n\n// String returns the string representation of the error.\n// Alias for Error to satisfy the stringer interface.\nfunc (r requestError) String() string {\n\treturn r.Error()\n}\n\n// StatusCode returns the wrapped status code for the error\nfunc (r requestError) StatusCode() int {\n\treturn r.statusCode\n}\n\n// RequestID returns the wrapped requestID\nfunc (r requestError) RequestID() string {\n\treturn r.requestID\n}\n\n// OrigErrs returns the original errors if one was set. An empty slice is\n// returned if no error was set.\nfunc (r requestError) OrigErrs() []error {\n\tif b, ok := r.awsError.(BatchedErrors); ok {\n\t\treturn b.OrigErrs()\n\t}\n\treturn []error{r.OrigErr()}\n}\n\n// An error list that satisfies the golang interface\ntype errorList []error\n\n// Error returns the string representation of the error.\n//\n// Satisfies the error interface.\nfunc (e errorList) Error() string {\n\tmsg := \"\"\n\t// How do we want to handle the array size being zero\n\tif size := len(e); size > 0 {\n\t\tfor i := 0; i < size; i++ {\n\t\t\tmsg += fmt.Sprintf(\"%s\", e[i].Error())\n\t\t\t// We check the next index to see if it is within the slice.\n\t\t\t// If it is, then we append a newline. We do this, because unit tests\n\t\t\t// could be broken with the additional '\\n'\n\t\t\tif i+1 < size {\n\t\t\t\tmsg += \"\\n\"\n\t\t\t}\n\t\t}\n\t}\n\treturn msg\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/awsutil/copy.go",
    "content": "package awsutil\n\nimport (\n\t\"io\"\n\t\"reflect\"\n\t\"time\"\n)\n\n// Copy deeply copies a src structure to dst. Useful for copying request and\n// response structures.\n//\n// Can copy between structs of different type, but will only copy fields which\n// are assignable, and exist in both structs. Fields which are not assignable,\n// or do not exist in both structs are ignored.\nfunc Copy(dst, src interface{}) {\n\tdstval := reflect.ValueOf(dst)\n\tif !dstval.IsValid() {\n\t\tpanic(\"Copy dst cannot be nil\")\n\t}\n\n\trcopy(dstval, reflect.ValueOf(src), true)\n}\n\n// CopyOf returns a copy of src while also allocating the memory for dst.\n// src must be a pointer type or this operation will fail.\nfunc CopyOf(src interface{}) (dst interface{}) {\n\tdsti := reflect.New(reflect.TypeOf(src).Elem())\n\tdst = dsti.Interface()\n\trcopy(dsti, reflect.ValueOf(src), true)\n\treturn\n}\n\n// rcopy performs a recursive copy of values from the source to destination.\n//\n// root is used to skip certain aspects of the copy which are not valid\n// for the root node of a object.\nfunc rcopy(dst, src reflect.Value, root bool) {\n\tif !src.IsValid() {\n\t\treturn\n\t}\n\n\tswitch src.Kind() {\n\tcase reflect.Ptr:\n\t\tif _, ok := src.Interface().(io.Reader); ok {\n\t\t\tif dst.Kind() == reflect.Ptr && dst.Elem().CanSet() {\n\t\t\t\tdst.Elem().Set(src)\n\t\t\t} else if dst.CanSet() {\n\t\t\t\tdst.Set(src)\n\t\t\t}\n\t\t} else {\n\t\t\te := src.Type().Elem()\n\t\t\tif dst.CanSet() && !src.IsNil() {\n\t\t\t\tif _, ok := src.Interface().(*time.Time); !ok {\n\t\t\t\t\tdst.Set(reflect.New(e))\n\t\t\t\t} else {\n\t\t\t\t\ttempValue := reflect.New(e)\n\t\t\t\t\ttempValue.Elem().Set(src.Elem())\n\t\t\t\t\t// Sets time.Time's unexported values\n\t\t\t\t\tdst.Set(tempValue)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif src.Elem().IsValid() {\n\t\t\t\t// Keep the current root state since the depth hasn't changed\n\t\t\t\trcopy(dst.Elem(), src.Elem(), root)\n\t\t\t}\n\t\t}\n\tcase reflect.Struct:\n\t\tt := dst.Type()\n\t\tfor i := 0; i < t.NumField(); i++ {\n\t\t\tname := t.Field(i).Name\n\t\t\tsrcVal := src.FieldByName(name)\n\t\t\tdstVal := dst.FieldByName(name)\n\t\t\tif srcVal.IsValid() && dstVal.CanSet() {\n\t\t\t\trcopy(dstVal, srcVal, false)\n\t\t\t}\n\t\t}\n\tcase reflect.Slice:\n\t\tif src.IsNil() {\n\t\t\tbreak\n\t\t}\n\n\t\ts := reflect.MakeSlice(src.Type(), src.Len(), src.Cap())\n\t\tdst.Set(s)\n\t\tfor i := 0; i < src.Len(); i++ {\n\t\t\trcopy(dst.Index(i), src.Index(i), false)\n\t\t}\n\tcase reflect.Map:\n\t\tif src.IsNil() {\n\t\t\tbreak\n\t\t}\n\n\t\ts := reflect.MakeMap(src.Type())\n\t\tdst.Set(s)\n\t\tfor _, k := range src.MapKeys() {\n\t\t\tv := src.MapIndex(k)\n\t\t\tv2 := reflect.New(v.Type()).Elem()\n\t\t\trcopy(v2, v, false)\n\t\t\tdst.SetMapIndex(k, v2)\n\t\t}\n\tdefault:\n\t\t// Assign the value if possible. If its not assignable, the value would\n\t\t// need to be converted and the impact of that may be unexpected, or is\n\t\t// not compatible with the dst type.\n\t\tif src.Type().AssignableTo(dst.Type()) {\n\t\t\tdst.Set(src)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go",
    "content": "package awsutil\n\nimport (\n\t\"reflect\"\n)\n\n// DeepEqual returns if the two values are deeply equal like reflect.DeepEqual.\n// In addition to this, this method will also dereference the input values if\n// possible so the DeepEqual performed will not fail if one parameter is a\n// pointer and the other is not.\n//\n// DeepEqual will not perform indirection of nested values of the input parameters.\nfunc DeepEqual(a, b interface{}) bool {\n\tra := reflect.Indirect(reflect.ValueOf(a))\n\trb := reflect.Indirect(reflect.ValueOf(b))\n\n\tif raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid {\n\t\t// If the elements are both nil, and of the same type the are equal\n\t\t// If they are of different types they are not equal\n\t\treturn reflect.TypeOf(a) == reflect.TypeOf(b)\n\t} else if raValid != rbValid {\n\t\t// Both values must be valid to be equal\n\t\treturn false\n\t}\n\n\treturn reflect.DeepEqual(ra.Interface(), rb.Interface())\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go",
    "content": "package awsutil\n\nimport (\n\t\"reflect\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/jmespath/go-jmespath\"\n)\n\nvar indexRe = regexp.MustCompile(`(.+)\\[(-?\\d+)?\\]$`)\n\n// rValuesAtPath returns a slice of values found in value v. The values\n// in v are explored recursively so all nested values are collected.\nfunc rValuesAtPath(v interface{}, path string, createPath, caseSensitive, nilTerm bool) []reflect.Value {\n\tpathparts := strings.Split(path, \"||\")\n\tif len(pathparts) > 1 {\n\t\tfor _, pathpart := range pathparts {\n\t\t\tvals := rValuesAtPath(v, pathpart, createPath, caseSensitive, nilTerm)\n\t\t\tif len(vals) > 0 {\n\t\t\t\treturn vals\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\tvalues := []reflect.Value{reflect.Indirect(reflect.ValueOf(v))}\n\tcomponents := strings.Split(path, \".\")\n\tfor len(values) > 0 && len(components) > 0 {\n\t\tvar index *int64\n\t\tvar indexStar bool\n\t\tc := strings.TrimSpace(components[0])\n\t\tif c == \"\" { // no actual component, illegal syntax\n\t\t\treturn nil\n\t\t} else if caseSensitive && c != \"*\" && strings.ToLower(c[0:1]) == c[0:1] {\n\t\t\t// TODO normalize case for user\n\t\t\treturn nil // don't support unexported fields\n\t\t}\n\n\t\t// parse this component\n\t\tif m := indexRe.FindStringSubmatch(c); m != nil {\n\t\t\tc = m[1]\n\t\t\tif m[2] == \"\" {\n\t\t\t\tindex = nil\n\t\t\t\tindexStar = true\n\t\t\t} else {\n\t\t\t\ti, _ := strconv.ParseInt(m[2], 10, 32)\n\t\t\t\tindex = &i\n\t\t\t\tindexStar = false\n\t\t\t}\n\t\t}\n\n\t\tnextvals := []reflect.Value{}\n\t\tfor _, value := range values {\n\t\t\t// pull component name out of struct member\n\t\t\tif value.Kind() != reflect.Struct {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif c == \"*\" { // pull all members\n\t\t\t\tfor i := 0; i < value.NumField(); i++ {\n\t\t\t\t\tif f := reflect.Indirect(value.Field(i)); f.IsValid() {\n\t\t\t\t\t\tnextvals = append(nextvals, f)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tvalue = value.FieldByNameFunc(func(name string) bool {\n\t\t\t\tif c == name {\n\t\t\t\t\treturn true\n\t\t\t\t} else if !caseSensitive && strings.ToLower(name) == strings.ToLower(c) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\treturn false\n\t\t\t})\n\n\t\t\tif nilTerm && value.Kind() == reflect.Ptr && len(components[1:]) == 0 {\n\t\t\t\tif !value.IsNil() {\n\t\t\t\t\tvalue.Set(reflect.Zero(value.Type()))\n\t\t\t\t}\n\t\t\t\treturn []reflect.Value{value}\n\t\t\t}\n\n\t\t\tif createPath && value.Kind() == reflect.Ptr && value.IsNil() {\n\t\t\t\t// TODO if the value is the terminus it should not be created\n\t\t\t\t// if the value to be set to its position is nil.\n\t\t\t\tvalue.Set(reflect.New(value.Type().Elem()))\n\t\t\t\tvalue = value.Elem()\n\t\t\t} else {\n\t\t\t\tvalue = reflect.Indirect(value)\n\t\t\t}\n\n\t\t\tif value.Kind() == reflect.Slice || value.Kind() == reflect.Map {\n\t\t\t\tif !createPath && value.IsNil() {\n\t\t\t\t\tvalue = reflect.ValueOf(nil)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif value.IsValid() {\n\t\t\t\tnextvals = append(nextvals, value)\n\t\t\t}\n\t\t}\n\t\tvalues = nextvals\n\n\t\tif indexStar || index != nil {\n\t\t\tnextvals = []reflect.Value{}\n\t\t\tfor _, valItem := range values {\n\t\t\t\tvalue := reflect.Indirect(valItem)\n\t\t\t\tif value.Kind() != reflect.Slice {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif indexStar { // grab all indices\n\t\t\t\t\tfor i := 0; i < value.Len(); i++ {\n\t\t\t\t\t\tidx := reflect.Indirect(value.Index(i))\n\t\t\t\t\t\tif idx.IsValid() {\n\t\t\t\t\t\t\tnextvals = append(nextvals, idx)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// pull out index\n\t\t\t\ti := int(*index)\n\t\t\t\tif i >= value.Len() { // check out of bounds\n\t\t\t\t\tif createPath {\n\t\t\t\t\t\t// TODO resize slice\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t} else if i < 0 { // support negative indexing\n\t\t\t\t\ti = value.Len() + i\n\t\t\t\t}\n\t\t\t\tvalue = reflect.Indirect(value.Index(i))\n\n\t\t\t\tif value.Kind() == reflect.Slice || value.Kind() == reflect.Map {\n\t\t\t\t\tif !createPath && value.IsNil() {\n\t\t\t\t\t\tvalue = reflect.ValueOf(nil)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif value.IsValid() {\n\t\t\t\t\tnextvals = append(nextvals, value)\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalues = nextvals\n\t\t}\n\n\t\tcomponents = components[1:]\n\t}\n\treturn values\n}\n\n// ValuesAtPath returns a list of values at the case insensitive lexical\n// path inside of a structure.\nfunc ValuesAtPath(i interface{}, path string) ([]interface{}, error) {\n\tresult, err := jmespath.Search(path, i)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tv := reflect.ValueOf(result)\n\tif !v.IsValid() || (v.Kind() == reflect.Ptr && v.IsNil()) {\n\t\treturn nil, nil\n\t}\n\tif s, ok := result.([]interface{}); ok {\n\t\treturn s, err\n\t}\n\tif v.Kind() == reflect.Map && v.Len() == 0 {\n\t\treturn nil, nil\n\t}\n\tif v.Kind() == reflect.Slice {\n\t\tout := make([]interface{}, v.Len())\n\t\tfor i := 0; i < v.Len(); i++ {\n\t\t\tout[i] = v.Index(i).Interface()\n\t\t}\n\t\treturn out, nil\n\t}\n\n\treturn []interface{}{result}, nil\n}\n\n// SetValueAtPath sets a value at the case insensitive lexical path inside\n// of a structure.\nfunc SetValueAtPath(i interface{}, path string, v interface{}) {\n\tif rvals := rValuesAtPath(i, path, true, false, v == nil); rvals != nil {\n\t\tfor _, rval := range rvals {\n\t\t\tif rval.Kind() == reflect.Ptr && rval.IsNil() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsetValue(rval, v)\n\t\t}\n\t}\n}\n\nfunc setValue(dstVal reflect.Value, src interface{}) {\n\tif dstVal.Kind() == reflect.Ptr {\n\t\tdstVal = reflect.Indirect(dstVal)\n\t}\n\tsrcVal := reflect.ValueOf(src)\n\n\tif !srcVal.IsValid() { // src is literal nil\n\t\tif dstVal.CanAddr() {\n\t\t\t// Convert to pointer so that pointer's value can be nil'ed\n\t\t\t//                     dstVal = dstVal.Addr()\n\t\t}\n\t\tdstVal.Set(reflect.Zero(dstVal.Type()))\n\n\t} else if srcVal.Kind() == reflect.Ptr {\n\t\tif srcVal.IsNil() {\n\t\t\tsrcVal = reflect.Zero(dstVal.Type())\n\t\t} else {\n\t\t\tsrcVal = reflect.ValueOf(src).Elem()\n\t\t}\n\t\tdstVal.Set(srcVal)\n\t} else {\n\t\tdstVal.Set(srcVal)\n\t}\n\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/awsutil/prettify.go",
    "content": "package awsutil\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"strings\"\n)\n\n// Prettify returns the string representation of a value.\nfunc Prettify(i interface{}) string {\n\tvar buf bytes.Buffer\n\tprettify(reflect.ValueOf(i), 0, &buf)\n\treturn buf.String()\n}\n\n// prettify will recursively walk value v to build a textual\n// representation of the value.\nfunc prettify(v reflect.Value, indent int, buf *bytes.Buffer) {\n\tfor v.Kind() == reflect.Ptr {\n\t\tv = v.Elem()\n\t}\n\n\tswitch v.Kind() {\n\tcase reflect.Struct:\n\t\tstrtype := v.Type().String()\n\t\tif strtype == \"time.Time\" {\n\t\t\tfmt.Fprintf(buf, \"%s\", v.Interface())\n\t\t\tbreak\n\t\t} else if strings.HasPrefix(strtype, \"io.\") {\n\t\t\tbuf.WriteString(\"<buffer>\")\n\t\t\tbreak\n\t\t}\n\n\t\tbuf.WriteString(\"{\\n\")\n\n\t\tnames := []string{}\n\t\tfor i := 0; i < v.Type().NumField(); i++ {\n\t\t\tname := v.Type().Field(i).Name\n\t\t\tf := v.Field(i)\n\t\t\tif name[0:1] == strings.ToLower(name[0:1]) {\n\t\t\t\tcontinue // ignore unexported fields\n\t\t\t}\n\t\t\tif (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice || f.Kind() == reflect.Map) && f.IsNil() {\n\t\t\t\tcontinue // ignore unset fields\n\t\t\t}\n\t\t\tnames = append(names, name)\n\t\t}\n\n\t\tfor i, n := range names {\n\t\t\tval := v.FieldByName(n)\n\t\t\tbuf.WriteString(strings.Repeat(\" \", indent+2))\n\t\t\tbuf.WriteString(n + \": \")\n\t\t\tprettify(val, indent+2, buf)\n\n\t\t\tif i < len(names)-1 {\n\t\t\t\tbuf.WriteString(\",\\n\")\n\t\t\t}\n\t\t}\n\n\t\tbuf.WriteString(\"\\n\" + strings.Repeat(\" \", indent) + \"}\")\n\tcase reflect.Slice:\n\t\tnl, id, id2 := \"\", \"\", \"\"\n\t\tif v.Len() > 3 {\n\t\t\tnl, id, id2 = \"\\n\", strings.Repeat(\" \", indent), strings.Repeat(\" \", indent+2)\n\t\t}\n\t\tbuf.WriteString(\"[\" + nl)\n\t\tfor i := 0; i < v.Len(); i++ {\n\t\t\tbuf.WriteString(id2)\n\t\t\tprettify(v.Index(i), indent+2, buf)\n\n\t\t\tif i < v.Len()-1 {\n\t\t\t\tbuf.WriteString(\",\" + nl)\n\t\t\t}\n\t\t}\n\n\t\tbuf.WriteString(nl + id + \"]\")\n\tcase reflect.Map:\n\t\tbuf.WriteString(\"{\\n\")\n\n\t\tfor i, k := range v.MapKeys() {\n\t\t\tbuf.WriteString(strings.Repeat(\" \", indent+2))\n\t\t\tbuf.WriteString(k.String() + \": \")\n\t\t\tprettify(v.MapIndex(k), indent+2, buf)\n\n\t\t\tif i < v.Len()-1 {\n\t\t\t\tbuf.WriteString(\",\\n\")\n\t\t\t}\n\t\t}\n\n\t\tbuf.WriteString(\"\\n\" + strings.Repeat(\" \", indent) + \"}\")\n\tdefault:\n\t\tif !v.IsValid() {\n\t\t\tfmt.Fprint(buf, \"<invalid value>\")\n\t\t\treturn\n\t\t}\n\t\tformat := \"%v\"\n\t\tswitch v.Interface().(type) {\n\t\tcase string:\n\t\t\tformat = \"%q\"\n\t\tcase io.ReadSeeker, io.Reader:\n\t\t\tformat = \"buffer(%p)\"\n\t\t}\n\t\tfmt.Fprintf(buf, format, v.Interface())\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go",
    "content": "package awsutil\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strings\"\n)\n\n// StringValue returns the string representation of a value.\nfunc StringValue(i interface{}) string {\n\tvar buf bytes.Buffer\n\tstringValue(reflect.ValueOf(i), 0, &buf)\n\treturn buf.String()\n}\n\nfunc stringValue(v reflect.Value, indent int, buf *bytes.Buffer) {\n\tfor v.Kind() == reflect.Ptr {\n\t\tv = v.Elem()\n\t}\n\n\tswitch v.Kind() {\n\tcase reflect.Struct:\n\t\tbuf.WriteString(\"{\\n\")\n\n\t\tnames := []string{}\n\t\tfor i := 0; i < v.Type().NumField(); i++ {\n\t\t\tname := v.Type().Field(i).Name\n\t\t\tf := v.Field(i)\n\t\t\tif name[0:1] == strings.ToLower(name[0:1]) {\n\t\t\t\tcontinue // ignore unexported fields\n\t\t\t}\n\t\t\tif (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice) && f.IsNil() {\n\t\t\t\tcontinue // ignore unset fields\n\t\t\t}\n\t\t\tnames = append(names, name)\n\t\t}\n\n\t\tfor i, n := range names {\n\t\t\tval := v.FieldByName(n)\n\t\t\tbuf.WriteString(strings.Repeat(\" \", indent+2))\n\t\t\tbuf.WriteString(n + \": \")\n\t\t\tstringValue(val, indent+2, buf)\n\n\t\t\tif i < len(names)-1 {\n\t\t\t\tbuf.WriteString(\",\\n\")\n\t\t\t}\n\t\t}\n\n\t\tbuf.WriteString(\"\\n\" + strings.Repeat(\" \", indent) + \"}\")\n\tcase reflect.Slice:\n\t\tnl, id, id2 := \"\", \"\", \"\"\n\t\tif v.Len() > 3 {\n\t\t\tnl, id, id2 = \"\\n\", strings.Repeat(\" \", indent), strings.Repeat(\" \", indent+2)\n\t\t}\n\t\tbuf.WriteString(\"[\" + nl)\n\t\tfor i := 0; i < v.Len(); i++ {\n\t\t\tbuf.WriteString(id2)\n\t\t\tstringValue(v.Index(i), indent+2, buf)\n\n\t\t\tif i < v.Len()-1 {\n\t\t\t\tbuf.WriteString(\",\" + nl)\n\t\t\t}\n\t\t}\n\n\t\tbuf.WriteString(nl + id + \"]\")\n\tcase reflect.Map:\n\t\tbuf.WriteString(\"{\\n\")\n\n\t\tfor i, k := range v.MapKeys() {\n\t\t\tbuf.WriteString(strings.Repeat(\" \", indent+2))\n\t\t\tbuf.WriteString(k.String() + \": \")\n\t\t\tstringValue(v.MapIndex(k), indent+2, buf)\n\n\t\t\tif i < v.Len()-1 {\n\t\t\t\tbuf.WriteString(\",\\n\")\n\t\t\t}\n\t\t}\n\n\t\tbuf.WriteString(\"\\n\" + strings.Repeat(\" \", indent) + \"}\")\n\tdefault:\n\t\tformat := \"%v\"\n\t\tswitch v.Interface().(type) {\n\t\tcase string:\n\t\t\tformat = \"%q\"\n\t\t}\n\t\tfmt.Fprintf(buf, format, v.Interface())\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/client/client.go",
    "content": "package client\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http/httputil\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/client/metadata\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n)\n\n// A Config provides configuration to a service client instance.\ntype Config struct {\n\tConfig                  *aws.Config\n\tHandlers                request.Handlers\n\tEndpoint, SigningRegion string\n}\n\n// ConfigProvider provides a generic way for a service client to receive\n// the ClientConfig without circular dependencies.\ntype ConfigProvider interface {\n\tClientConfig(serviceName string, cfgs ...*aws.Config) Config\n}\n\n// A Client implements the base client request and response handling\n// used by all service clients.\ntype Client struct {\n\trequest.Retryer\n\tmetadata.ClientInfo\n\n\tConfig   aws.Config\n\tHandlers request.Handlers\n}\n\n// New will return a pointer to a new initialized service client.\nfunc New(cfg aws.Config, info metadata.ClientInfo, handlers request.Handlers, options ...func(*Client)) *Client {\n\tsvc := &Client{\n\t\tConfig:     cfg,\n\t\tClientInfo: info,\n\t\tHandlers:   handlers,\n\t}\n\n\tswitch retryer, ok := cfg.Retryer.(request.Retryer); {\n\tcase ok:\n\t\tsvc.Retryer = retryer\n\tcase cfg.Retryer != nil && cfg.Logger != nil:\n\t\ts := fmt.Sprintf(\"WARNING: %T does not implement request.Retryer; using DefaultRetryer instead\", cfg.Retryer)\n\t\tcfg.Logger.Log(s)\n\t\tfallthrough\n\tdefault:\n\t\tmaxRetries := aws.IntValue(cfg.MaxRetries)\n\t\tif cfg.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries {\n\t\t\tmaxRetries = 3\n\t\t}\n\t\tsvc.Retryer = DefaultRetryer{NumMaxRetries: maxRetries}\n\t}\n\n\tsvc.AddDebugHandlers()\n\n\tfor _, option := range options {\n\t\toption(svc)\n\t}\n\n\treturn svc\n}\n\n// NewRequest returns a new Request pointer for the service API\n// operation and parameters.\nfunc (c *Client) NewRequest(operation *request.Operation, params interface{}, data interface{}) *request.Request {\n\treturn request.New(c.Config, c.ClientInfo, c.Handlers, c.Retryer, operation, params, data)\n}\n\n// AddDebugHandlers injects debug logging handlers into the service to log request\n// debug information.\nfunc (c *Client) AddDebugHandlers() {\n\tif !c.Config.LogLevel.AtLeast(aws.LogDebug) {\n\t\treturn\n\t}\n\n\tc.Handlers.Send.PushFront(logRequest)\n\tc.Handlers.Send.PushBack(logResponse)\n}\n\nconst logReqMsg = `DEBUG: Request %s/%s Details:\n---[ REQUEST POST-SIGN ]-----------------------------\n%s\n-----------------------------------------------------`\n\nconst logReqErrMsg = `DEBUG ERROR: Request %s/%s:\n---[ REQUEST DUMP ERROR ]-----------------------------\n%s\n-----------------------------------------------------`\n\nfunc logRequest(r *request.Request) {\n\tlogBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)\n\tdumpedBody, err := httputil.DumpRequestOut(r.HTTPRequest, logBody)\n\tif err != nil {\n\t\tr.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, r.ClientInfo.ServiceName, r.Operation.Name, err))\n\t\treturn\n\t}\n\n\tif logBody {\n\t\t// Reset the request body because dumpRequest will re-wrap the r.HTTPRequest's\n\t\t// Body as a NoOpCloser and will not be reset after read by the HTTP\n\t\t// client reader.\n\t\tr.Body.Seek(r.BodyStart, 0)\n\t\tr.HTTPRequest.Body = ioutil.NopCloser(r.Body)\n\t}\n\n\tr.Config.Logger.Log(fmt.Sprintf(logReqMsg, r.ClientInfo.ServiceName, r.Operation.Name, string(dumpedBody)))\n}\n\nconst logRespMsg = `DEBUG: Response %s/%s Details:\n---[ RESPONSE ]--------------------------------------\n%s\n-----------------------------------------------------`\n\nconst logRespErrMsg = `DEBUG ERROR: Response %s/%s:\n---[ RESPONSE DUMP ERROR ]-----------------------------\n%s\n-----------------------------------------------------`\n\nfunc logResponse(r *request.Request) {\n\tvar msg = \"no response data\"\n\tif r.HTTPResponse != nil {\n\t\tlogBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)\n\t\tdumpedBody, err := httputil.DumpResponse(r.HTTPResponse, logBody)\n\t\tif err != nil {\n\t\t\tr.Config.Logger.Log(fmt.Sprintf(logRespErrMsg, r.ClientInfo.ServiceName, r.Operation.Name, err))\n\t\t\treturn\n\t\t}\n\n\t\tmsg = string(dumpedBody)\n\t} else if r.Error != nil {\n\t\tmsg = r.Error.Error()\n\t}\n\tr.Config.Logger.Log(fmt.Sprintf(logRespMsg, r.ClientInfo.ServiceName, r.Operation.Name, msg))\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go",
    "content": "package client\n\nimport (\n\t\"math/rand\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n)\n\n// DefaultRetryer implements basic retry logic using exponential backoff for\n// most services. If you want to implement custom retry logic, implement the\n// request.Retryer interface or create a structure type that composes this\n// struct and override the specific methods. For example, to override only\n// the MaxRetries method:\n//\n//\t\ttype retryer struct {\n//      service.DefaultRetryer\n//    }\n//\n//    // This implementation always has 100 max retries\n//    func (d retryer) MaxRetries() uint { return 100 }\ntype DefaultRetryer struct {\n\tNumMaxRetries int\n}\n\n// MaxRetries returns the number of maximum returns the service will use to make\n// an individual API request.\nfunc (d DefaultRetryer) MaxRetries() int {\n\treturn d.NumMaxRetries\n}\n\nvar seededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())})\n\n// RetryRules returns the delay duration before retrying this request again\nfunc (d DefaultRetryer) RetryRules(r *request.Request) time.Duration {\n\t// Set the upper limit of delay in retrying at ~five minutes\n\tminTime := 30\n\tthrottle := d.shouldThrottle(r)\n\tif throttle {\n\t\tminTime = 500\n\t}\n\n\tretryCount := r.RetryCount\n\tif retryCount > 13 {\n\t\tretryCount = 13\n\t} else if throttle && retryCount > 8 {\n\t\tretryCount = 8\n\t}\n\n\tdelay := (1 << uint(retryCount)) * (seededRand.Intn(minTime) + minTime)\n\treturn time.Duration(delay) * time.Millisecond\n}\n\n// ShouldRetry returns true if the request should be retried.\nfunc (d DefaultRetryer) ShouldRetry(r *request.Request) bool {\n\tif r.HTTPResponse.StatusCode >= 500 {\n\t\treturn true\n\t}\n\treturn r.IsErrorRetryable() || d.shouldThrottle(r)\n}\n\n// ShouldThrottle returns true if the request should be throttled.\nfunc (d DefaultRetryer) shouldThrottle(r *request.Request) bool {\n\tif r.HTTPResponse.StatusCode == 502 ||\n\t\tr.HTTPResponse.StatusCode == 503 ||\n\t\tr.HTTPResponse.StatusCode == 504 {\n\t\treturn true\n\t}\n\treturn r.IsErrorThrottle()\n}\n\n// lockedSource is a thread-safe implementation of rand.Source\ntype lockedSource struct {\n\tlk  sync.Mutex\n\tsrc rand.Source\n}\n\nfunc (r *lockedSource) Int63() (n int64) {\n\tr.lk.Lock()\n\tn = r.src.Int63()\n\tr.lk.Unlock()\n\treturn\n}\n\nfunc (r *lockedSource) Seed(seed int64) {\n\tr.lk.Lock()\n\tr.src.Seed(seed)\n\tr.lk.Unlock()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go",
    "content": "package metadata\n\n// ClientInfo wraps immutable data from the client.Client structure.\ntype ClientInfo struct {\n\tServiceName   string\n\tAPIVersion    string\n\tEndpoint      string\n\tSigningName   string\n\tSigningRegion string\n\tJSONVersion   string\n\tTargetPrefix  string\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/config.go",
    "content": "package aws\n\nimport (\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n)\n\n// UseServiceDefaultRetries instructs the config to use the service's own\n// default number of retries. This will be the default action if\n// Config.MaxRetries is nil also.\nconst UseServiceDefaultRetries = -1\n\n// RequestRetryer is an alias for a type that implements the request.Retryer\n// interface.\ntype RequestRetryer interface{}\n\n// A Config provides service configuration for service clients. By default,\n// all clients will use the defaults.DefaultConfig tructure.\n//\n//     // Create Session with MaxRetry configuration to be shared by multiple\n//     // service clients.\n//     sess, err := session.NewSession(&aws.Config{\n//         MaxRetries: aws.Int(3),\n//     })\n//\n//     // Create S3 service client with a specific Region.\n//     svc := s3.New(sess, &aws.Config{\n//         Region: aws.String(\"us-west-2\"),\n//     })\ntype Config struct {\n\t// Enables verbose error printing of all credential chain errors.\n\t// Should be used when wanting to see all errors while attempting to\n\t// retrieve credentials.\n\tCredentialsChainVerboseErrors *bool\n\n\t// The credentials object to use when signing requests. Defaults to a\n\t// chain of credential providers to search for credentials in environment\n\t// variables, shared credential file, and EC2 Instance Roles.\n\tCredentials *credentials.Credentials\n\n\t// An optional endpoint URL (hostname only or fully qualified URI)\n\t// that overrides the default generated endpoint for a client. Set this\n\t// to `\"\"` to use the default generated endpoint.\n\t//\n\t// @note You must still provide a `Region` value when specifying an\n\t//   endpoint for a client.\n\tEndpoint *string\n\n\t// The region to send requests to. This parameter is required and must\n\t// be configured globally or on a per-client basis unless otherwise\n\t// noted. A full list of regions is found in the \"Regions and Endpoints\"\n\t// document.\n\t//\n\t// @see http://docs.aws.amazon.com/general/latest/gr/rande.html\n\t//   AWS Regions and Endpoints\n\tRegion *string\n\n\t// Set this to `true` to disable SSL when sending requests. Defaults\n\t// to `false`.\n\tDisableSSL *bool\n\n\t// The HTTP client to use when sending requests. Defaults to\n\t// `http.DefaultClient`.\n\tHTTPClient *http.Client\n\n\t// An integer value representing the logging level. The default log level\n\t// is zero (LogOff), which represents no logging. To enable logging set\n\t// to a LogLevel Value.\n\tLogLevel *LogLevelType\n\n\t// The logger writer interface to write logging messages to. Defaults to\n\t// standard out.\n\tLogger Logger\n\n\t// The maximum number of times that a request will be retried for failures.\n\t// Defaults to -1, which defers the max retry setting to the service\n\t// specific configuration.\n\tMaxRetries *int\n\n\t// Retryer guides how HTTP requests should be retried in case of\n\t// recoverable failures.\n\t//\n\t// When nil or the value does not implement the request.Retryer interface,\n\t// the request.DefaultRetryer will be used.\n\t//\n\t// When both Retryer and MaxRetries are non-nil, the former is used and\n\t// the latter ignored.\n\t//\n\t// To set the Retryer field in a type-safe manner and with chaining, use\n\t// the request.WithRetryer helper function:\n\t//\n\t//   cfg := request.WithRetryer(aws.NewConfig(), myRetryer)\n\t//\n\tRetryer RequestRetryer\n\n\t// Disables semantic parameter validation, which validates input for\n\t// missing required fields and/or other semantic request input errors.\n\tDisableParamValidation *bool\n\n\t// Disables the computation of request and response checksums, e.g.,\n\t// CRC32 checksums in Amazon DynamoDB.\n\tDisableComputeChecksums *bool\n\n\t// Set this to `true` to force the request to use path-style addressing,\n\t// i.e., `http://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client\n\t// will use virtual hosted bucket addressing when possible\n\t// (`http://BUCKET.s3.amazonaws.com/KEY`).\n\t//\n\t// @note This configuration option is specific to the Amazon S3 service.\n\t// @see http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html\n\t//   Amazon S3: Virtual Hosting of Buckets\n\tS3ForcePathStyle *bool\n\n\t// Set this to `true` to disable the SDK adding the `Expect: 100-Continue`\n\t// header to PUT requests over 2MB of content. 100-Continue instructs the\n\t// HTTP client not to send the body until the service responds with a\n\t// `continue` status. This is useful to prevent sending the request body\n\t// until after the request is authenticated, and validated.\n\t//\n\t// http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html\n\t//\n\t// 100-Continue is only enabled for Go 1.6 and above. See `http.Transport`'s\n\t// `ExpectContinueTimeout` for information on adjusting the continue wait\n\t// timeout. https://golang.org/pkg/net/http/#Transport\n\t//\n\t// You should use this flag to disble 100-Continue if you experience issues\n\t// with proxies or third party S3 compatible services.\n\tS3Disable100Continue *bool\n\n\t// Set this to `true` to enable S3 Accelerate feature. For all operations\n\t// compatible with S3 Accelerate will use the accelerate endpoint for\n\t// requests. Requests not compatible will fall back to normal S3 requests.\n\t//\n\t// The bucket must be enable for accelerate to be used with S3 client with\n\t// accelerate enabled. If the bucket is not enabled for accelerate an error\n\t// will be returned. The bucket name must be DNS compatible to also work\n\t// with accelerate.\n\t//\n\t// Not compatible with UseDualStack requests will fail if both flags are\n\t// specified.\n\tS3UseAccelerate *bool\n\n\t// Set this to `true` to disable the EC2Metadata client from overriding the\n\t// default http.Client's Timeout. This is helpful if you do not want the\n\t// EC2Metadata client to create a new http.Client. This options is only\n\t// meaningful if you're not already using a custom HTTP client with the\n\t// SDK. Enabled by default.\n\t//\n\t// Must be set and provided to the session.NewSession() in order to disable\n\t// the EC2Metadata overriding the timeout for default credentials chain.\n\t//\n\t// Example:\n\t//    sess, err := session.NewSession(aws.NewConfig().WithEC2MetadataDiableTimeoutOverride(true))\n\t//\n\t//    svc := s3.New(sess)\n\t//\n\tEC2MetadataDisableTimeoutOverride *bool\n\n\t// Instructs the endpiont to be generated for a service client to\n\t// be the dual stack endpoint. The dual stack endpoint will support\n\t// both IPv4 and IPv6 addressing.\n\t//\n\t// Setting this for a service which does not support dual stack will fail\n\t// to make requets. It is not recommended to set this value on the session\n\t// as it will apply to all service clients created with the session. Even\n\t// services which don't support dual stack endpoints.\n\t//\n\t// If the Endpoint config value is also provided the UseDualStack flag\n\t// will be ignored.\n\t//\n\t// Only supported with.\n\t//\n\t//     sess, err := session.NewSession()\n\t//\n\t//     svc := s3.New(sess, &aws.Config{\n\t//         UseDualStack: aws.Bool(true),\n\t//     })\n\tUseDualStack *bool\n\n\t// SleepDelay is an override for the func the SDK will call when sleeping\n\t// during the lifecycle of a request. Specifically this will be used for\n\t// request delays. This value should only be used for testing. To adjust\n\t// the delay of a request see the aws/client.DefaultRetryer and\n\t// aws/request.Retryer.\n\tSleepDelay func(time.Duration)\n}\n\n// NewConfig returns a new Config pointer that can be chained with builder\n// methods to set multiple configuration values inline without using pointers.\n//\n//     // Create Session with MaxRetry configuration to be shared by multiple\n//     // service clients.\n//     sess, err := session.NewSession(aws.NewConfig().\n//         WithMaxRetries(3),\n//     )\n//\n//     // Create S3 service client with a specific Region.\n//     svc := s3.New(sess, aws.NewConfig().\n//         WithRegion(\"us-west-2\"),\n//     )\nfunc NewConfig() *Config {\n\treturn &Config{}\n}\n\n// WithCredentialsChainVerboseErrors sets a config verbose errors boolean and returning\n// a Config pointer.\nfunc (c *Config) WithCredentialsChainVerboseErrors(verboseErrs bool) *Config {\n\tc.CredentialsChainVerboseErrors = &verboseErrs\n\treturn c\n}\n\n// WithCredentials sets a config Credentials value returning a Config pointer\n// for chaining.\nfunc (c *Config) WithCredentials(creds *credentials.Credentials) *Config {\n\tc.Credentials = creds\n\treturn c\n}\n\n// WithEndpoint sets a config Endpoint value returning a Config pointer for\n// chaining.\nfunc (c *Config) WithEndpoint(endpoint string) *Config {\n\tc.Endpoint = &endpoint\n\treturn c\n}\n\n// WithRegion sets a config Region value returning a Config pointer for\n// chaining.\nfunc (c *Config) WithRegion(region string) *Config {\n\tc.Region = &region\n\treturn c\n}\n\n// WithDisableSSL sets a config DisableSSL value returning a Config pointer\n// for chaining.\nfunc (c *Config) WithDisableSSL(disable bool) *Config {\n\tc.DisableSSL = &disable\n\treturn c\n}\n\n// WithHTTPClient sets a config HTTPClient value returning a Config pointer\n// for chaining.\nfunc (c *Config) WithHTTPClient(client *http.Client) *Config {\n\tc.HTTPClient = client\n\treturn c\n}\n\n// WithMaxRetries sets a config MaxRetries value returning a Config pointer\n// for chaining.\nfunc (c *Config) WithMaxRetries(max int) *Config {\n\tc.MaxRetries = &max\n\treturn c\n}\n\n// WithDisableParamValidation sets a config DisableParamValidation value\n// returning a Config pointer for chaining.\nfunc (c *Config) WithDisableParamValidation(disable bool) *Config {\n\tc.DisableParamValidation = &disable\n\treturn c\n}\n\n// WithDisableComputeChecksums sets a config DisableComputeChecksums value\n// returning a Config pointer for chaining.\nfunc (c *Config) WithDisableComputeChecksums(disable bool) *Config {\n\tc.DisableComputeChecksums = &disable\n\treturn c\n}\n\n// WithLogLevel sets a config LogLevel value returning a Config pointer for\n// chaining.\nfunc (c *Config) WithLogLevel(level LogLevelType) *Config {\n\tc.LogLevel = &level\n\treturn c\n}\n\n// WithLogger sets a config Logger value returning a Config pointer for\n// chaining.\nfunc (c *Config) WithLogger(logger Logger) *Config {\n\tc.Logger = logger\n\treturn c\n}\n\n// WithS3ForcePathStyle sets a config S3ForcePathStyle value returning a Config\n// pointer for chaining.\nfunc (c *Config) WithS3ForcePathStyle(force bool) *Config {\n\tc.S3ForcePathStyle = &force\n\treturn c\n}\n\n// WithS3Disable100Continue sets a config S3Disable100Continue value returning\n// a Config pointer for chaining.\nfunc (c *Config) WithS3Disable100Continue(disable bool) *Config {\n\tc.S3Disable100Continue = &disable\n\treturn c\n}\n\n// WithS3UseAccelerate sets a config S3UseAccelerate value returning a Config\n// pointer for chaining.\nfunc (c *Config) WithS3UseAccelerate(enable bool) *Config {\n\tc.S3UseAccelerate = &enable\n\treturn c\n}\n\n// WithUseDualStack sets a config UseDualStack value returning a Config\n// pointer for chaining.\nfunc (c *Config) WithUseDualStack(enable bool) *Config {\n\tc.UseDualStack = &enable\n\treturn c\n}\n\n// WithEC2MetadataDisableTimeoutOverride sets a config EC2MetadataDisableTimeoutOverride value\n// returning a Config pointer for chaining.\nfunc (c *Config) WithEC2MetadataDisableTimeoutOverride(enable bool) *Config {\n\tc.EC2MetadataDisableTimeoutOverride = &enable\n\treturn c\n}\n\n// WithSleepDelay overrides the function used to sleep while waiting for the\n// next retry. Defaults to time.Sleep.\nfunc (c *Config) WithSleepDelay(fn func(time.Duration)) *Config {\n\tc.SleepDelay = fn\n\treturn c\n}\n\n// MergeIn merges the passed in configs into the existing config object.\nfunc (c *Config) MergeIn(cfgs ...*Config) {\n\tfor _, other := range cfgs {\n\t\tmergeInConfig(c, other)\n\t}\n}\n\nfunc mergeInConfig(dst *Config, other *Config) {\n\tif other == nil {\n\t\treturn\n\t}\n\n\tif other.CredentialsChainVerboseErrors != nil {\n\t\tdst.CredentialsChainVerboseErrors = other.CredentialsChainVerboseErrors\n\t}\n\n\tif other.Credentials != nil {\n\t\tdst.Credentials = other.Credentials\n\t}\n\n\tif other.Endpoint != nil {\n\t\tdst.Endpoint = other.Endpoint\n\t}\n\n\tif other.Region != nil {\n\t\tdst.Region = other.Region\n\t}\n\n\tif other.DisableSSL != nil {\n\t\tdst.DisableSSL = other.DisableSSL\n\t}\n\n\tif other.HTTPClient != nil {\n\t\tdst.HTTPClient = other.HTTPClient\n\t}\n\n\tif other.LogLevel != nil {\n\t\tdst.LogLevel = other.LogLevel\n\t}\n\n\tif other.Logger != nil {\n\t\tdst.Logger = other.Logger\n\t}\n\n\tif other.MaxRetries != nil {\n\t\tdst.MaxRetries = other.MaxRetries\n\t}\n\n\tif other.Retryer != nil {\n\t\tdst.Retryer = other.Retryer\n\t}\n\n\tif other.DisableParamValidation != nil {\n\t\tdst.DisableParamValidation = other.DisableParamValidation\n\t}\n\n\tif other.DisableComputeChecksums != nil {\n\t\tdst.DisableComputeChecksums = other.DisableComputeChecksums\n\t}\n\n\tif other.S3ForcePathStyle != nil {\n\t\tdst.S3ForcePathStyle = other.S3ForcePathStyle\n\t}\n\n\tif other.S3Disable100Continue != nil {\n\t\tdst.S3Disable100Continue = other.S3Disable100Continue\n\t}\n\n\tif other.S3UseAccelerate != nil {\n\t\tdst.S3UseAccelerate = other.S3UseAccelerate\n\t}\n\n\tif other.UseDualStack != nil {\n\t\tdst.UseDualStack = other.UseDualStack\n\t}\n\n\tif other.EC2MetadataDisableTimeoutOverride != nil {\n\t\tdst.EC2MetadataDisableTimeoutOverride = other.EC2MetadataDisableTimeoutOverride\n\t}\n\n\tif other.SleepDelay != nil {\n\t\tdst.SleepDelay = other.SleepDelay\n\t}\n}\n\n// Copy will return a shallow copy of the Config object. If any additional\n// configurations are provided they will be merged into the new config returned.\nfunc (c *Config) Copy(cfgs ...*Config) *Config {\n\tdst := &Config{}\n\tdst.MergeIn(c)\n\n\tfor _, cfg := range cfgs {\n\t\tdst.MergeIn(cfg)\n\t}\n\n\treturn dst\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/convert_types.go",
    "content": "package aws\n\nimport \"time\"\n\n// String returns a pointer to the string value passed in.\nfunc String(v string) *string {\n\treturn &v\n}\n\n// StringValue returns the value of the string pointer passed in or\n// \"\" if the pointer is nil.\nfunc StringValue(v *string) string {\n\tif v != nil {\n\t\treturn *v\n\t}\n\treturn \"\"\n}\n\n// StringSlice converts a slice of string values into a slice of\n// string pointers\nfunc StringSlice(src []string) []*string {\n\tdst := make([]*string, len(src))\n\tfor i := 0; i < len(src); i++ {\n\t\tdst[i] = &(src[i])\n\t}\n\treturn dst\n}\n\n// StringValueSlice converts a slice of string pointers into a slice of\n// string values\nfunc StringValueSlice(src []*string) []string {\n\tdst := make([]string, len(src))\n\tfor i := 0; i < len(src); i++ {\n\t\tif src[i] != nil {\n\t\t\tdst[i] = *(src[i])\n\t\t}\n\t}\n\treturn dst\n}\n\n// StringMap converts a string map of string values into a string\n// map of string pointers\nfunc StringMap(src map[string]string) map[string]*string {\n\tdst := make(map[string]*string)\n\tfor k, val := range src {\n\t\tv := val\n\t\tdst[k] = &v\n\t}\n\treturn dst\n}\n\n// StringValueMap converts a string map of string pointers into a string\n// map of string values\nfunc StringValueMap(src map[string]*string) map[string]string {\n\tdst := make(map[string]string)\n\tfor k, val := range src {\n\t\tif val != nil {\n\t\t\tdst[k] = *val\n\t\t}\n\t}\n\treturn dst\n}\n\n// Bool returns a pointer to the bool value passed in.\nfunc Bool(v bool) *bool {\n\treturn &v\n}\n\n// BoolValue returns the value of the bool pointer passed in or\n// false if the pointer is nil.\nfunc BoolValue(v *bool) bool {\n\tif v != nil {\n\t\treturn *v\n\t}\n\treturn false\n}\n\n// BoolSlice converts a slice of bool values into a slice of\n// bool pointers\nfunc BoolSlice(src []bool) []*bool {\n\tdst := make([]*bool, len(src))\n\tfor i := 0; i < len(src); i++ {\n\t\tdst[i] = &(src[i])\n\t}\n\treturn dst\n}\n\n// BoolValueSlice converts a slice of bool pointers into a slice of\n// bool values\nfunc BoolValueSlice(src []*bool) []bool {\n\tdst := make([]bool, len(src))\n\tfor i := 0; i < len(src); i++ {\n\t\tif src[i] != nil {\n\t\t\tdst[i] = *(src[i])\n\t\t}\n\t}\n\treturn dst\n}\n\n// BoolMap converts a string map of bool values into a string\n// map of bool pointers\nfunc BoolMap(src map[string]bool) map[string]*bool {\n\tdst := make(map[string]*bool)\n\tfor k, val := range src {\n\t\tv := val\n\t\tdst[k] = &v\n\t}\n\treturn dst\n}\n\n// BoolValueMap converts a string map of bool pointers into a string\n// map of bool values\nfunc BoolValueMap(src map[string]*bool) map[string]bool {\n\tdst := make(map[string]bool)\n\tfor k, val := range src {\n\t\tif val != nil {\n\t\t\tdst[k] = *val\n\t\t}\n\t}\n\treturn dst\n}\n\n// Int returns a pointer to the int value passed in.\nfunc Int(v int) *int {\n\treturn &v\n}\n\n// IntValue returns the value of the int pointer passed in or\n// 0 if the pointer is nil.\nfunc IntValue(v *int) int {\n\tif v != nil {\n\t\treturn *v\n\t}\n\treturn 0\n}\n\n// IntSlice converts a slice of int values into a slice of\n// int pointers\nfunc IntSlice(src []int) []*int {\n\tdst := make([]*int, len(src))\n\tfor i := 0; i < len(src); i++ {\n\t\tdst[i] = &(src[i])\n\t}\n\treturn dst\n}\n\n// IntValueSlice converts a slice of int pointers into a slice of\n// int values\nfunc IntValueSlice(src []*int) []int {\n\tdst := make([]int, len(src))\n\tfor i := 0; i < len(src); i++ {\n\t\tif src[i] != nil {\n\t\t\tdst[i] = *(src[i])\n\t\t}\n\t}\n\treturn dst\n}\n\n// IntMap converts a string map of int values into a string\n// map of int pointers\nfunc IntMap(src map[string]int) map[string]*int {\n\tdst := make(map[string]*int)\n\tfor k, val := range src {\n\t\tv := val\n\t\tdst[k] = &v\n\t}\n\treturn dst\n}\n\n// IntValueMap converts a string map of int pointers into a string\n// map of int values\nfunc IntValueMap(src map[string]*int) map[string]int {\n\tdst := make(map[string]int)\n\tfor k, val := range src {\n\t\tif val != nil {\n\t\t\tdst[k] = *val\n\t\t}\n\t}\n\treturn dst\n}\n\n// Int64 returns a pointer to the int64 value passed in.\nfunc Int64(v int64) *int64 {\n\treturn &v\n}\n\n// Int64Value returns the value of the int64 pointer passed in or\n// 0 if the pointer is nil.\nfunc Int64Value(v *int64) int64 {\n\tif v != nil {\n\t\treturn *v\n\t}\n\treturn 0\n}\n\n// Int64Slice converts a slice of int64 values into a slice of\n// int64 pointers\nfunc Int64Slice(src []int64) []*int64 {\n\tdst := make([]*int64, len(src))\n\tfor i := 0; i < len(src); i++ {\n\t\tdst[i] = &(src[i])\n\t}\n\treturn dst\n}\n\n// Int64ValueSlice converts a slice of int64 pointers into a slice of\n// int64 values\nfunc Int64ValueSlice(src []*int64) []int64 {\n\tdst := make([]int64, len(src))\n\tfor i := 0; i < len(src); i++ {\n\t\tif src[i] != nil {\n\t\t\tdst[i] = *(src[i])\n\t\t}\n\t}\n\treturn dst\n}\n\n// Int64Map converts a string map of int64 values into a string\n// map of int64 pointers\nfunc Int64Map(src map[string]int64) map[string]*int64 {\n\tdst := make(map[string]*int64)\n\tfor k, val := range src {\n\t\tv := val\n\t\tdst[k] = &v\n\t}\n\treturn dst\n}\n\n// Int64ValueMap converts a string map of int64 pointers into a string\n// map of int64 values\nfunc Int64ValueMap(src map[string]*int64) map[string]int64 {\n\tdst := make(map[string]int64)\n\tfor k, val := range src {\n\t\tif val != nil {\n\t\t\tdst[k] = *val\n\t\t}\n\t}\n\treturn dst\n}\n\n// Float64 returns a pointer to the float64 value passed in.\nfunc Float64(v float64) *float64 {\n\treturn &v\n}\n\n// Float64Value returns the value of the float64 pointer passed in or\n// 0 if the pointer is nil.\nfunc Float64Value(v *float64) float64 {\n\tif v != nil {\n\t\treturn *v\n\t}\n\treturn 0\n}\n\n// Float64Slice converts a slice of float64 values into a slice of\n// float64 pointers\nfunc Float64Slice(src []float64) []*float64 {\n\tdst := make([]*float64, len(src))\n\tfor i := 0; i < len(src); i++ {\n\t\tdst[i] = &(src[i])\n\t}\n\treturn dst\n}\n\n// Float64ValueSlice converts a slice of float64 pointers into a slice of\n// float64 values\nfunc Float64ValueSlice(src []*float64) []float64 {\n\tdst := make([]float64, len(src))\n\tfor i := 0; i < len(src); i++ {\n\t\tif src[i] != nil {\n\t\t\tdst[i] = *(src[i])\n\t\t}\n\t}\n\treturn dst\n}\n\n// Float64Map converts a string map of float64 values into a string\n// map of float64 pointers\nfunc Float64Map(src map[string]float64) map[string]*float64 {\n\tdst := make(map[string]*float64)\n\tfor k, val := range src {\n\t\tv := val\n\t\tdst[k] = &v\n\t}\n\treturn dst\n}\n\n// Float64ValueMap converts a string map of float64 pointers into a string\n// map of float64 values\nfunc Float64ValueMap(src map[string]*float64) map[string]float64 {\n\tdst := make(map[string]float64)\n\tfor k, val := range src {\n\t\tif val != nil {\n\t\t\tdst[k] = *val\n\t\t}\n\t}\n\treturn dst\n}\n\n// Time returns a pointer to the time.Time value passed in.\nfunc Time(v time.Time) *time.Time {\n\treturn &v\n}\n\n// TimeValue returns the value of the time.Time pointer passed in or\n// time.Time{} if the pointer is nil.\nfunc TimeValue(v *time.Time) time.Time {\n\tif v != nil {\n\t\treturn *v\n\t}\n\treturn time.Time{}\n}\n\n// TimeUnixMilli returns a Unix timestamp in milliseconds from \"January 1, 1970 UTC\".\n// The result is undefined if the Unix time cannot be represented by an int64.\n// Which includes calling TimeUnixMilli on a zero Time is undefined.\n//\n// This utility is useful for service API's such as CloudWatch Logs which require\n// their unix time values to be in milliseconds.\n//\n// See Go stdlib https://golang.org/pkg/time/#Time.UnixNano for more information.\nfunc TimeUnixMilli(t time.Time) int64 {\n\treturn t.UnixNano() / int64(time.Millisecond/time.Nanosecond)\n}\n\n// TimeSlice converts a slice of time.Time values into a slice of\n// time.Time pointers\nfunc TimeSlice(src []time.Time) []*time.Time {\n\tdst := make([]*time.Time, len(src))\n\tfor i := 0; i < len(src); i++ {\n\t\tdst[i] = &(src[i])\n\t}\n\treturn dst\n}\n\n// TimeValueSlice converts a slice of time.Time pointers into a slice of\n// time.Time values\nfunc TimeValueSlice(src []*time.Time) []time.Time {\n\tdst := make([]time.Time, len(src))\n\tfor i := 0; i < len(src); i++ {\n\t\tif src[i] != nil {\n\t\t\tdst[i] = *(src[i])\n\t\t}\n\t}\n\treturn dst\n}\n\n// TimeMap converts a string map of time.Time values into a string\n// map of time.Time pointers\nfunc TimeMap(src map[string]time.Time) map[string]*time.Time {\n\tdst := make(map[string]*time.Time)\n\tfor k, val := range src {\n\t\tv := val\n\t\tdst[k] = &v\n\t}\n\treturn dst\n}\n\n// TimeValueMap converts a string map of time.Time pointers into a string\n// map of time.Time values\nfunc TimeValueMap(src map[string]*time.Time) map[string]time.Time {\n\tdst := make(map[string]time.Time)\n\tfor k, val := range src {\n\t\tif val != nil {\n\t\t\tdst[k] = *val\n\t\t}\n\t}\n\treturn dst\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go",
    "content": "package corehandlers\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"regexp\"\n\t\"runtime\"\n\t\"strconv\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n)\n\n// Interface for matching types which also have a Len method.\ntype lener interface {\n\tLen() int\n}\n\n// BuildContentLengthHandler builds the content length of a request based on the body,\n// or will use the HTTPRequest.Header's \"Content-Length\" if defined. If unable\n// to determine request body length and no \"Content-Length\" was specified it will panic.\n//\n// The Content-Length will only be aded to the request if the length of the body\n// is greater than 0. If the body is empty or the current `Content-Length`\n// header is <= 0, the header will also be stripped.\nvar BuildContentLengthHandler = request.NamedHandler{Name: \"core.BuildContentLengthHandler\", Fn: func(r *request.Request) {\n\tvar length int64\n\n\tif slength := r.HTTPRequest.Header.Get(\"Content-Length\"); slength != \"\" {\n\t\tlength, _ = strconv.ParseInt(slength, 10, 64)\n\t} else {\n\t\tswitch body := r.Body.(type) {\n\t\tcase nil:\n\t\t\tlength = 0\n\t\tcase lener:\n\t\t\tlength = int64(body.Len())\n\t\tcase io.Seeker:\n\t\t\tr.BodyStart, _ = body.Seek(0, 1)\n\t\t\tend, _ := body.Seek(0, 2)\n\t\t\tbody.Seek(r.BodyStart, 0) // make sure to seek back to original location\n\t\t\tlength = end - r.BodyStart\n\t\tdefault:\n\t\t\tpanic(\"Cannot get length of body, must provide `ContentLength`\")\n\t\t}\n\t}\n\n\tif length > 0 {\n\t\tr.HTTPRequest.ContentLength = length\n\t\tr.HTTPRequest.Header.Set(\"Content-Length\", fmt.Sprintf(\"%d\", length))\n\t} else {\n\t\tr.HTTPRequest.ContentLength = 0\n\t\tr.HTTPRequest.Header.Del(\"Content-Length\")\n\t}\n}}\n\n// SDKVersionUserAgentHandler is a request handler for adding the SDK Version to the user agent.\nvar SDKVersionUserAgentHandler = request.NamedHandler{\n\tName: \"core.SDKVersionUserAgentHandler\",\n\tFn: request.MakeAddToUserAgentHandler(aws.SDKName, aws.SDKVersion,\n\t\truntime.Version(), runtime.GOOS, runtime.GOARCH),\n}\n\nvar reStatusCode = regexp.MustCompile(`^(\\d{3})`)\n\n// SendHandler is a request handler to send service request using HTTP client.\nvar SendHandler = request.NamedHandler{Name: \"core.SendHandler\", Fn: func(r *request.Request) {\n\tvar err error\n\tr.HTTPResponse, err = r.Config.HTTPClient.Do(r.HTTPRequest)\n\tif err != nil {\n\t\t// Prevent leaking if an HTTPResponse was returned. Clean up\n\t\t// the body.\n\t\tif r.HTTPResponse != nil {\n\t\t\tr.HTTPResponse.Body.Close()\n\t\t}\n\t\t// Capture the case where url.Error is returned for error processing\n\t\t// response. e.g. 301 without location header comes back as string\n\t\t// error and r.HTTPResponse is nil. Other url redirect errors will\n\t\t// comeback in a similar method.\n\t\tif e, ok := err.(*url.Error); ok && e.Err != nil {\n\t\t\tif s := reStatusCode.FindStringSubmatch(e.Err.Error()); s != nil {\n\t\t\t\tcode, _ := strconv.ParseInt(s[1], 10, 64)\n\t\t\t\tr.HTTPResponse = &http.Response{\n\t\t\t\t\tStatusCode: int(code),\n\t\t\t\t\tStatus:     http.StatusText(int(code)),\n\t\t\t\t\tBody:       ioutil.NopCloser(bytes.NewReader([]byte{})),\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif r.HTTPResponse == nil {\n\t\t\t// Add a dummy request response object to ensure the HTTPResponse\n\t\t\t// value is consistent.\n\t\t\tr.HTTPResponse = &http.Response{\n\t\t\t\tStatusCode: int(0),\n\t\t\t\tStatus:     http.StatusText(int(0)),\n\t\t\t\tBody:       ioutil.NopCloser(bytes.NewReader([]byte{})),\n\t\t\t}\n\t\t}\n\t\t// Catch all other request errors.\n\t\tr.Error = awserr.New(\"RequestError\", \"send request failed\", err)\n\t\tr.Retryable = aws.Bool(true) // network errors are retryable\n\t}\n}}\n\n// ValidateResponseHandler is a request handler to validate service response.\nvar ValidateResponseHandler = request.NamedHandler{Name: \"core.ValidateResponseHandler\", Fn: func(r *request.Request) {\n\tif r.HTTPResponse.StatusCode == 0 || r.HTTPResponse.StatusCode >= 300 {\n\t\t// this may be replaced by an UnmarshalError handler\n\t\tr.Error = awserr.New(\"UnknownError\", \"unknown error\", nil)\n\t}\n}}\n\n// AfterRetryHandler performs final checks to determine if the request should\n// be retried and how long to delay.\nvar AfterRetryHandler = request.NamedHandler{Name: \"core.AfterRetryHandler\", Fn: func(r *request.Request) {\n\t// If one of the other handlers already set the retry state\n\t// we don't want to override it based on the service's state\n\tif r.Retryable == nil {\n\t\tr.Retryable = aws.Bool(r.ShouldRetry(r))\n\t}\n\n\tif r.WillRetry() {\n\t\tr.RetryDelay = r.RetryRules(r)\n\t\tr.Config.SleepDelay(r.RetryDelay)\n\n\t\t// when the expired token exception occurs the credentials\n\t\t// need to be expired locally so that the next request to\n\t\t// get credentials will trigger a credentials refresh.\n\t\tif r.IsErrorExpired() {\n\t\t\tr.Config.Credentials.Expire()\n\t\t}\n\n\t\tr.RetryCount++\n\t\tr.Error = nil\n\t}\n}}\n\n// ValidateEndpointHandler is a request handler to validate a request had the\n// appropriate Region and Endpoint set. Will set r.Error if the endpoint or\n// region is not valid.\nvar ValidateEndpointHandler = request.NamedHandler{Name: \"core.ValidateEndpointHandler\", Fn: func(r *request.Request) {\n\tif r.ClientInfo.SigningRegion == \"\" && aws.StringValue(r.Config.Region) == \"\" {\n\t\tr.Error = aws.ErrMissingRegion\n\t} else if r.ClientInfo.Endpoint == \"\" {\n\t\tr.Error = aws.ErrMissingEndpoint\n\t}\n}}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go",
    "content": "package corehandlers\n\nimport \"github.com/aws/aws-sdk-go/aws/request\"\n\n// ValidateParametersHandler is a request handler to validate the input parameters.\n// Validating parameters only has meaning if done prior to the request being sent.\nvar ValidateParametersHandler = request.NamedHandler{Name: \"core.ValidateParametersHandler\", Fn: func(r *request.Request) {\n\tif !r.ParamsFilled() {\n\t\treturn\n\t}\n\n\tif v, ok := r.Params.(request.Validator); ok {\n\t\tif err := v.Validate(); err != nil {\n\t\t\tr.Error = err\n\t\t}\n\t}\n}}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go",
    "content": "package credentials\n\nimport (\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n)\n\nvar (\n\t// ErrNoValidProvidersFoundInChain Is returned when there are no valid\n\t// providers in the ChainProvider.\n\t//\n\t// This has been deprecated. For verbose error messaging set\n\t// aws.Config.CredentialsChainVerboseErrors to true\n\t//\n\t// @readonly\n\tErrNoValidProvidersFoundInChain = awserr.New(\"NoCredentialProviders\",\n\t\t`no valid providers in chain. Deprecated. \n\tFor verbose messaging see aws.Config.CredentialsChainVerboseErrors`,\n\t\tnil)\n)\n\n// A ChainProvider will search for a provider which returns credentials\n// and cache that provider until Retrieve is called again.\n//\n// The ChainProvider provides a way of chaining multiple providers together\n// which will pick the first available using priority order of the Providers\n// in the list.\n//\n// If none of the Providers retrieve valid credentials Value, ChainProvider's\n// Retrieve() will return the error ErrNoValidProvidersFoundInChain.\n//\n// If a Provider is found which returns valid credentials Value ChainProvider\n// will cache that Provider for all calls to IsExpired(), until Retrieve is\n// called again.\n//\n// Example of ChainProvider to be used with an EnvProvider and EC2RoleProvider.\n// In this example EnvProvider will first check if any credentials are available\n// vai the environment variables. If there are none ChainProvider will check\n// the next Provider in the list, EC2RoleProvider in this case. If EC2RoleProvider\n// does not return any credentials ChainProvider will return the error\n// ErrNoValidProvidersFoundInChain\n//\n//     creds := NewChainCredentials(\n//         []Provider{\n//             &EnvProvider{},\n//             &EC2RoleProvider{\n//                 Client: ec2metadata.New(sess),\n//             },\n//         })\n//\n//     // Usage of ChainCredentials with aws.Config\n//     svc := ec2.New(&aws.Config{Credentials: creds})\n//\ntype ChainProvider struct {\n\tProviders     []Provider\n\tcurr          Provider\n\tVerboseErrors bool\n}\n\n// NewChainCredentials returns a pointer to a new Credentials object\n// wrapping a chain of providers.\nfunc NewChainCredentials(providers []Provider) *Credentials {\n\treturn NewCredentials(&ChainProvider{\n\t\tProviders: append([]Provider{}, providers...),\n\t})\n}\n\n// Retrieve returns the credentials value or error if no provider returned\n// without error.\n//\n// If a provider is found it will be cached and any calls to IsExpired()\n// will return the expired state of the cached provider.\nfunc (c *ChainProvider) Retrieve() (Value, error) {\n\tvar errs []error\n\tfor _, p := range c.Providers {\n\t\tcreds, err := p.Retrieve()\n\t\tif err == nil {\n\t\t\tc.curr = p\n\t\t\treturn creds, nil\n\t\t}\n\t\terrs = append(errs, err)\n\t}\n\tc.curr = nil\n\n\tvar err error\n\terr = ErrNoValidProvidersFoundInChain\n\tif c.VerboseErrors {\n\t\terr = awserr.NewBatchError(\"NoCredentialProviders\", \"no valid providers in chain\", errs)\n\t}\n\treturn Value{}, err\n}\n\n// IsExpired will returned the expired state of the currently cached provider\n// if there is one.  If there is no current provider, true will be returned.\nfunc (c *ChainProvider) IsExpired() bool {\n\tif c.curr != nil {\n\t\treturn c.curr.IsExpired()\n\t}\n\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go",
    "content": "// Package credentials provides credential retrieval and management\n//\n// The Credentials is the primary method of getting access to and managing\n// credentials Values. Using dependency injection retrieval of the credential\n// values is handled by a object which satisfies the Provider interface.\n//\n// By default the Credentials.Get() will cache the successful result of a\n// Provider's Retrieve() until Provider.IsExpired() returns true. At which\n// point Credentials will call Provider's Retrieve() to get new credential Value.\n//\n// The Provider is responsible for determining when credentials Value have expired.\n// It is also important to note that Credentials will always call Retrieve the\n// first time Credentials.Get() is called.\n//\n// Example of using the environment variable credentials.\n//\n//     creds := NewEnvCredentials()\n//\n//     // Retrieve the credentials value\n//     credValue, err := creds.Get()\n//     if err != nil {\n//         // handle error\n//     }\n//\n// Example of forcing credentials to expire and be refreshed on the next Get().\n// This may be helpful to proactively expire credentials and refresh them sooner\n// than they would naturally expire on their own.\n//\n//     creds := NewCredentials(&EC2RoleProvider{})\n//     creds.Expire()\n//     credsValue, err := creds.Get()\n//     // New credentials will be retrieved instead of from cache.\n//\n//\n// Custom Provider\n//\n// Each Provider built into this package also provides a helper method to generate\n// a Credentials pointer setup with the provider. To use a custom Provider just\n// create a type which satisfies the Provider interface and pass it to the\n// NewCredentials method.\n//\n//     type MyProvider struct{}\n//     func (m *MyProvider) Retrieve() (Value, error) {...}\n//     func (m *MyProvider) IsExpired() bool {...}\n//\n//     creds := NewCredentials(&MyProvider{})\n//     credValue, err := creds.Get()\n//\npackage credentials\n\nimport (\n\t\"sync\"\n\t\"time\"\n)\n\n// AnonymousCredentials is an empty Credential object that can be used as\n// dummy placeholder credentials for requests that do not need signed.\n//\n// This Credentials can be used to configure a service to not sign requests\n// when making service API calls. For example, when accessing public\n// s3 buckets.\n//\n//     svc := s3.New(&aws.Config{Credentials: AnonymousCredentials})\n//     // Access public S3 buckets.\n//\n// @readonly\nvar AnonymousCredentials = NewStaticCredentials(\"\", \"\", \"\")\n\n// A Value is the AWS credentials value for individual credential fields.\ntype Value struct {\n\t// AWS Access key ID\n\tAccessKeyID string\n\n\t// AWS Secret Access Key\n\tSecretAccessKey string\n\n\t// AWS Session Token\n\tSessionToken string\n\n\t// Provider used to get credentials\n\tProviderName string\n}\n\n// A Provider is the interface for any component which will provide credentials\n// Value. A provider is required to manage its own Expired state, and what to\n// be expired means.\n//\n// The Provider should not need to implement its own mutexes, because\n// that will be managed by Credentials.\ntype Provider interface {\n\t// Refresh returns nil if it successfully retrieved the value.\n\t// Error is returned if the value were not obtainable, or empty.\n\tRetrieve() (Value, error)\n\n\t// IsExpired returns if the credentials are no longer valid, and need\n\t// to be retrieved.\n\tIsExpired() bool\n}\n\n// A Expiry provides shared expiration logic to be used by credentials\n// providers to implement expiry functionality.\n//\n// The best method to use this struct is as an anonymous field within the\n// provider's struct.\n//\n// Example:\n//     type EC2RoleProvider struct {\n//         Expiry\n//         ...\n//     }\ntype Expiry struct {\n\t// The date/time when to expire on\n\texpiration time.Time\n\n\t// If set will be used by IsExpired to determine the current time.\n\t// Defaults to time.Now if CurrentTime is not set.  Available for testing\n\t// to be able to mock out the current time.\n\tCurrentTime func() time.Time\n}\n\n// SetExpiration sets the expiration IsExpired will check when called.\n//\n// If window is greater than 0 the expiration time will be reduced by the\n// window value.\n//\n// Using a window is helpful to trigger credentials to expire sooner than\n// the expiration time given to ensure no requests are made with expired\n// tokens.\nfunc (e *Expiry) SetExpiration(expiration time.Time, window time.Duration) {\n\te.expiration = expiration\n\tif window > 0 {\n\t\te.expiration = e.expiration.Add(-window)\n\t}\n}\n\n// IsExpired returns if the credentials are expired.\nfunc (e *Expiry) IsExpired() bool {\n\tif e.CurrentTime == nil {\n\t\te.CurrentTime = time.Now\n\t}\n\treturn e.expiration.Before(e.CurrentTime())\n}\n\n// A Credentials provides synchronous safe retrieval of AWS credentials Value.\n// Credentials will cache the credentials value until they expire. Once the value\n// expires the next Get will attempt to retrieve valid credentials.\n//\n// Credentials is safe to use across multiple goroutines and will manage the\n// synchronous state so the Providers do not need to implement their own\n// synchronization.\n//\n// The first Credentials.Get() will always call Provider.Retrieve() to get the\n// first instance of the credentials Value. All calls to Get() after that\n// will return the cached credentials Value until IsExpired() returns true.\ntype Credentials struct {\n\tcreds        Value\n\tforceRefresh bool\n\tm            sync.Mutex\n\n\tprovider Provider\n}\n\n// NewCredentials returns a pointer to a new Credentials with the provider set.\nfunc NewCredentials(provider Provider) *Credentials {\n\treturn &Credentials{\n\t\tprovider:     provider,\n\t\tforceRefresh: true,\n\t}\n}\n\n// Get returns the credentials value, or error if the credentials Value failed\n// to be retrieved.\n//\n// Will return the cached credentials Value if it has not expired. If the\n// credentials Value has expired the Provider's Retrieve() will be called\n// to refresh the credentials.\n//\n// If Credentials.Expire() was called the credentials Value will be force\n// expired, and the next call to Get() will cause them to be refreshed.\nfunc (c *Credentials) Get() (Value, error) {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\tif c.isExpired() {\n\t\tcreds, err := c.provider.Retrieve()\n\t\tif err != nil {\n\t\t\treturn Value{}, err\n\t\t}\n\t\tc.creds = creds\n\t\tc.forceRefresh = false\n\t}\n\n\treturn c.creds, nil\n}\n\n// Expire expires the credentials and forces them to be retrieved on the\n// next call to Get().\n//\n// This will override the Provider's expired state, and force Credentials\n// to call the Provider's Retrieve().\nfunc (c *Credentials) Expire() {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\tc.forceRefresh = true\n}\n\n// IsExpired returns if the credentials are no longer valid, and need\n// to be retrieved.\n//\n// If the Credentials were forced to be expired with Expire() this will\n// reflect that override.\nfunc (c *Credentials) IsExpired() bool {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\treturn c.isExpired()\n}\n\n// isExpired helper method wrapping the definition of expired credentials.\nfunc (c *Credentials) isExpired() bool {\n\treturn c.forceRefresh || c.provider.IsExpired()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go",
    "content": "package ec2rolecreds\n\nimport (\n\t\"bufio\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"path\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/client\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n\t\"github.com/aws/aws-sdk-go/aws/ec2metadata\"\n)\n\n// ProviderName provides a name of EC2Role provider\nconst ProviderName = \"EC2RoleProvider\"\n\n// A EC2RoleProvider retrieves credentials from the EC2 service, and keeps track if\n// those credentials are expired.\n//\n// Example how to configure the EC2RoleProvider with custom http Client, Endpoint\n// or ExpiryWindow\n//\n//     p := &ec2rolecreds.EC2RoleProvider{\n//         // Pass in a custom timeout to be used when requesting\n//         // IAM EC2 Role credentials.\n//         Client: ec2metadata.New(sess, aws.Config{\n//             HTTPClient: &http.Client{Timeout: 10 * time.Second},\n//         }),\n//\n//         // Do not use early expiry of credentials. If a non zero value is\n//         // specified the credentials will be expired early\n//         ExpiryWindow: 0,\n//     }\ntype EC2RoleProvider struct {\n\tcredentials.Expiry\n\n\t// Required EC2Metadata client to use when connecting to EC2 metadata service.\n\tClient *ec2metadata.EC2Metadata\n\n\t// ExpiryWindow will allow the credentials to trigger refreshing prior to\n\t// the credentials actually expiring. This is beneficial so race conditions\n\t// with expiring credentials do not cause request to fail unexpectedly\n\t// due to ExpiredTokenException exceptions.\n\t//\n\t// So a ExpiryWindow of 10s would cause calls to IsExpired() to return true\n\t// 10 seconds before the credentials are actually expired.\n\t//\n\t// If ExpiryWindow is 0 or less it will be ignored.\n\tExpiryWindow time.Duration\n}\n\n// NewCredentials returns a pointer to a new Credentials object wrapping\n// the EC2RoleProvider. Takes a ConfigProvider to create a EC2Metadata client.\n// The ConfigProvider is satisfied by the session.Session type.\nfunc NewCredentials(c client.ConfigProvider, options ...func(*EC2RoleProvider)) *credentials.Credentials {\n\tp := &EC2RoleProvider{\n\t\tClient: ec2metadata.New(c),\n\t}\n\n\tfor _, option := range options {\n\t\toption(p)\n\t}\n\n\treturn credentials.NewCredentials(p)\n}\n\n// NewCredentialsWithClient returns a pointer to a new Credentials object wrapping\n// the EC2RoleProvider. Takes a EC2Metadata client to use when connecting to EC2\n// metadata service.\nfunc NewCredentialsWithClient(client *ec2metadata.EC2Metadata, options ...func(*EC2RoleProvider)) *credentials.Credentials {\n\tp := &EC2RoleProvider{\n\t\tClient: client,\n\t}\n\n\tfor _, option := range options {\n\t\toption(p)\n\t}\n\n\treturn credentials.NewCredentials(p)\n}\n\n// Retrieve retrieves credentials from the EC2 service.\n// Error will be returned if the request fails, or unable to extract\n// the desired credentials.\nfunc (m *EC2RoleProvider) Retrieve() (credentials.Value, error) {\n\tcredsList, err := requestCredList(m.Client)\n\tif err != nil {\n\t\treturn credentials.Value{ProviderName: ProviderName}, err\n\t}\n\n\tif len(credsList) == 0 {\n\t\treturn credentials.Value{ProviderName: ProviderName}, awserr.New(\"EmptyEC2RoleList\", \"empty EC2 Role list\", nil)\n\t}\n\tcredsName := credsList[0]\n\n\troleCreds, err := requestCred(m.Client, credsName)\n\tif err != nil {\n\t\treturn credentials.Value{ProviderName: ProviderName}, err\n\t}\n\n\tm.SetExpiration(roleCreds.Expiration, m.ExpiryWindow)\n\n\treturn credentials.Value{\n\t\tAccessKeyID:     roleCreds.AccessKeyID,\n\t\tSecretAccessKey: roleCreds.SecretAccessKey,\n\t\tSessionToken:    roleCreds.Token,\n\t\tProviderName:    ProviderName,\n\t}, nil\n}\n\n// A ec2RoleCredRespBody provides the shape for unmarshalling credential\n// request responses.\ntype ec2RoleCredRespBody struct {\n\t// Success State\n\tExpiration      time.Time\n\tAccessKeyID     string\n\tSecretAccessKey string\n\tToken           string\n\n\t// Error state\n\tCode    string\n\tMessage string\n}\n\nconst iamSecurityCredsPath = \"/iam/security-credentials\"\n\n// requestCredList requests a list of credentials from the EC2 service.\n// If there are no credentials, or there is an error making or receiving the request\nfunc requestCredList(client *ec2metadata.EC2Metadata) ([]string, error) {\n\tresp, err := client.GetMetadata(iamSecurityCredsPath)\n\tif err != nil {\n\t\treturn nil, awserr.New(\"EC2RoleRequestError\", \"no EC2 instance role found\", err)\n\t}\n\n\tcredsList := []string{}\n\ts := bufio.NewScanner(strings.NewReader(resp))\n\tfor s.Scan() {\n\t\tcredsList = append(credsList, s.Text())\n\t}\n\n\tif err := s.Err(); err != nil {\n\t\treturn nil, awserr.New(\"SerializationError\", \"failed to read EC2 instance role from metadata service\", err)\n\t}\n\n\treturn credsList, nil\n}\n\n// requestCred requests the credentials for a specific credentials from the EC2 service.\n//\n// If the credentials cannot be found, or there is an error reading the response\n// and error will be returned.\nfunc requestCred(client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCredRespBody, error) {\n\tresp, err := client.GetMetadata(path.Join(iamSecurityCredsPath, credsName))\n\tif err != nil {\n\t\treturn ec2RoleCredRespBody{},\n\t\t\tawserr.New(\"EC2RoleRequestError\",\n\t\t\t\tfmt.Sprintf(\"failed to get %s EC2 instance role credentials\", credsName),\n\t\t\t\terr)\n\t}\n\n\trespCreds := ec2RoleCredRespBody{}\n\tif err := json.NewDecoder(strings.NewReader(resp)).Decode(&respCreds); err != nil {\n\t\treturn ec2RoleCredRespBody{},\n\t\t\tawserr.New(\"SerializationError\",\n\t\t\t\tfmt.Sprintf(\"failed to decode %s EC2 instance role credentials\", credsName),\n\t\t\t\terr)\n\t}\n\n\tif respCreds.Code != \"Success\" {\n\t\t// If an error code was returned something failed requesting the role.\n\t\treturn ec2RoleCredRespBody{}, awserr.New(respCreds.Code, respCreds.Message, nil)\n\t}\n\n\treturn respCreds, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go",
    "content": "// Package endpointcreds provides support for retrieving credentials from an\n// arbitrary HTTP endpoint.\n//\n// The credentials endpoint Provider can receive both static and refreshable\n// credentials that will expire. Credentials are static when an \"Expiration\"\n// value is not provided in the endpoint's response.\n//\n// Static credentials will never expire once they have been retrieved. The format\n// of the static credentials response:\n//    {\n//        \"AccessKeyId\" : \"MUA...\",\n//        \"SecretAccessKey\" : \"/7PC5om....\",\n//    }\n//\n// Refreshable credentials will expire within the \"ExpiryWindow\" of the Expiration\n// value in the response. The format of the refreshable credentials response:\n//    {\n//        \"AccessKeyId\" : \"MUA...\",\n//        \"SecretAccessKey\" : \"/7PC5om....\",\n//        \"Token\" : \"AQoDY....=\",\n//        \"Expiration\" : \"2016-02-25T06:03:31Z\"\n//    }\n//\n// Errors should be returned in the following format and only returned with 400\n// or 500 HTTP status codes.\n//    {\n//        \"code\": \"ErrorCode\",\n//        \"message\": \"Helpful error message.\"\n//    }\npackage endpointcreds\n\nimport (\n\t\"encoding/json\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/client\"\n\t\"github.com/aws/aws-sdk-go/aws/client/metadata\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n)\n\n// ProviderName is the name of the credentials provider.\nconst ProviderName = `CredentialsEndpointProvider`\n\n// Provider satisfies the credentials.Provider interface, and is a client to\n// retrieve credentials from an arbitrary endpoint.\ntype Provider struct {\n\tstaticCreds bool\n\tcredentials.Expiry\n\n\t// Requires a AWS Client to make HTTP requests to the endpoint with.\n\t// the Endpoint the request will be made to is provided by the aws.Config's\n\t// Endpoint value.\n\tClient *client.Client\n\n\t// ExpiryWindow will allow the credentials to trigger refreshing prior to\n\t// the credentials actually expiring. This is beneficial so race conditions\n\t// with expiring credentials do not cause request to fail unexpectedly\n\t// due to ExpiredTokenException exceptions.\n\t//\n\t// So a ExpiryWindow of 10s would cause calls to IsExpired() to return true\n\t// 10 seconds before the credentials are actually expired.\n\t//\n\t// If ExpiryWindow is 0 or less it will be ignored.\n\tExpiryWindow time.Duration\n}\n\n// NewProviderClient returns a credentials Provider for retrieving AWS credentials\n// from arbitrary endpoint.\nfunc NewProviderClient(cfg aws.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) credentials.Provider {\n\tp := &Provider{\n\t\tClient: client.New(\n\t\t\tcfg,\n\t\t\tmetadata.ClientInfo{\n\t\t\t\tServiceName: \"CredentialsEndpoint\",\n\t\t\t\tEndpoint:    endpoint,\n\t\t\t},\n\t\t\thandlers,\n\t\t),\n\t}\n\n\tp.Client.Handlers.Unmarshal.PushBack(unmarshalHandler)\n\tp.Client.Handlers.UnmarshalError.PushBack(unmarshalError)\n\tp.Client.Handlers.Validate.Clear()\n\tp.Client.Handlers.Validate.PushBack(validateEndpointHandler)\n\n\tfor _, option := range options {\n\t\toption(p)\n\t}\n\n\treturn p\n}\n\n// NewCredentialsClient returns a Credentials wrapper for retrieving credentials\n// from an arbitrary endpoint concurrently. The client will request the\nfunc NewCredentialsClient(cfg aws.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) *credentials.Credentials {\n\treturn credentials.NewCredentials(NewProviderClient(cfg, handlers, endpoint, options...))\n}\n\n// IsExpired returns true if the credentials retrieved are expired, or not yet\n// retrieved.\nfunc (p *Provider) IsExpired() bool {\n\tif p.staticCreds {\n\t\treturn false\n\t}\n\treturn p.Expiry.IsExpired()\n}\n\n// Retrieve will attempt to request the credentials from the endpoint the Provider\n// was configured for. And error will be returned if the retrieval fails.\nfunc (p *Provider) Retrieve() (credentials.Value, error) {\n\tresp, err := p.getCredentials()\n\tif err != nil {\n\t\treturn credentials.Value{ProviderName: ProviderName},\n\t\t\tawserr.New(\"CredentialsEndpointError\", \"failed to load credentials\", err)\n\t}\n\n\tif resp.Expiration != nil {\n\t\tp.SetExpiration(*resp.Expiration, p.ExpiryWindow)\n\t} else {\n\t\tp.staticCreds = true\n\t}\n\n\treturn credentials.Value{\n\t\tAccessKeyID:     resp.AccessKeyID,\n\t\tSecretAccessKey: resp.SecretAccessKey,\n\t\tSessionToken:    resp.Token,\n\t\tProviderName:    ProviderName,\n\t}, nil\n}\n\ntype getCredentialsOutput struct {\n\tExpiration      *time.Time\n\tAccessKeyID     string\n\tSecretAccessKey string\n\tToken           string\n}\n\ntype errorOutput struct {\n\tCode    string `json:\"code\"`\n\tMessage string `json:\"message\"`\n}\n\nfunc (p *Provider) getCredentials() (*getCredentialsOutput, error) {\n\top := &request.Operation{\n\t\tName:       \"GetCredentials\",\n\t\tHTTPMethod: \"GET\",\n\t}\n\n\tout := &getCredentialsOutput{}\n\treq := p.Client.NewRequest(op, nil, out)\n\treq.HTTPRequest.Header.Set(\"Accept\", \"application/json\")\n\n\treturn out, req.Send()\n}\n\nfunc validateEndpointHandler(r *request.Request) {\n\tif len(r.ClientInfo.Endpoint) == 0 {\n\t\tr.Error = aws.ErrMissingEndpoint\n\t}\n}\n\nfunc unmarshalHandler(r *request.Request) {\n\tdefer r.HTTPResponse.Body.Close()\n\n\tout := r.Data.(*getCredentialsOutput)\n\tif err := json.NewDecoder(r.HTTPResponse.Body).Decode(&out); err != nil {\n\t\tr.Error = awserr.New(\"SerializationError\",\n\t\t\t\"failed to decode endpoint credentials\",\n\t\t\terr,\n\t\t)\n\t}\n}\n\nfunc unmarshalError(r *request.Request) {\n\tdefer r.HTTPResponse.Body.Close()\n\n\tvar errOut errorOutput\n\tif err := json.NewDecoder(r.HTTPResponse.Body).Decode(&errOut); err != nil {\n\t\tr.Error = awserr.New(\"SerializationError\",\n\t\t\t\"failed to decode endpoint credentials\",\n\t\t\terr,\n\t\t)\n\t}\n\n\t// Response body format is not consistent between metadata endpoints.\n\t// Grab the error message as a string and include that as the source error\n\tr.Error = awserr.New(errOut.Code, errOut.Message, nil)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go",
    "content": "package credentials\n\nimport (\n\t\"os\"\n\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n)\n\n// EnvProviderName provides a name of Env provider\nconst EnvProviderName = \"EnvProvider\"\n\nvar (\n\t// ErrAccessKeyIDNotFound is returned when the AWS Access Key ID can't be\n\t// found in the process's environment.\n\t//\n\t// @readonly\n\tErrAccessKeyIDNotFound = awserr.New(\"EnvAccessKeyNotFound\", \"AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment\", nil)\n\n\t// ErrSecretAccessKeyNotFound is returned when the AWS Secret Access Key\n\t// can't be found in the process's environment.\n\t//\n\t// @readonly\n\tErrSecretAccessKeyNotFound = awserr.New(\"EnvSecretNotFound\", \"AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment\", nil)\n)\n\n// A EnvProvider retrieves credentials from the environment variables of the\n// running process. Environment credentials never expire.\n//\n// Environment variables used:\n//\n// * Access Key ID:     AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY\n// * Secret Access Key: AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY\ntype EnvProvider struct {\n\tretrieved bool\n}\n\n// NewEnvCredentials returns a pointer to a new Credentials object\n// wrapping the environment variable provider.\nfunc NewEnvCredentials() *Credentials {\n\treturn NewCredentials(&EnvProvider{})\n}\n\n// Retrieve retrieves the keys from the environment.\nfunc (e *EnvProvider) Retrieve() (Value, error) {\n\te.retrieved = false\n\n\tid := os.Getenv(\"AWS_ACCESS_KEY_ID\")\n\tif id == \"\" {\n\t\tid = os.Getenv(\"AWS_ACCESS_KEY\")\n\t}\n\n\tsecret := os.Getenv(\"AWS_SECRET_ACCESS_KEY\")\n\tif secret == \"\" {\n\t\tsecret = os.Getenv(\"AWS_SECRET_KEY\")\n\t}\n\n\tif id == \"\" {\n\t\treturn Value{ProviderName: EnvProviderName}, ErrAccessKeyIDNotFound\n\t}\n\n\tif secret == \"\" {\n\t\treturn Value{ProviderName: EnvProviderName}, ErrSecretAccessKeyNotFound\n\t}\n\n\te.retrieved = true\n\treturn Value{\n\t\tAccessKeyID:     id,\n\t\tSecretAccessKey: secret,\n\t\tSessionToken:    os.Getenv(\"AWS_SESSION_TOKEN\"),\n\t\tProviderName:    EnvProviderName,\n\t}, nil\n}\n\n// IsExpired returns if the credentials have been retrieved.\nfunc (e *EnvProvider) IsExpired() bool {\n\treturn !e.retrieved\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/credentials/example.ini",
    "content": "[default]\naws_access_key_id = accessKey\naws_secret_access_key = secret\naws_session_token = token\n\n[no_token]\naws_access_key_id = accessKey\naws_secret_access_key = secret\n\n[with_colon]\naws_access_key_id: accessKey\naws_secret_access_key: secret\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go",
    "content": "package credentials\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/go-ini/ini\"\n\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n)\n\n// SharedCredsProviderName provides a name of SharedCreds provider\nconst SharedCredsProviderName = \"SharedCredentialsProvider\"\n\nvar (\n\t// ErrSharedCredentialsHomeNotFound is emitted when the user directory cannot be found.\n\t//\n\t// @readonly\n\tErrSharedCredentialsHomeNotFound = awserr.New(\"UserHomeNotFound\", \"user home directory not found.\", nil)\n)\n\n// A SharedCredentialsProvider retrieves credentials from the current user's home\n// directory, and keeps track if those credentials are expired.\n//\n// Profile ini file example: $HOME/.aws/credentials\ntype SharedCredentialsProvider struct {\n\t// Path to the shared credentials file.\n\t//\n\t// If empty will look for \"AWS_SHARED_CREDENTIALS_FILE\" env variable. If the\n\t// env value is empty will default to current user's home directory.\n\t// Linux/OSX: \"$HOME/.aws/credentials\"\n\t// Windows:   \"%USERPROFILE%\\.aws\\credentials\"\n\tFilename string\n\n\t// AWS Profile to extract credentials from the shared credentials file. If empty\n\t// will default to environment variable \"AWS_PROFILE\" or \"default\" if\n\t// environment variable is also not set.\n\tProfile string\n\n\t// retrieved states if the credentials have been successfully retrieved.\n\tretrieved bool\n}\n\n// NewSharedCredentials returns a pointer to a new Credentials object\n// wrapping the Profile file provider.\nfunc NewSharedCredentials(filename, profile string) *Credentials {\n\treturn NewCredentials(&SharedCredentialsProvider{\n\t\tFilename: filename,\n\t\tProfile:  profile,\n\t})\n}\n\n// Retrieve reads and extracts the shared credentials from the current\n// users home directory.\nfunc (p *SharedCredentialsProvider) Retrieve() (Value, error) {\n\tp.retrieved = false\n\n\tfilename, err := p.filename()\n\tif err != nil {\n\t\treturn Value{ProviderName: SharedCredsProviderName}, err\n\t}\n\n\tcreds, err := loadProfile(filename, p.profile())\n\tif err != nil {\n\t\treturn Value{ProviderName: SharedCredsProviderName}, err\n\t}\n\n\tp.retrieved = true\n\treturn creds, nil\n}\n\n// IsExpired returns if the shared credentials have expired.\nfunc (p *SharedCredentialsProvider) IsExpired() bool {\n\treturn !p.retrieved\n}\n\n// loadProfiles loads from the file pointed to by shared credentials filename for profile.\n// The credentials retrieved from the profile will be returned or error. Error will be\n// returned if it fails to read from the file, or the data is invalid.\nfunc loadProfile(filename, profile string) (Value, error) {\n\tconfig, err := ini.Load(filename)\n\tif err != nil {\n\t\treturn Value{ProviderName: SharedCredsProviderName}, awserr.New(\"SharedCredsLoad\", \"failed to load shared credentials file\", err)\n\t}\n\tiniProfile, err := config.GetSection(profile)\n\tif err != nil {\n\t\treturn Value{ProviderName: SharedCredsProviderName}, awserr.New(\"SharedCredsLoad\", \"failed to get profile\", err)\n\t}\n\n\tid, err := iniProfile.GetKey(\"aws_access_key_id\")\n\tif err != nil {\n\t\treturn Value{ProviderName: SharedCredsProviderName}, awserr.New(\"SharedCredsAccessKey\",\n\t\t\tfmt.Sprintf(\"shared credentials %s in %s did not contain aws_access_key_id\", profile, filename),\n\t\t\terr)\n\t}\n\n\tsecret, err := iniProfile.GetKey(\"aws_secret_access_key\")\n\tif err != nil {\n\t\treturn Value{ProviderName: SharedCredsProviderName}, awserr.New(\"SharedCredsSecret\",\n\t\t\tfmt.Sprintf(\"shared credentials %s in %s did not contain aws_secret_access_key\", profile, filename),\n\t\t\tnil)\n\t}\n\n\t// Default to empty string if not found\n\ttoken := iniProfile.Key(\"aws_session_token\")\n\n\treturn Value{\n\t\tAccessKeyID:     id.String(),\n\t\tSecretAccessKey: secret.String(),\n\t\tSessionToken:    token.String(),\n\t\tProviderName:    SharedCredsProviderName,\n\t}, nil\n}\n\n// filename returns the filename to use to read AWS shared credentials.\n//\n// Will return an error if the user's home directory path cannot be found.\nfunc (p *SharedCredentialsProvider) filename() (string, error) {\n\tif p.Filename == \"\" {\n\t\tif p.Filename = os.Getenv(\"AWS_SHARED_CREDENTIALS_FILE\"); p.Filename != \"\" {\n\t\t\treturn p.Filename, nil\n\t\t}\n\n\t\thomeDir := os.Getenv(\"HOME\") // *nix\n\t\tif homeDir == \"\" {           // Windows\n\t\t\thomeDir = os.Getenv(\"USERPROFILE\")\n\t\t}\n\t\tif homeDir == \"\" {\n\t\t\treturn \"\", ErrSharedCredentialsHomeNotFound\n\t\t}\n\n\t\tp.Filename = filepath.Join(homeDir, \".aws\", \"credentials\")\n\t}\n\n\treturn p.Filename, nil\n}\n\n// profile returns the AWS shared credentials profile.  If empty will read\n// environment variable \"AWS_PROFILE\". If that is not set profile will\n// return \"default\".\nfunc (p *SharedCredentialsProvider) profile() string {\n\tif p.Profile == \"\" {\n\t\tp.Profile = os.Getenv(\"AWS_PROFILE\")\n\t}\n\tif p.Profile == \"\" {\n\t\tp.Profile = \"default\"\n\t}\n\n\treturn p.Profile\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go",
    "content": "package credentials\n\nimport (\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n)\n\n// StaticProviderName provides a name of Static provider\nconst StaticProviderName = \"StaticProvider\"\n\nvar (\n\t// ErrStaticCredentialsEmpty is emitted when static credentials are empty.\n\t//\n\t// @readonly\n\tErrStaticCredentialsEmpty = awserr.New(\"EmptyStaticCreds\", \"static credentials are empty\", nil)\n)\n\n// A StaticProvider is a set of credentials which are set programmatically,\n// and will never expire.\ntype StaticProvider struct {\n\tValue\n}\n\n// NewStaticCredentials returns a pointer to a new Credentials object\n// wrapping a static credentials value provider.\nfunc NewStaticCredentials(id, secret, token string) *Credentials {\n\treturn NewCredentials(&StaticProvider{Value: Value{\n\t\tAccessKeyID:     id,\n\t\tSecretAccessKey: secret,\n\t\tSessionToken:    token,\n\t}})\n}\n\n// NewStaticCredentialsFromCreds returns a pointer to a new Credentials object\n// wrapping the static credentials value provide. Same as NewStaticCredentials\n// but takes the creds Value instead of individual fields\nfunc NewStaticCredentialsFromCreds(creds Value) *Credentials {\n\treturn NewCredentials(&StaticProvider{Value: creds})\n}\n\n// Retrieve returns the credentials or error if the credentials are invalid.\nfunc (s *StaticProvider) Retrieve() (Value, error) {\n\tif s.AccessKeyID == \"\" || s.SecretAccessKey == \"\" {\n\t\treturn Value{ProviderName: StaticProviderName}, ErrStaticCredentialsEmpty\n\t}\n\n\tif len(s.Value.ProviderName) == 0 {\n\t\ts.Value.ProviderName = StaticProviderName\n\t}\n\treturn s.Value, nil\n}\n\n// IsExpired returns if the credentials are expired.\n//\n// For StaticProvider, the credentials never expired.\nfunc (s *StaticProvider) IsExpired() bool {\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go",
    "content": "// Package stscreds are credential Providers to retrieve STS AWS credentials.\n//\n// STS provides multiple ways to retrieve credentials which can be used when making\n// future AWS service API operation calls.\npackage stscreds\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/client\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n\t\"github.com/aws/aws-sdk-go/service/sts\"\n)\n\n// ProviderName provides a name of AssumeRole provider\nconst ProviderName = \"AssumeRoleProvider\"\n\n// AssumeRoler represents the minimal subset of the STS client API used by this provider.\ntype AssumeRoler interface {\n\tAssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error)\n}\n\n// DefaultDuration is the default amount of time in minutes that the credentials\n// will be valid for.\nvar DefaultDuration = time.Duration(15) * time.Minute\n\n// AssumeRoleProvider retrieves temporary credentials from the STS service, and\n// keeps track of their expiration time. This provider must be used explicitly,\n// as it is not included in the credentials chain.\ntype AssumeRoleProvider struct {\n\tcredentials.Expiry\n\n\t// STS client to make assume role request with.\n\tClient AssumeRoler\n\n\t// Role to be assumed.\n\tRoleARN string\n\n\t// Session name, if you wish to reuse the credentials elsewhere.\n\tRoleSessionName string\n\n\t// Expiry duration of the STS credentials. Defaults to 15 minutes if not set.\n\tDuration time.Duration\n\n\t// Optional ExternalID to pass along, defaults to nil if not set.\n\tExternalID *string\n\n\t// The policy plain text must be 2048 bytes or shorter. However, an internal\n\t// conversion compresses it into a packed binary format with a separate limit.\n\t// The PackedPolicySize response element indicates by percentage how close to\n\t// the upper size limit the policy is, with 100% equaling the maximum allowed\n\t// size.\n\tPolicy *string\n\n\t// The identification number of the MFA device that is associated with the user\n\t// who is making the AssumeRole call. Specify this value if the trust policy\n\t// of the role being assumed includes a condition that requires MFA authentication.\n\t// The value is either the serial number for a hardware device (such as GAHT12345678)\n\t// or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user).\n\tSerialNumber *string\n\n\t// The value provided by the MFA device, if the trust policy of the role being\n\t// assumed requires MFA (that is, if the policy includes a condition that tests\n\t// for MFA). If the role being assumed requires MFA and if the TokenCode value\n\t// is missing or expired, the AssumeRole call returns an \"access denied\" error.\n\tTokenCode *string\n\n\t// ExpiryWindow will allow the credentials to trigger refreshing prior to\n\t// the credentials actually expiring. This is beneficial so race conditions\n\t// with expiring credentials do not cause request to fail unexpectedly\n\t// due to ExpiredTokenException exceptions.\n\t//\n\t// So a ExpiryWindow of 10s would cause calls to IsExpired() to return true\n\t// 10 seconds before the credentials are actually expired.\n\t//\n\t// If ExpiryWindow is 0 or less it will be ignored.\n\tExpiryWindow time.Duration\n}\n\n// NewCredentials returns a pointer to a new Credentials object wrapping the\n// AssumeRoleProvider. The credentials will expire every 15 minutes and the\n// role will be named after a nanosecond timestamp of this operation.\n//\n// Takes a Config provider to create the STS client. The ConfigProvider is\n// satisfied by the session.Session type.\nfunc NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials {\n\tp := &AssumeRoleProvider{\n\t\tClient:   sts.New(c),\n\t\tRoleARN:  roleARN,\n\t\tDuration: DefaultDuration,\n\t}\n\n\tfor _, option := range options {\n\t\toption(p)\n\t}\n\n\treturn credentials.NewCredentials(p)\n}\n\n// NewCredentialsWithClient returns a pointer to a new Credentials object wrapping the\n// AssumeRoleProvider. The credentials will expire every 15 minutes and the\n// role will be named after a nanosecond timestamp of this operation.\n//\n// Takes an AssumeRoler which can be satisfiede by the STS client.\nfunc NewCredentialsWithClient(svc AssumeRoler, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials {\n\tp := &AssumeRoleProvider{\n\t\tClient:   svc,\n\t\tRoleARN:  roleARN,\n\t\tDuration: DefaultDuration,\n\t}\n\n\tfor _, option := range options {\n\t\toption(p)\n\t}\n\n\treturn credentials.NewCredentials(p)\n}\n\n// Retrieve generates a new set of temporary credentials using STS.\nfunc (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) {\n\n\t// Apply defaults where parameters are not set.\n\tif p.RoleSessionName == \"\" {\n\t\t// Try to work out a role name that will hopefully end up unique.\n\t\tp.RoleSessionName = fmt.Sprintf(\"%d\", time.Now().UTC().UnixNano())\n\t}\n\tif p.Duration == 0 {\n\t\t// Expire as often as AWS permits.\n\t\tp.Duration = DefaultDuration\n\t}\n\tinput := &sts.AssumeRoleInput{\n\t\tDurationSeconds: aws.Int64(int64(p.Duration / time.Second)),\n\t\tRoleArn:         aws.String(p.RoleARN),\n\t\tRoleSessionName: aws.String(p.RoleSessionName),\n\t\tExternalId:      p.ExternalID,\n\t}\n\tif p.Policy != nil {\n\t\tinput.Policy = p.Policy\n\t}\n\tif p.SerialNumber != nil && p.TokenCode != nil {\n\t\tinput.SerialNumber = p.SerialNumber\n\t\tinput.TokenCode = p.TokenCode\n\t}\n\troleOutput, err := p.Client.AssumeRole(input)\n\n\tif err != nil {\n\t\treturn credentials.Value{ProviderName: ProviderName}, err\n\t}\n\n\t// We will proactively generate new credentials before they expire.\n\tp.SetExpiration(*roleOutput.Credentials.Expiration, p.ExpiryWindow)\n\n\treturn credentials.Value{\n\t\tAccessKeyID:     *roleOutput.Credentials.AccessKeyId,\n\t\tSecretAccessKey: *roleOutput.Credentials.SecretAccessKey,\n\t\tSessionToken:    *roleOutput.Credentials.SessionToken,\n\t\tProviderName:    ProviderName,\n\t}, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go",
    "content": "// Package defaults is a collection of helpers to retrieve the SDK's default\n// configuration and handlers.\n//\n// Generally this package shouldn't be used directly, but session.Session\n// instead. This package is useful when you need to reset the defaults\n// of a session or service client to the SDK defaults before setting\n// additional parameters.\npackage defaults\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/corehandlers\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials/endpointcreds\"\n\t\"github.com/aws/aws-sdk-go/aws/ec2metadata\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n\t\"github.com/aws/aws-sdk-go/private/endpoints\"\n)\n\n// A Defaults provides a collection of default values for SDK clients.\ntype Defaults struct {\n\tConfig   *aws.Config\n\tHandlers request.Handlers\n}\n\n// Get returns the SDK's default values with Config and handlers pre-configured.\nfunc Get() Defaults {\n\tcfg := Config()\n\thandlers := Handlers()\n\tcfg.Credentials = CredChain(cfg, handlers)\n\n\treturn Defaults{\n\t\tConfig:   cfg,\n\t\tHandlers: handlers,\n\t}\n}\n\n// Config returns the default configuration without credentials.\n// To retrieve a config with credentials also included use\n// `defaults.Get().Config` instead.\n//\n// Generally you shouldn't need to use this method directly, but\n// is available if you need to reset the configuration of an\n// existing service client or session.\nfunc Config() *aws.Config {\n\treturn aws.NewConfig().\n\t\tWithCredentials(credentials.AnonymousCredentials).\n\t\tWithRegion(os.Getenv(\"AWS_REGION\")).\n\t\tWithHTTPClient(http.DefaultClient).\n\t\tWithMaxRetries(aws.UseServiceDefaultRetries).\n\t\tWithLogger(aws.NewDefaultLogger()).\n\t\tWithLogLevel(aws.LogOff).\n\t\tWithSleepDelay(time.Sleep)\n}\n\n// Handlers returns the default request handlers.\n//\n// Generally you shouldn't need to use this method directly, but\n// is available if you need to reset the request handlers of an\n// existing service client or session.\nfunc Handlers() request.Handlers {\n\tvar handlers request.Handlers\n\n\thandlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler)\n\thandlers.Validate.AfterEachFn = request.HandlerListStopOnError\n\thandlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler)\n\thandlers.Build.AfterEachFn = request.HandlerListStopOnError\n\thandlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler)\n\thandlers.Send.PushBackNamed(corehandlers.SendHandler)\n\thandlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler)\n\thandlers.ValidateResponse.PushBackNamed(corehandlers.ValidateResponseHandler)\n\n\treturn handlers\n}\n\n// CredChain returns the default credential chain.\n//\n// Generally you shouldn't need to use this method directly, but\n// is available if you need to reset the credentials of an\n// existing service client or session's Config.\nfunc CredChain(cfg *aws.Config, handlers request.Handlers) *credentials.Credentials {\n\treturn credentials.NewCredentials(&credentials.ChainProvider{\n\t\tVerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors),\n\t\tProviders: []credentials.Provider{\n\t\t\t&credentials.EnvProvider{},\n\t\t\t&credentials.SharedCredentialsProvider{Filename: \"\", Profile: \"\"},\n\t\t\tRemoteCredProvider(*cfg, handlers),\n\t\t},\n\t})\n}\n\n// RemoteCredProvider returns a credenitials provider for the default remote\n// endpoints such as EC2 or ECS Roles.\nfunc RemoteCredProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider {\n\tecsCredURI := os.Getenv(\"AWS_CONTAINER_CREDENTIALS_RELATIVE_URI\")\n\n\tif len(ecsCredURI) > 0 {\n\t\treturn ecsCredProvider(cfg, handlers, ecsCredURI)\n\t}\n\n\treturn ec2RoleProvider(cfg, handlers)\n}\n\nfunc ecsCredProvider(cfg aws.Config, handlers request.Handlers, uri string) credentials.Provider {\n\tconst host = `169.254.170.2`\n\n\treturn endpointcreds.NewProviderClient(cfg, handlers,\n\t\tfmt.Sprintf(\"http://%s%s\", host, uri),\n\t\tfunc(p *endpointcreds.Provider) {\n\t\t\tp.ExpiryWindow = 5 * time.Minute\n\t\t},\n\t)\n}\n\nfunc ec2RoleProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider {\n\tendpoint, signingRegion := endpoints.EndpointForRegion(ec2metadata.ServiceName,\n\t\taws.StringValue(cfg.Region), true, false)\n\n\treturn &ec2rolecreds.EC2RoleProvider{\n\t\tClient:       ec2metadata.NewClient(cfg, handlers, endpoint, signingRegion),\n\t\tExpiryWindow: 5 * time.Minute,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go",
    "content": "package ec2metadata\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"path\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n)\n\n// GetMetadata uses the path provided to request information from the EC2\n// instance metdata service. The content will be returned as a string, or\n// error if the request failed.\nfunc (c *EC2Metadata) GetMetadata(p string) (string, error) {\n\top := &request.Operation{\n\t\tName:       \"GetMetadata\",\n\t\tHTTPMethod: \"GET\",\n\t\tHTTPPath:   path.Join(\"/\", \"meta-data\", p),\n\t}\n\n\toutput := &metadataOutput{}\n\treq := c.NewRequest(op, nil, output)\n\n\treturn output.Content, req.Send()\n}\n\n// GetDynamicData uses the path provided to request information from the EC2\n// instance metadata service for dynamic data. The content will be returned\n// as a string, or error if the request failed.\nfunc (c *EC2Metadata) GetDynamicData(p string) (string, error) {\n\top := &request.Operation{\n\t\tName:       \"GetDynamicData\",\n\t\tHTTPMethod: \"GET\",\n\t\tHTTPPath:   path.Join(\"/\", \"dynamic\", p),\n\t}\n\n\toutput := &metadataOutput{}\n\treq := c.NewRequest(op, nil, output)\n\n\treturn output.Content, req.Send()\n}\n\n// GetInstanceIdentityDocument retrieves an identity document describing an\n// instance. Error is returned if the request fails or is unable to parse\n// the response.\nfunc (c *EC2Metadata) GetInstanceIdentityDocument() (EC2InstanceIdentityDocument, error) {\n\tresp, err := c.GetDynamicData(\"instance-identity/document\")\n\tif err != nil {\n\t\treturn EC2InstanceIdentityDocument{},\n\t\t\tawserr.New(\"EC2MetadataRequestError\",\n\t\t\t\t\"failed to get EC2 instance identity document\", err)\n\t}\n\n\tdoc := EC2InstanceIdentityDocument{}\n\tif err := json.NewDecoder(strings.NewReader(resp)).Decode(&doc); err != nil {\n\t\treturn EC2InstanceIdentityDocument{},\n\t\t\tawserr.New(\"SerializationError\",\n\t\t\t\t\"failed to decode EC2 instance identity document\", err)\n\t}\n\n\treturn doc, nil\n}\n\n// IAMInfo retrieves IAM info from the metadata API\nfunc (c *EC2Metadata) IAMInfo() (EC2IAMInfo, error) {\n\tresp, err := c.GetMetadata(\"iam/info\")\n\tif err != nil {\n\t\treturn EC2IAMInfo{},\n\t\t\tawserr.New(\"EC2MetadataRequestError\",\n\t\t\t\t\"failed to get EC2 IAM info\", err)\n\t}\n\n\tinfo := EC2IAMInfo{}\n\tif err := json.NewDecoder(strings.NewReader(resp)).Decode(&info); err != nil {\n\t\treturn EC2IAMInfo{},\n\t\t\tawserr.New(\"SerializationError\",\n\t\t\t\t\"failed to decode EC2 IAM info\", err)\n\t}\n\n\tif info.Code != \"Success\" {\n\t\terrMsg := fmt.Sprintf(\"failed to get EC2 IAM Info (%s)\", info.Code)\n\t\treturn EC2IAMInfo{},\n\t\t\tawserr.New(\"EC2MetadataError\", errMsg, nil)\n\t}\n\n\treturn info, nil\n}\n\n// Region returns the region the instance is running in.\nfunc (c *EC2Metadata) Region() (string, error) {\n\tresp, err := c.GetMetadata(\"placement/availability-zone\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// returns region without the suffix. Eg: us-west-2a becomes us-west-2\n\treturn resp[:len(resp)-1], nil\n}\n\n// Available returns if the application has access to the EC2 Metadata service.\n// Can be used to determine if application is running within an EC2 Instance and\n// the metadata service is available.\nfunc (c *EC2Metadata) Available() bool {\n\tif _, err := c.GetMetadata(\"instance-id\"); err != nil {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\n// An EC2IAMInfo provides the shape for unmarshalling\n// an IAM info from the metadata API\ntype EC2IAMInfo struct {\n\tCode               string\n\tLastUpdated        time.Time\n\tInstanceProfileArn string\n\tInstanceProfileID  string\n}\n\n// An EC2InstanceIdentityDocument provides the shape for unmarshalling\n// an instance identity document\ntype EC2InstanceIdentityDocument struct {\n\tDevpayProductCodes []string  `json:\"devpayProductCodes\"`\n\tAvailabilityZone   string    `json:\"availabilityZone\"`\n\tPrivateIP          string    `json:\"privateIp\"`\n\tVersion            string    `json:\"version\"`\n\tRegion             string    `json:\"region\"`\n\tInstanceID         string    `json:\"instanceId\"`\n\tBillingProducts    []string  `json:\"billingProducts\"`\n\tInstanceType       string    `json:\"instanceType\"`\n\tAccountID          string    `json:\"accountId\"`\n\tPendingTime        time.Time `json:\"pendingTime\"`\n\tImageID            string    `json:\"imageId\"`\n\tKernelID           string    `json:\"kernelId\"`\n\tRamdiskID          string    `json:\"ramdiskId\"`\n\tArchitecture       string    `json:\"architecture\"`\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go",
    "content": "// Package ec2metadata provides the client for making API calls to the\n// EC2 Metadata service.\npackage ec2metadata\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/client\"\n\t\"github.com/aws/aws-sdk-go/aws/client/metadata\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n)\n\n// ServiceName is the name of the service.\nconst ServiceName = \"ec2metadata\"\n\n// A EC2Metadata is an EC2 Metadata service Client.\ntype EC2Metadata struct {\n\t*client.Client\n}\n\n// New creates a new instance of the EC2Metadata client with a session.\n// This client is safe to use across multiple goroutines.\n//\n//\n// Example:\n//     // Create a EC2Metadata client from just a session.\n//     svc := ec2metadata.New(mySession)\n//\n//     // Create a EC2Metadata client with additional configuration\n//     svc := ec2metadata.New(mySession, aws.NewConfig().WithLogLevel(aws.LogDebugHTTPBody))\nfunc New(p client.ConfigProvider, cfgs ...*aws.Config) *EC2Metadata {\n\tc := p.ClientConfig(ServiceName, cfgs...)\n\treturn NewClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)\n}\n\n// NewClient returns a new EC2Metadata client. Should be used to create\n// a client when not using a session. Generally using just New with a session\n// is preferred.\n//\n// If an unmodified HTTP client is provided from the stdlib default, or no client\n// the EC2RoleProvider's EC2Metadata HTTP client's timeout will be shortened.\n// To disable this set Config.EC2MetadataDisableTimeoutOverride to false. Enabled by default.\nfunc NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string, opts ...func(*client.Client)) *EC2Metadata {\n\tif !aws.BoolValue(cfg.EC2MetadataDisableTimeoutOverride) && httpClientZero(cfg.HTTPClient) {\n\t\t// If the http client is unmodified and this feature is not disabled\n\t\t// set custom timeouts for EC2Metadata requests.\n\t\tcfg.HTTPClient = &http.Client{\n\t\t\t// use a shorter timeout than default because the metadata\n\t\t\t// service is local if it is running, and to fail faster\n\t\t\t// if not running on an ec2 instance.\n\t\t\tTimeout: 5 * time.Second,\n\t\t}\n\t}\n\n\tsvc := &EC2Metadata{\n\t\tClient: client.New(\n\t\t\tcfg,\n\t\t\tmetadata.ClientInfo{\n\t\t\t\tServiceName: ServiceName,\n\t\t\t\tEndpoint:    endpoint,\n\t\t\t\tAPIVersion:  \"latest\",\n\t\t\t},\n\t\t\thandlers,\n\t\t),\n\t}\n\n\tsvc.Handlers.Unmarshal.PushBack(unmarshalHandler)\n\tsvc.Handlers.UnmarshalError.PushBack(unmarshalError)\n\tsvc.Handlers.Validate.Clear()\n\tsvc.Handlers.Validate.PushBack(validateEndpointHandler)\n\n\t// Add additional options to the service config\n\tfor _, option := range opts {\n\t\toption(svc.Client)\n\t}\n\n\treturn svc\n}\n\nfunc httpClientZero(c *http.Client) bool {\n\treturn c == nil || (c.Transport == nil && c.CheckRedirect == nil && c.Jar == nil && c.Timeout == 0)\n}\n\ntype metadataOutput struct {\n\tContent string\n}\n\nfunc unmarshalHandler(r *request.Request) {\n\tdefer r.HTTPResponse.Body.Close()\n\tb := &bytes.Buffer{}\n\tif _, err := io.Copy(b, r.HTTPResponse.Body); err != nil {\n\t\tr.Error = awserr.New(\"SerializationError\", \"unable to unmarshal EC2 metadata respose\", err)\n\t\treturn\n\t}\n\n\tif data, ok := r.Data.(*metadataOutput); ok {\n\t\tdata.Content = b.String()\n\t}\n}\n\nfunc unmarshalError(r *request.Request) {\n\tdefer r.HTTPResponse.Body.Close()\n\tb := &bytes.Buffer{}\n\tif _, err := io.Copy(b, r.HTTPResponse.Body); err != nil {\n\t\tr.Error = awserr.New(\"SerializationError\", \"unable to unmarshal EC2 metadata error respose\", err)\n\t\treturn\n\t}\n\n\t// Response body format is not consistent between metadata endpoints.\n\t// Grab the error message as a string and include that as the source error\n\tr.Error = awserr.New(\"EC2MetadataError\", \"failed to make EC2Metadata request\", errors.New(b.String()))\n}\n\nfunc validateEndpointHandler(r *request.Request) {\n\tif r.ClientInfo.Endpoint == \"\" {\n\t\tr.Error = aws.ErrMissingEndpoint\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/errors.go",
    "content": "package aws\n\nimport \"github.com/aws/aws-sdk-go/aws/awserr\"\n\nvar (\n\t// ErrMissingRegion is an error that is returned if region configuration is\n\t// not found.\n\t//\n\t// @readonly\n\tErrMissingRegion = awserr.New(\"MissingRegion\", \"could not find region configuration\", nil)\n\n\t// ErrMissingEndpoint is an error that is returned if an endpoint cannot be\n\t// resolved for a service.\n\t//\n\t// @readonly\n\tErrMissingEndpoint = awserr.New(\"MissingEndpoint\", \"'Endpoint' configuration is required for this service\", nil)\n)\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/logger.go",
    "content": "package aws\n\nimport (\n\t\"log\"\n\t\"os\"\n)\n\n// A LogLevelType defines the level logging should be performed at. Used to instruct\n// the SDK which statements should be logged.\ntype LogLevelType uint\n\n// LogLevel returns the pointer to a LogLevel. Should be used to workaround\n// not being able to take the address of a non-composite literal.\nfunc LogLevel(l LogLevelType) *LogLevelType {\n\treturn &l\n}\n\n// Value returns the LogLevel value or the default value LogOff if the LogLevel\n// is nil. Safe to use on nil value LogLevelTypes.\nfunc (l *LogLevelType) Value() LogLevelType {\n\tif l != nil {\n\t\treturn *l\n\t}\n\treturn LogOff\n}\n\n// Matches returns true if the v LogLevel is enabled by this LogLevel. Should be\n// used with logging sub levels. Is safe to use on nil value LogLevelTypes. If\n// LogLevel is nill, will default to LogOff comparison.\nfunc (l *LogLevelType) Matches(v LogLevelType) bool {\n\tc := l.Value()\n\treturn c&v == v\n}\n\n// AtLeast returns true if this LogLevel is at least high enough to satisfies v.\n// Is safe to use on nil value LogLevelTypes. If LogLevel is nill, will default\n// to LogOff comparison.\nfunc (l *LogLevelType) AtLeast(v LogLevelType) bool {\n\tc := l.Value()\n\treturn c >= v\n}\n\nconst (\n\t// LogOff states that no logging should be performed by the SDK. This is the\n\t// default state of the SDK, and should be use to disable all logging.\n\tLogOff LogLevelType = iota * 0x1000\n\n\t// LogDebug state that debug output should be logged by the SDK. This should\n\t// be used to inspect request made and responses received.\n\tLogDebug\n)\n\n// Debug Logging Sub Levels\nconst (\n\t// LogDebugWithSigning states that the SDK should log request signing and\n\t// presigning events. This should be used to log the signing details of\n\t// requests for debugging. Will also enable LogDebug.\n\tLogDebugWithSigning LogLevelType = LogDebug | (1 << iota)\n\n\t// LogDebugWithHTTPBody states the SDK should log HTTP request and response\n\t// HTTP bodys in addition to the headers and path. This should be used to\n\t// see the body content of requests and responses made while using the SDK\n\t// Will also enable LogDebug.\n\tLogDebugWithHTTPBody\n\n\t// LogDebugWithRequestRetries states the SDK should log when service requests will\n\t// be retried. This should be used to log when you want to log when service\n\t// requests are being retried. Will also enable LogDebug.\n\tLogDebugWithRequestRetries\n\n\t// LogDebugWithRequestErrors states the SDK should log when service requests fail\n\t// to build, send, validate, or unmarshal.\n\tLogDebugWithRequestErrors\n)\n\n// A Logger is a minimalistic interface for the SDK to log messages to. Should\n// be used to provide custom logging writers for the SDK to use.\ntype Logger interface {\n\tLog(...interface{})\n}\n\n// A LoggerFunc is a convenience type to convert a function taking a variadic\n// list of arguments and wrap it so the Logger interface can be used.\n//\n// Example:\n//     s3.New(sess, &aws.Config{Logger: aws.LoggerFunc(func(args ...interface{}) {\n//         fmt.Fprintln(os.Stdout, args...)\n//     })})\ntype LoggerFunc func(...interface{})\n\n// Log calls the wrapped function with the arguments provided\nfunc (f LoggerFunc) Log(args ...interface{}) {\n\tf(args...)\n}\n\n// NewDefaultLogger returns a Logger which will write log messages to stdout, and\n// use same formatting runes as the stdlib log.Logger\nfunc NewDefaultLogger() Logger {\n\treturn &defaultLogger{\n\t\tlogger: log.New(os.Stdout, \"\", log.LstdFlags),\n\t}\n}\n\n// A defaultLogger provides a minimalistic logger satisfying the Logger interface.\ntype defaultLogger struct {\n\tlogger *log.Logger\n}\n\n// Log logs the parameters to the stdlib logger. See log.Println.\nfunc (l defaultLogger) Log(args ...interface{}) {\n\tl.logger.Println(args...)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go",
    "content": "package request\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// A Handlers provides a collection of request handlers for various\n// stages of handling requests.\ntype Handlers struct {\n\tValidate         HandlerList\n\tBuild            HandlerList\n\tSign             HandlerList\n\tSend             HandlerList\n\tValidateResponse HandlerList\n\tUnmarshal        HandlerList\n\tUnmarshalMeta    HandlerList\n\tUnmarshalError   HandlerList\n\tRetry            HandlerList\n\tAfterRetry       HandlerList\n}\n\n// Copy returns of this handler's lists.\nfunc (h *Handlers) Copy() Handlers {\n\treturn Handlers{\n\t\tValidate:         h.Validate.copy(),\n\t\tBuild:            h.Build.copy(),\n\t\tSign:             h.Sign.copy(),\n\t\tSend:             h.Send.copy(),\n\t\tValidateResponse: h.ValidateResponse.copy(),\n\t\tUnmarshal:        h.Unmarshal.copy(),\n\t\tUnmarshalError:   h.UnmarshalError.copy(),\n\t\tUnmarshalMeta:    h.UnmarshalMeta.copy(),\n\t\tRetry:            h.Retry.copy(),\n\t\tAfterRetry:       h.AfterRetry.copy(),\n\t}\n}\n\n// Clear removes callback functions for all handlers\nfunc (h *Handlers) Clear() {\n\th.Validate.Clear()\n\th.Build.Clear()\n\th.Send.Clear()\n\th.Sign.Clear()\n\th.Unmarshal.Clear()\n\th.UnmarshalMeta.Clear()\n\th.UnmarshalError.Clear()\n\th.ValidateResponse.Clear()\n\th.Retry.Clear()\n\th.AfterRetry.Clear()\n}\n\n// A HandlerListRunItem represents an entry in the HandlerList which\n// is being run.\ntype HandlerListRunItem struct {\n\tIndex   int\n\tHandler NamedHandler\n\tRequest *Request\n}\n\n// A HandlerList manages zero or more handlers in a list.\ntype HandlerList struct {\n\tlist []NamedHandler\n\n\t// Called after each request handler in the list is called. If set\n\t// and the func returns true the HandlerList will continue to iterate\n\t// over the request handlers. If false is returned the HandlerList\n\t// will stop iterating.\n\t//\n\t// Should be used if extra logic to be performed between each handler\n\t// in the list. This can be used to terminate a list's iteration\n\t// based on a condition such as error like, HandlerListStopOnError.\n\t// Or for logging like HandlerListLogItem.\n\tAfterEachFn func(item HandlerListRunItem) bool\n}\n\n// A NamedHandler is a struct that contains a name and function callback.\ntype NamedHandler struct {\n\tName string\n\tFn   func(*Request)\n}\n\n// copy creates a copy of the handler list.\nfunc (l *HandlerList) copy() HandlerList {\n\tn := HandlerList{\n\t\tAfterEachFn: l.AfterEachFn,\n\t}\n\tn.list = append([]NamedHandler{}, l.list...)\n\treturn n\n}\n\n// Clear clears the handler list.\nfunc (l *HandlerList) Clear() {\n\tl.list = []NamedHandler{}\n}\n\n// Len returns the number of handlers in the list.\nfunc (l *HandlerList) Len() int {\n\treturn len(l.list)\n}\n\n// PushBack pushes handler f to the back of the handler list.\nfunc (l *HandlerList) PushBack(f func(*Request)) {\n\tl.list = append(l.list, NamedHandler{\"__anonymous\", f})\n}\n\n// PushFront pushes handler f to the front of the handler list.\nfunc (l *HandlerList) PushFront(f func(*Request)) {\n\tl.list = append([]NamedHandler{{\"__anonymous\", f}}, l.list...)\n}\n\n// PushBackNamed pushes named handler f to the back of the handler list.\nfunc (l *HandlerList) PushBackNamed(n NamedHandler) {\n\tl.list = append(l.list, n)\n}\n\n// PushFrontNamed pushes named handler f to the front of the handler list.\nfunc (l *HandlerList) PushFrontNamed(n NamedHandler) {\n\tl.list = append([]NamedHandler{n}, l.list...)\n}\n\n// Remove removes a NamedHandler n\nfunc (l *HandlerList) Remove(n NamedHandler) {\n\tnewlist := []NamedHandler{}\n\tfor _, m := range l.list {\n\t\tif m.Name != n.Name {\n\t\t\tnewlist = append(newlist, m)\n\t\t}\n\t}\n\tl.list = newlist\n}\n\n// Run executes all handlers in the list with a given request object.\nfunc (l *HandlerList) Run(r *Request) {\n\tfor i, h := range l.list {\n\t\th.Fn(r)\n\t\titem := HandlerListRunItem{\n\t\t\tIndex: i, Handler: h, Request: r,\n\t\t}\n\t\tif l.AfterEachFn != nil && !l.AfterEachFn(item) {\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// HandlerListLogItem logs the request handler and the state of the\n// request's Error value. Always returns true to continue iterating\n// request handlers in a HandlerList.\nfunc HandlerListLogItem(item HandlerListRunItem) bool {\n\tif item.Request.Config.Logger == nil {\n\t\treturn true\n\t}\n\titem.Request.Config.Logger.Log(\"DEBUG: RequestHandler\",\n\t\titem.Index, item.Handler.Name, item.Request.Error)\n\n\treturn true\n}\n\n// HandlerListStopOnError returns false to stop the HandlerList iterating\n// over request handlers if Request.Error is not nil. True otherwise\n// to continue iterating.\nfunc HandlerListStopOnError(item HandlerListRunItem) bool {\n\treturn item.Request.Error == nil\n}\n\n// MakeAddToUserAgentHandler will add the name/version pair to the User-Agent request\n// header. If the extra parameters are provided they will be added as metadata to the\n// name/version pair resulting in the following format.\n// \"name/version (extra0; extra1; ...)\"\n// The user agent part will be concatenated with this current request's user agent string.\nfunc MakeAddToUserAgentHandler(name, version string, extra ...string) func(*Request) {\n\tua := fmt.Sprintf(\"%s/%s\", name, version)\n\tif len(extra) > 0 {\n\t\tua += fmt.Sprintf(\" (%s)\", strings.Join(extra, \"; \"))\n\t}\n\treturn func(r *Request) {\n\t\tAddToUserAgent(r, ua)\n\t}\n}\n\n// MakeAddToUserAgentFreeFormHandler adds the input to the User-Agent request header.\n// The input string will be concatenated with the current request's user agent string.\nfunc MakeAddToUserAgentFreeFormHandler(s string) func(*Request) {\n\treturn func(r *Request) {\n\t\tAddToUserAgent(r, s)\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/request/http_request.go",
    "content": "// +build go1.5\n\npackage request\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\nfunc copyHTTPRequest(r *http.Request, body io.ReadCloser) *http.Request {\n\treq := &http.Request{\n\t\tURL:           &url.URL{},\n\t\tHeader:        http.Header{},\n\t\tClose:         r.Close,\n\t\tBody:          body,\n\t\tHost:          r.Host,\n\t\tMethod:        r.Method,\n\t\tProto:         r.Proto,\n\t\tContentLength: r.ContentLength,\n\t\t// Cancel will be deprecated in 1.7 and will be replaced with Context\n\t\tCancel: r.Cancel,\n\t}\n\n\t*req.URL = *r.URL\n\tfor k, v := range r.Header {\n\t\tfor _, vv := range v {\n\t\t\treq.Header.Add(k, vv)\n\t\t}\n\t}\n\n\treturn req\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/request/http_request_1_4.go",
    "content": "// +build !go1.5\n\npackage request\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\nfunc copyHTTPRequest(r *http.Request, body io.ReadCloser) *http.Request {\n\treq := &http.Request{\n\t\tURL:           &url.URL{},\n\t\tHeader:        http.Header{},\n\t\tClose:         r.Close,\n\t\tBody:          body,\n\t\tHost:          r.Host,\n\t\tMethod:        r.Method,\n\t\tProto:         r.Proto,\n\t\tContentLength: r.ContentLength,\n\t}\n\n\t*req.URL = *r.URL\n\tfor k, v := range r.Header {\n\t\tfor _, vv := range v {\n\t\t\treq.Header.Add(k, vv)\n\t\t}\n\t}\n\n\treturn req\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go",
    "content": "package request\n\nimport (\n\t\"io\"\n\t\"sync\"\n)\n\n// offsetReader is a thread-safe io.ReadCloser to prevent racing\n// with retrying requests\ntype offsetReader struct {\n\tbuf    io.ReadSeeker\n\tlock   sync.RWMutex\n\tclosed bool\n}\n\nfunc newOffsetReader(buf io.ReadSeeker, offset int64) *offsetReader {\n\treader := &offsetReader{}\n\tbuf.Seek(offset, 0)\n\n\treader.buf = buf\n\treturn reader\n}\n\n// Close is a thread-safe close. Uses the write lock.\nfunc (o *offsetReader) Close() error {\n\to.lock.Lock()\n\tdefer o.lock.Unlock()\n\to.closed = true\n\treturn nil\n}\n\n// Read is a thread-safe read using a read lock.\nfunc (o *offsetReader) Read(p []byte) (int, error) {\n\to.lock.RLock()\n\tdefer o.lock.RUnlock()\n\n\tif o.closed {\n\t\treturn 0, io.EOF\n\t}\n\n\treturn o.buf.Read(p)\n}\n\n// CloseAndCopy will return a new offsetReader with a copy of the old buffer\n// and close the old buffer.\nfunc (o *offsetReader) CloseAndCopy(offset int64) *offsetReader {\n\to.Close()\n\treturn newOffsetReader(o.buf, offset)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/request/request.go",
    "content": "package request\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/client/metadata\"\n)\n\n// A Request is the service request to be made.\ntype Request struct {\n\tConfig     aws.Config\n\tClientInfo metadata.ClientInfo\n\tHandlers   Handlers\n\n\tRetryer\n\tTime             time.Time\n\tExpireTime       time.Duration\n\tOperation        *Operation\n\tHTTPRequest      *http.Request\n\tHTTPResponse     *http.Response\n\tBody             io.ReadSeeker\n\tBodyStart        int64 // offset from beginning of Body that the request body starts\n\tParams           interface{}\n\tError            error\n\tData             interface{}\n\tRequestID        string\n\tRetryCount       int\n\tRetryable        *bool\n\tRetryDelay       time.Duration\n\tNotHoist         bool\n\tSignedHeaderVals http.Header\n\tLastSignedAt     time.Time\n\n\tbuilt bool\n}\n\n// An Operation is the service API operation to be made.\ntype Operation struct {\n\tName       string\n\tHTTPMethod string\n\tHTTPPath   string\n\t*Paginator\n}\n\n// Paginator keeps track of pagination configuration for an API operation.\ntype Paginator struct {\n\tInputTokens     []string\n\tOutputTokens    []string\n\tLimitToken      string\n\tTruncationToken string\n}\n\n// New returns a new Request pointer for the service API\n// operation and parameters.\n//\n// Params is any value of input parameters to be the request payload.\n// Data is pointer value to an object which the request's response\n// payload will be deserialized to.\nfunc New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers,\n\tretryer Retryer, operation *Operation, params interface{}, data interface{}) *Request {\n\n\tmethod := operation.HTTPMethod\n\tif method == \"\" {\n\t\tmethod = \"POST\"\n\t}\n\n\thttpReq, _ := http.NewRequest(method, \"\", nil)\n\n\tvar err error\n\thttpReq.URL, err = url.Parse(clientInfo.Endpoint + operation.HTTPPath)\n\tif err != nil {\n\t\thttpReq.URL = &url.URL{}\n\t\terr = awserr.New(\"InvalidEndpointURL\", \"invalid endpoint uri\", err)\n\t}\n\n\tr := &Request{\n\t\tConfig:     cfg,\n\t\tClientInfo: clientInfo,\n\t\tHandlers:   handlers.Copy(),\n\n\t\tRetryer:     retryer,\n\t\tTime:        time.Now(),\n\t\tExpireTime:  0,\n\t\tOperation:   operation,\n\t\tHTTPRequest: httpReq,\n\t\tBody:        nil,\n\t\tParams:      params,\n\t\tError:       err,\n\t\tData:        data,\n\t}\n\tr.SetBufferBody([]byte{})\n\n\treturn r\n}\n\n// WillRetry returns if the request's can be retried.\nfunc (r *Request) WillRetry() bool {\n\treturn r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries()\n}\n\n// ParamsFilled returns if the request's parameters have been populated\n// and the parameters are valid. False is returned if no parameters are\n// provided or invalid.\nfunc (r *Request) ParamsFilled() bool {\n\treturn r.Params != nil && reflect.ValueOf(r.Params).Elem().IsValid()\n}\n\n// DataFilled returns true if the request's data for response deserialization\n// target has been set and is a valid. False is returned if data is not\n// set, or is invalid.\nfunc (r *Request) DataFilled() bool {\n\treturn r.Data != nil && reflect.ValueOf(r.Data).Elem().IsValid()\n}\n\n// SetBufferBody will set the request's body bytes that will be sent to\n// the service API.\nfunc (r *Request) SetBufferBody(buf []byte) {\n\tr.SetReaderBody(bytes.NewReader(buf))\n}\n\n// SetStringBody sets the body of the request to be backed by a string.\nfunc (r *Request) SetStringBody(s string) {\n\tr.SetReaderBody(strings.NewReader(s))\n}\n\n// SetReaderBody will set the request's body reader.\nfunc (r *Request) SetReaderBody(reader io.ReadSeeker) {\n\tr.HTTPRequest.Body = newOffsetReader(reader, 0)\n\tr.Body = reader\n}\n\n// Presign returns the request's signed URL. Error will be returned\n// if the signing fails.\nfunc (r *Request) Presign(expireTime time.Duration) (string, error) {\n\tr.ExpireTime = expireTime\n\tr.NotHoist = false\n\tr.Sign()\n\tif r.Error != nil {\n\t\treturn \"\", r.Error\n\t}\n\treturn r.HTTPRequest.URL.String(), nil\n}\n\n// PresignRequest behaves just like presign, but hoists all headers and signs them.\n// Also returns the signed hash back to the user\nfunc (r *Request) PresignRequest(expireTime time.Duration) (string, http.Header, error) {\n\tr.ExpireTime = expireTime\n\tr.NotHoist = true\n\tr.Sign()\n\tif r.Error != nil {\n\t\treturn \"\", nil, r.Error\n\t}\n\treturn r.HTTPRequest.URL.String(), r.SignedHeaderVals, nil\n}\n\nfunc debugLogReqError(r *Request, stage string, retrying bool, err error) {\n\tif !r.Config.LogLevel.Matches(aws.LogDebugWithRequestErrors) {\n\t\treturn\n\t}\n\n\tretryStr := \"not retrying\"\n\tif retrying {\n\t\tretryStr = \"will retry\"\n\t}\n\n\tr.Config.Logger.Log(fmt.Sprintf(\"DEBUG: %s %s/%s failed, %s, error %v\",\n\t\tstage, r.ClientInfo.ServiceName, r.Operation.Name, retryStr, err))\n}\n\n// Build will build the request's object so it can be signed and sent\n// to the service. Build will also validate all the request's parameters.\n// Anny additional build Handlers set on this request will be run\n// in the order they were set.\n//\n// The request will only be built once. Multiple calls to build will have\n// no effect.\n//\n// If any Validate or Build errors occur the build will stop and the error\n// which occurred will be returned.\nfunc (r *Request) Build() error {\n\tif !r.built {\n\t\tr.Handlers.Validate.Run(r)\n\t\tif r.Error != nil {\n\t\t\tdebugLogReqError(r, \"Validate Request\", false, r.Error)\n\t\t\treturn r.Error\n\t\t}\n\t\tr.Handlers.Build.Run(r)\n\t\tif r.Error != nil {\n\t\t\tdebugLogReqError(r, \"Build Request\", false, r.Error)\n\t\t\treturn r.Error\n\t\t}\n\t\tr.built = true\n\t}\n\n\treturn r.Error\n}\n\n// Sign will sign the request returning error if errors are encountered.\n//\n// Send will build the request prior to signing. All Sign Handlers will\n// be executed in the order they were set.\nfunc (r *Request) Sign() error {\n\tr.Build()\n\tif r.Error != nil {\n\t\tdebugLogReqError(r, \"Build Request\", false, r.Error)\n\t\treturn r.Error\n\t}\n\n\tr.Handlers.Sign.Run(r)\n\treturn r.Error\n}\n\n// Send will send the request returning error if errors are encountered.\n//\n// Send will sign the request prior to sending. All Send Handlers will\n// be executed in the order they were set.\n//\n// Canceling a request is non-deterministic. If a request has been canceled,\n// then the transport will choose, randomly, one of the state channels during\n// reads or getting the connection.\n//\n// readLoop() and getConn(req *Request, cm connectMethod)\n// https://github.com/golang/go/blob/master/src/net/http/transport.go\nfunc (r *Request) Send() error {\n\tfor {\n\t\tif aws.BoolValue(r.Retryable) {\n\t\t\tif r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) {\n\t\t\t\tr.Config.Logger.Log(fmt.Sprintf(\"DEBUG: Retrying Request %s/%s, attempt %d\",\n\t\t\t\t\tr.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount))\n\t\t\t}\n\n\t\t\tvar body io.ReadCloser\n\t\t\tif reader, ok := r.HTTPRequest.Body.(*offsetReader); ok {\n\t\t\t\tbody = reader.CloseAndCopy(r.BodyStart)\n\t\t\t} else {\n\t\t\t\tif r.Config.Logger != nil {\n\t\t\t\t\tr.Config.Logger.Log(\"Request body type has been overwritten. May cause race conditions\")\n\t\t\t\t}\n\t\t\t\tr.Body.Seek(r.BodyStart, 0)\n\t\t\t\tbody = ioutil.NopCloser(r.Body)\n\t\t\t}\n\n\t\t\tr.HTTPRequest = copyHTTPRequest(r.HTTPRequest, body)\n\t\t\tif r.HTTPResponse != nil && r.HTTPResponse.Body != nil {\n\t\t\t\t// Closing response body. Since we are setting a new request to send off, this\n\t\t\t\t// response will get squashed and leaked.\n\t\t\t\tr.HTTPResponse.Body.Close()\n\t\t\t}\n\t\t}\n\n\t\tr.Sign()\n\t\tif r.Error != nil {\n\t\t\treturn r.Error\n\t\t}\n\n\t\tr.Retryable = nil\n\n\t\tr.Handlers.Send.Run(r)\n\t\tif r.Error != nil {\n\t\t\tif strings.Contains(r.Error.Error(), \"net/http: request canceled\") {\n\t\t\t\treturn r.Error\n\t\t\t}\n\n\t\t\terr := r.Error\n\t\t\tr.Handlers.Retry.Run(r)\n\t\t\tr.Handlers.AfterRetry.Run(r)\n\t\t\tif r.Error != nil {\n\t\t\t\tdebugLogReqError(r, \"Send Request\", false, r.Error)\n\t\t\t\treturn r.Error\n\t\t\t}\n\t\t\tdebugLogReqError(r, \"Send Request\", true, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tr.Handlers.UnmarshalMeta.Run(r)\n\t\tr.Handlers.ValidateResponse.Run(r)\n\t\tif r.Error != nil {\n\t\t\terr := r.Error\n\t\t\tr.Handlers.UnmarshalError.Run(r)\n\t\t\tr.Handlers.Retry.Run(r)\n\t\t\tr.Handlers.AfterRetry.Run(r)\n\t\t\tif r.Error != nil {\n\t\t\t\tdebugLogReqError(r, \"Validate Response\", false, r.Error)\n\t\t\t\treturn r.Error\n\t\t\t}\n\t\t\tdebugLogReqError(r, \"Validate Response\", true, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tr.Handlers.Unmarshal.Run(r)\n\t\tif r.Error != nil {\n\t\t\terr := r.Error\n\t\t\tr.Handlers.Retry.Run(r)\n\t\t\tr.Handlers.AfterRetry.Run(r)\n\t\t\tif r.Error != nil {\n\t\t\t\tdebugLogReqError(r, \"Unmarshal Response\", false, r.Error)\n\t\t\t\treturn r.Error\n\t\t\t}\n\t\t\tdebugLogReqError(r, \"Unmarshal Response\", true, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tbreak\n\t}\n\n\treturn nil\n}\n\n// AddToUserAgent adds the string to the end of the request's current user agent.\nfunc AddToUserAgent(r *Request, s string) {\n\tcurUA := r.HTTPRequest.Header.Get(\"User-Agent\")\n\tif len(curUA) > 0 {\n\t\ts = curUA + \" \" + s\n\t}\n\tr.HTTPRequest.Header.Set(\"User-Agent\", s)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go",
    "content": "package request\n\nimport (\n\t\"reflect\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/awsutil\"\n)\n\n//type Paginater interface {\n//\tHasNextPage() bool\n//\tNextPage() *Request\n//\tEachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error\n//}\n\n// HasNextPage returns true if this request has more pages of data available.\nfunc (r *Request) HasNextPage() bool {\n\treturn len(r.nextPageTokens()) > 0\n}\n\n// nextPageTokens returns the tokens to use when asking for the next page of\n// data.\nfunc (r *Request) nextPageTokens() []interface{} {\n\tif r.Operation.Paginator == nil {\n\t\treturn nil\n\t}\n\n\tif r.Operation.TruncationToken != \"\" {\n\t\ttr, _ := awsutil.ValuesAtPath(r.Data, r.Operation.TruncationToken)\n\t\tif len(tr) == 0 {\n\t\t\treturn nil\n\t\t}\n\n\t\tswitch v := tr[0].(type) {\n\t\tcase *bool:\n\t\t\tif !aws.BoolValue(v) {\n\t\t\t\treturn nil\n\t\t\t}\n\t\tcase bool:\n\t\t\tif v == false {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\n\ttokens := []interface{}{}\n\ttokenAdded := false\n\tfor _, outToken := range r.Operation.OutputTokens {\n\t\tv, _ := awsutil.ValuesAtPath(r.Data, outToken)\n\t\tif len(v) > 0 {\n\t\t\ttokens = append(tokens, v[0])\n\t\t\ttokenAdded = true\n\t\t} else {\n\t\t\ttokens = append(tokens, nil)\n\t\t}\n\t}\n\tif !tokenAdded {\n\t\treturn nil\n\t}\n\n\treturn tokens\n}\n\n// NextPage returns a new Request that can be executed to return the next\n// page of result data. Call .Send() on this request to execute it.\nfunc (r *Request) NextPage() *Request {\n\ttokens := r.nextPageTokens()\n\tif len(tokens) == 0 {\n\t\treturn nil\n\t}\n\n\tdata := reflect.New(reflect.TypeOf(r.Data).Elem()).Interface()\n\tnr := New(r.Config, r.ClientInfo, r.Handlers, r.Retryer, r.Operation, awsutil.CopyOf(r.Params), data)\n\tfor i, intok := range nr.Operation.InputTokens {\n\t\tawsutil.SetValueAtPath(nr.Params, intok, tokens[i])\n\t}\n\treturn nr\n}\n\n// EachPage iterates over each page of a paginated request object. The fn\n// parameter should be a function with the following sample signature:\n//\n//   func(page *T, lastPage bool) bool {\n//       return true // return false to stop iterating\n//   }\n//\n// Where \"T\" is the structure type matching the output structure of the given\n// operation. For example, a request object generated by\n// DynamoDB.ListTablesRequest() would expect to see dynamodb.ListTablesOutput\n// as the structure \"T\". The lastPage value represents whether the page is\n// the last page of data or not. The return value of this function should\n// return true to keep iterating or false to stop.\nfunc (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error {\n\tfor page := r; page != nil; page = page.NextPage() {\n\t\tif err := page.Send(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif getNextPage := fn(page.Data, !page.HasNextPage()); !getNextPage {\n\t\t\treturn page.Error\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go",
    "content": "package request\n\nimport (\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n)\n\n// Retryer is an interface to control retry logic for a given service.\n// The default implementation used by most services is the service.DefaultRetryer\n// structure, which contains basic retry logic using exponential backoff.\ntype Retryer interface {\n\tRetryRules(*Request) time.Duration\n\tShouldRetry(*Request) bool\n\tMaxRetries() int\n}\n\n// WithRetryer sets a config Retryer value to the given Config returning it\n// for chaining.\nfunc WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config {\n\tcfg.Retryer = retryer\n\treturn cfg\n}\n\n// retryableCodes is a collection of service response codes which are retry-able\n// without any further action.\nvar retryableCodes = map[string]struct{}{\n\t\"RequestError\":   {},\n\t\"RequestTimeout\": {},\n}\n\nvar throttleCodes = map[string]struct{}{\n\t\"ProvisionedThroughputExceededException\": {},\n\t\"Throttling\":                             {},\n\t\"ThrottlingException\":                    {},\n\t\"RequestLimitExceeded\":                   {},\n\t\"RequestThrottled\":                       {},\n\t\"LimitExceededException\":                 {}, // Deleting 10+ DynamoDb tables at once\n\t\"TooManyRequestsException\":               {}, // Lambda functions\n}\n\n// credsExpiredCodes is a collection of error codes which signify the credentials\n// need to be refreshed. Expired tokens require refreshing of credentials, and\n// resigning before the request can be retried.\nvar credsExpiredCodes = map[string]struct{}{\n\t\"ExpiredToken\":          {},\n\t\"ExpiredTokenException\": {},\n\t\"RequestExpired\":        {}, // EC2 Only\n}\n\nfunc isCodeThrottle(code string) bool {\n\t_, ok := throttleCodes[code]\n\treturn ok\n}\n\nfunc isCodeRetryable(code string) bool {\n\tif _, ok := retryableCodes[code]; ok {\n\t\treturn true\n\t}\n\n\treturn isCodeExpiredCreds(code)\n}\n\nfunc isCodeExpiredCreds(code string) bool {\n\t_, ok := credsExpiredCodes[code]\n\treturn ok\n}\n\n// IsErrorRetryable returns whether the error is retryable, based on its Code.\n// Returns false if the request has no Error set.\nfunc (r *Request) IsErrorRetryable() bool {\n\tif r.Error != nil {\n\t\tif err, ok := r.Error.(awserr.Error); ok {\n\t\t\treturn isCodeRetryable(err.Code())\n\t\t}\n\t}\n\treturn false\n}\n\n// IsErrorThrottle returns whether the error is to be throttled based on its code.\n// Returns false if the request has no Error set\nfunc (r *Request) IsErrorThrottle() bool {\n\tif r.Error != nil {\n\t\tif err, ok := r.Error.(awserr.Error); ok {\n\t\t\treturn isCodeThrottle(err.Code())\n\t\t}\n\t}\n\treturn false\n}\n\n// IsErrorExpired returns whether the error code is a credential expiry error.\n// Returns false if the request has no Error set.\nfunc (r *Request) IsErrorExpired() bool {\n\tif r.Error != nil {\n\t\tif err, ok := r.Error.(awserr.Error); ok {\n\t\t\treturn isCodeExpiredCreds(err.Code())\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/request/validation.go",
    "content": "package request\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n)\n\nconst (\n\t// InvalidParameterErrCode is the error code for invalid parameters errors\n\tInvalidParameterErrCode = \"InvalidParameter\"\n\t// ParamRequiredErrCode is the error code for required parameter errors\n\tParamRequiredErrCode = \"ParamRequiredError\"\n\t// ParamMinValueErrCode is the error code for fields with too low of a\n\t// number value.\n\tParamMinValueErrCode = \"ParamMinValueError\"\n\t// ParamMinLenErrCode is the error code for fields without enough elements.\n\tParamMinLenErrCode = \"ParamMinLenError\"\n)\n\n// Validator provides a way for types to perform validation logic on their\n// input values that external code can use to determine if a type's values\n// are valid.\ntype Validator interface {\n\tValidate() error\n}\n\n// An ErrInvalidParams provides wrapping of invalid parameter errors found when\n// validating API operation input parameters.\ntype ErrInvalidParams struct {\n\t// Context is the base context of the invalid parameter group.\n\tContext string\n\terrs    []ErrInvalidParam\n}\n\n// Add adds a new invalid parameter error to the collection of invalid\n// parameters. The context of the invalid parameter will be updated to reflect\n// this collection.\nfunc (e *ErrInvalidParams) Add(err ErrInvalidParam) {\n\terr.SetContext(e.Context)\n\te.errs = append(e.errs, err)\n}\n\n// AddNested adds the invalid parameter errors from another ErrInvalidParams\n// value into this collection. The nested errors will have their nested context\n// updated and base context to reflect the merging.\n//\n// Use for nested validations errors.\nfunc (e *ErrInvalidParams) AddNested(nestedCtx string, nested ErrInvalidParams) {\n\tfor _, err := range nested.errs {\n\t\terr.SetContext(e.Context)\n\t\terr.AddNestedContext(nestedCtx)\n\t\te.errs = append(e.errs, err)\n\t}\n}\n\n// Len returns the number of invalid parameter errors\nfunc (e ErrInvalidParams) Len() int {\n\treturn len(e.errs)\n}\n\n// Code returns the code of the error\nfunc (e ErrInvalidParams) Code() string {\n\treturn InvalidParameterErrCode\n}\n\n// Message returns the message of the error\nfunc (e ErrInvalidParams) Message() string {\n\treturn fmt.Sprintf(\"%d validation error(s) found.\", len(e.errs))\n}\n\n// Error returns the string formatted form of the invalid parameters.\nfunc (e ErrInvalidParams) Error() string {\n\tw := &bytes.Buffer{}\n\tfmt.Fprintf(w, \"%s: %s\\n\", e.Code(), e.Message())\n\n\tfor _, err := range e.errs {\n\t\tfmt.Fprintf(w, \"- %s\\n\", err.Message())\n\t}\n\n\treturn w.String()\n}\n\n// OrigErr returns the invalid parameters as a awserr.BatchedErrors value\nfunc (e ErrInvalidParams) OrigErr() error {\n\treturn awserr.NewBatchError(\n\t\tInvalidParameterErrCode, e.Message(), e.OrigErrs())\n}\n\n// OrigErrs returns a slice of the invalid parameters\nfunc (e ErrInvalidParams) OrigErrs() []error {\n\terrs := make([]error, len(e.errs))\n\tfor i := 0; i < len(errs); i++ {\n\t\terrs[i] = e.errs[i]\n\t}\n\n\treturn errs\n}\n\n// An ErrInvalidParam represents an invalid parameter error type.\ntype ErrInvalidParam interface {\n\tawserr.Error\n\n\t// Field name the error occurred on.\n\tField() string\n\n\t// SetContext updates the context of the error.\n\tSetContext(string)\n\n\t// AddNestedContext updates the error's context to include a nested level.\n\tAddNestedContext(string)\n}\n\ntype errInvalidParam struct {\n\tcontext       string\n\tnestedContext string\n\tfield         string\n\tcode          string\n\tmsg           string\n}\n\n// Code returns the error code for the type of invalid parameter.\nfunc (e *errInvalidParam) Code() string {\n\treturn e.code\n}\n\n// Message returns the reason the parameter was invalid, and its context.\nfunc (e *errInvalidParam) Message() string {\n\treturn fmt.Sprintf(\"%s, %s.\", e.msg, e.Field())\n}\n\n// Error returns the string version of the invalid parameter error.\nfunc (e *errInvalidParam) Error() string {\n\treturn fmt.Sprintf(\"%s: %s\", e.code, e.Message())\n}\n\n// OrigErr returns nil, Implemented for awserr.Error interface.\nfunc (e *errInvalidParam) OrigErr() error {\n\treturn nil\n}\n\n// Field Returns the field and context the error occurred.\nfunc (e *errInvalidParam) Field() string {\n\tfield := e.context\n\tif len(field) > 0 {\n\t\tfield += \".\"\n\t}\n\tif len(e.nestedContext) > 0 {\n\t\tfield += fmt.Sprintf(\"%s.\", e.nestedContext)\n\t}\n\tfield += e.field\n\n\treturn field\n}\n\n// SetContext updates the base context of the error.\nfunc (e *errInvalidParam) SetContext(ctx string) {\n\te.context = ctx\n}\n\n// AddNestedContext prepends a context to the field's path.\nfunc (e *errInvalidParam) AddNestedContext(ctx string) {\n\tif len(e.nestedContext) == 0 {\n\t\te.nestedContext = ctx\n\t} else {\n\t\te.nestedContext = fmt.Sprintf(\"%s.%s\", ctx, e.nestedContext)\n\t}\n\n}\n\n// An ErrParamRequired represents an required parameter error.\ntype ErrParamRequired struct {\n\terrInvalidParam\n}\n\n// NewErrParamRequired creates a new required parameter error.\nfunc NewErrParamRequired(field string) *ErrParamRequired {\n\treturn &ErrParamRequired{\n\t\terrInvalidParam{\n\t\t\tcode:  ParamRequiredErrCode,\n\t\t\tfield: field,\n\t\t\tmsg:   fmt.Sprintf(\"missing required field\"),\n\t\t},\n\t}\n}\n\n// An ErrParamMinValue represents a minimum value parameter error.\ntype ErrParamMinValue struct {\n\terrInvalidParam\n\tmin float64\n}\n\n// NewErrParamMinValue creates a new minimum value parameter error.\nfunc NewErrParamMinValue(field string, min float64) *ErrParamMinValue {\n\treturn &ErrParamMinValue{\n\t\terrInvalidParam: errInvalidParam{\n\t\t\tcode:  ParamMinValueErrCode,\n\t\t\tfield: field,\n\t\t\tmsg:   fmt.Sprintf(\"minimum field value of %v\", min),\n\t\t},\n\t\tmin: min,\n\t}\n}\n\n// MinValue returns the field's require minimum value.\n//\n// float64 is returned for both int and float min values.\nfunc (e *ErrParamMinValue) MinValue() float64 {\n\treturn e.min\n}\n\n// An ErrParamMinLen represents a minimum length parameter error.\ntype ErrParamMinLen struct {\n\terrInvalidParam\n\tmin int\n}\n\n// NewErrParamMinLen creates a new minimum length parameter error.\nfunc NewErrParamMinLen(field string, min int) *ErrParamMinLen {\n\treturn &ErrParamMinLen{\n\t\terrInvalidParam: errInvalidParam{\n\t\t\tcode:  ParamMinValueErrCode,\n\t\t\tfield: field,\n\t\t\tmsg:   fmt.Sprintf(\"minimum field size of %v\", min),\n\t\t},\n\t\tmin: min,\n\t}\n}\n\n// MinLen returns the field's required minimum length.\nfunc (e *ErrParamMinLen) MinLen() int {\n\treturn e.min\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/session/doc.go",
    "content": "/*\nPackage session provides configuration for the SDK's service clients.\n\nSessions can be shared across all service clients that share the same base\nconfiguration.  The Session is built from the SDK's default configuration and\nrequest handlers.\n\nSessions should be cached when possible, because creating a new Session will\nload all configuration values from the environment, and config files each time\nthe Session is created. Sharing the Session value across all of your service\nclients will ensure the configuration is loaded the fewest number of times possible.\n\nConcurrency\n\nSessions are safe to use concurrently as long as the Session is not being\nmodified. The SDK will not modify the Session once the Session has been created.\nCreating service clients concurrently from a shared Session is safe.\n\nSessions from Shared Config\n\nSessions can be created using the method above that will only load the\nadditional config if the AWS_SDK_LOAD_CONFIG environment variable is set.\nAlternatively you can explicitly create a Session with shared config enabled.\nTo do this you can use NewSessionWithOptions to configure how the Session will\nbe created. Using the NewSessionWithOptions with SharedConfigState set to\nSharedConfigEnabled will create the session as if the AWS_SDK_LOAD_CONFIG\nenvironment variable was set.\n\nCreating Sessions\n\nWhen creating Sessions optional aws.Config values can be passed in that will\noverride the default, or loaded config values the Session is being created\nwith. This allows you to provide additional, or case based, configuration\nas needed.\n\nBy default NewSession will only load credentials from the shared credentials\nfile (~/.aws/credentials). If the AWS_SDK_LOAD_CONFIG environment variable is\nset to a truthy value the Session will be created from the configuration\nvalues from the shared config (~/.aws/config) and shared credentials\n(~/.aws/credentials) files. See the section Sessions from Shared Config for\nmore information.\n\nCreate a Session with the default config and request handlers. With credentials\nregion, and profile loaded from the environment and shared config automatically.\nRequires the AWS_PROFILE to be set, or \"default\" is used.\n\n\t// Create Session\n\tsess, err := session.NewSession()\n\n\t// Create a Session with a custom region\n\tsess, err := session.NewSession(&aws.Config{Region: aws.String(\"us-east-1\")})\n\n\t// Create a S3 client instance from a session\n\tsess, err := session.NewSession()\n\tif err != nil {\n\t\t// Handle Session creation error\n\t}\n\tsvc := s3.New(sess)\n\nCreate Session With Option Overrides\n\nIn addition to NewSession, Sessions can be created using NewSessionWithOptions.\nThis func allows you to control and override how the Session will be created\nthrough code instead of being driven by environment variables only.\n\nUse NewSessionWithOptions when you want to provide the config profile, or\noverride the shared config state (AWS_SDK_LOAD_CONFIG).\n\n\t// Equivalent to session.New\n\tsess, err := session.NewSessionWithOptions(session.Options{})\n\n\t// Specify profile to load for the session's config\n\tsess, err := session.NewSessionWithOptions(session.Options{\n\t\t Profile: \"profile_name\",\n\t})\n\n\t// Specify profile for config and region for requests\n\tsess, err := session.NewSessionWithOptions(session.Options{\n\t\t Config: aws.Config{Region: aws.String(\"us-east-1\")},\n\t\t Profile: \"profile_name\",\n\t})\n\n\t// Force enable Shared Config support\n\tsess, err := session.NewSessionWithOptions(session.Options{\n\t\tSharedConfigState: SharedConfigEnable,\n\t})\n\nAdding Handlers\n\nYou can add handlers to a session for processing HTTP requests. All service\nclients that use the session inherit the handlers. For example, the following\nhandler logs every request and its payload made by a service client:\n\n\t// Create a session, and add additional handlers for all service\n\t// clients created with the Session to inherit. Adds logging handler.\n\tsess, err := session.NewSession()\n\tsess.Handlers.Send.PushFront(func(r *request.Request) {\n\t\t// Log every request made and its payload\n\t\tlogger.Println(\"Request: %s/%s, Payload: %s\",\n\t\t\tr.ClientInfo.ServiceName, r.Operation, r.Params)\n\t})\n\nDeprecated \"New\" function\n\nThe New session function has been deprecated because it does not provide good\nway to return errors that occur when loading the configuration files and values.\nBecause of this, NewSession was created so errors can be retrieved when\ncreating a session fails.\n\nShared Config Fields\n\nBy default the SDK will only load the shared credentials file's (~/.aws/credentials)\ncredentials values, and all other config is provided by the environment variables,\nSDK defaults, and user provided aws.Config values.\n\nIf the AWS_SDK_LOAD_CONFIG environment variable is set, or SharedConfigEnable\noption is used to create the Session the full shared config values will be\nloaded. This includes credentials, region, and support for assume role. In\naddition the Session will load its configuration from both the shared config\nfile (~/.aws/config) and shared credentials file (~/.aws/credentials). Both\nfiles have the same format.\n\nIf both config files are present the configuration from both files will be\nread. The Session will be created from  configuration values from the shared\ncredentials file (~/.aws/credentials) over those in the shared credentials\nfile (~/.aws/config).\n\nCredentials are the values the SDK should use for authenticating requests with\nAWS Services. They arfrom a configuration file will need to include both\naws_access_key_id and aws_secret_access_key must be provided together in the\nsame file to be considered valid. The values will be ignored if not a complete\ngroup. aws_session_token is an optional field that can be provided if both of\nthe other two fields are also provided.\n\n\taws_access_key_id = AKID\n\taws_secret_access_key = SECRET\n\taws_session_token = TOKEN\n\nAssume Role values allow you to configure the SDK to assume an IAM role using\na set of credentials provided in a config file via the source_profile field.\nBoth \"role_arn\" and \"source_profile\" are required. The SDK does not support\nassuming a role with MFA token Via the Session's constructor. You can use the\nstscreds.AssumeRoleProvider credentials provider to specify custom\nconfiguration and support for MFA.\n\n\trole_arn = arn:aws:iam::<account_number>:role/<role_name>\n\tsource_profile = profile_with_creds\n\texternal_id = 1234\n\tmfa_serial = not supported!\n\trole_session_name = session_name\n\nRegion is the region the SDK should use for looking up AWS service endpoints\nand signing requests.\n\n\tregion = us-east-1\n\nEnvironment Variables\n\nWhen a Session is created several environment variables can be set to adjust\nhow the SDK functions, and what configuration data it loads when creating\nSessions. All environment values are optional, but some values like credentials\nrequire multiple of the values to set or the partial values will be ignored.\nAll environment variable values are strings unless otherwise noted.\n\nEnvironment configuration values. If set both Access Key ID and Secret Access\nKey must be provided. Session Token and optionally also be provided, but is\nnot required.\n\n\t# Access Key ID\n\tAWS_ACCESS_KEY_ID=AKID\n\tAWS_ACCESS_KEY=AKID # only read if AWS_ACCESS_KEY_ID is not set.\n\n\t# Secret Access Key\n\tAWS_SECRET_ACCESS_KEY=SECRET\n\tAWS_SECRET_KEY=SECRET=SECRET # only read if AWS_SECRET_ACCESS_KEY is not set.\n\n\t# Session Token\n\tAWS_SESSION_TOKEN=TOKEN\n\nRegion value will instruct the SDK where to make service API requests to. If is\nnot provided in the environment the region must be provided before a service\nclient request is made.\n\n\tAWS_REGION=us-east-1\n\n\t# AWS_DEFAULT_REGION is only read if AWS_SDK_LOAD_CONFIG is also set,\n\t# and AWS_REGION is not also set.\n\tAWS_DEFAULT_REGION=us-east-1\n\nProfile name the SDK should load use when loading shared config from the\nconfiguration files. If not provided \"default\" will be used as the profile name.\n\n\tAWS_PROFILE=my_profile\n\n\t# AWS_DEFAULT_PROFILE is only read if AWS_SDK_LOAD_CONFIG is also set,\n\t# and AWS_PROFILE is not also set.\n\tAWS_DEFAULT_PROFILE=my_profile\n\nSDK load config instructs the SDK to load the shared config in addition to\nshared credentials. This also expands the configuration loaded so the shared\ncredentials will have parity with the shared config file. This also enables\nRegion and Profile support for the AWS_DEFAULT_REGION and AWS_DEFAULT_PROFILE\nenv values as well.\n\n\tAWS_SDK_LOAD_CONFIG=1\n\nShared credentials file path can be set to instruct the SDK to use an alternative\nfile for the shared credentials. If not set the file will be loaded from\n$HOME/.aws/credentials on Linux/Unix based systems, and\n%USERPROFILE%\\.aws\\credentials on Windows.\n\n\tAWS_SHARED_CREDENTIALS_FILE=$HOME/my_shared_credentials\n\nShared config file path can be set to instruct the SDK to use an alternative\nfile for the shared config. If not set the file will be loaded from\n$HOME/.aws/config on Linux/Unix based systems, and\n%USERPROFILE%\\.aws\\config on Windows.\n\n\tAWS_CONFIG_FILE=$HOME/my_shared_config\n\n\n*/\npackage session\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go",
    "content": "package session\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n)\n\n// envConfig is a collection of environment values the SDK will read\n// setup config from. All environment values are optional. But some values\n// such as credentials require multiple values to be complete or the values\n// will be ignored.\ntype envConfig struct {\n\t// Environment configuration values. If set both Access Key ID and Secret Access\n\t// Key must be provided. Session Token and optionally also be provided, but is\n\t// not required.\n\t//\n\t//\t# Access Key ID\n\t//\tAWS_ACCESS_KEY_ID=AKID\n\t//\tAWS_ACCESS_KEY=AKID # only read if AWS_ACCESS_KEY_ID is not set.\n\t//\n\t//\t# Secret Access Key\n\t//\tAWS_SECRET_ACCESS_KEY=SECRET\n\t//\tAWS_SECRET_KEY=SECRET=SECRET # only read if AWS_SECRET_ACCESS_KEY is not set.\n\t//\n\t//\t# Session Token\n\t//\tAWS_SESSION_TOKEN=TOKEN\n\tCreds credentials.Value\n\n\t// Region value will instruct the SDK where to make service API requests to. If is\n\t// not provided in the environment the region must be provided before a service\n\t// client request is made.\n\t//\n\t//\tAWS_REGION=us-east-1\n\t//\n\t//\t# AWS_DEFAULT_REGION is only read if AWS_SDK_LOAD_CONFIG is also set,\n\t//\t# and AWS_REGION is not also set.\n\t//\tAWS_DEFAULT_REGION=us-east-1\n\tRegion string\n\n\t// Profile name the SDK should load use when loading shared configuration from the\n\t// shared configuration files. If not provided \"default\" will be used as the\n\t// profile name.\n\t//\n\t//\tAWS_PROFILE=my_profile\n\t//\n\t//\t# AWS_DEFAULT_PROFILE is only read if AWS_SDK_LOAD_CONFIG is also set,\n\t//\t# and AWS_PROFILE is not also set.\n\t//\tAWS_DEFAULT_PROFILE=my_profile\n\tProfile string\n\n\t// SDK load config instructs the SDK to load the shared config in addition to\n\t// shared credentials. This also expands the configuration loaded from the shared\n\t// credentials to have parity with the shared config file. This also enables\n\t// Region and Profile support for the AWS_DEFAULT_REGION and AWS_DEFAULT_PROFILE\n\t// env values as well.\n\t//\n\t//\tAWS_SDK_LOAD_CONFIG=1\n\tEnableSharedConfig bool\n\n\t// Shared credentials file path can be set to instruct the SDK to use an alternate\n\t// file for the shared credentials. If not set the file will be loaded from\n\t// $HOME/.aws/credentials on Linux/Unix based systems, and\n\t// %USERPROFILE%\\.aws\\credentials on Windows.\n\t//\n\t//\tAWS_SHARED_CREDENTIALS_FILE=$HOME/my_shared_credentials\n\tSharedCredentialsFile string\n\n\t// Shared config file path can be set to instruct the SDK to use an alternate\n\t// file for the shared config. If not set the file will be loaded from\n\t// $HOME/.aws/config on Linux/Unix based systems, and\n\t// %USERPROFILE%\\.aws\\config on Windows.\n\t//\n\t//\tAWS_CONFIG_FILE=$HOME/my_shared_config\n\tSharedConfigFile string\n}\n\nvar (\n\tcredAccessEnvKey = []string{\n\t\t\"AWS_ACCESS_KEY_ID\",\n\t\t\"AWS_ACCESS_KEY\",\n\t}\n\tcredSecretEnvKey = []string{\n\t\t\"AWS_SECRET_ACCESS_KEY\",\n\t\t\"AWS_SECRET_KEY\",\n\t}\n\tcredSessionEnvKey = []string{\n\t\t\"AWS_SESSION_TOKEN\",\n\t}\n\n\tregionEnvKeys = []string{\n\t\t\"AWS_REGION\",\n\t\t\"AWS_DEFAULT_REGION\", // Only read if AWS_SDK_LOAD_CONFIG is also set\n\t}\n\tprofileEnvKeys = []string{\n\t\t\"AWS_PROFILE\",\n\t\t\"AWS_DEFAULT_PROFILE\", // Only read if AWS_SDK_LOAD_CONFIG is also set\n\t}\n)\n\n// loadEnvConfig retrieves the SDK's environment configuration.\n// See `envConfig` for the values that will be retrieved.\n//\n// If the environment variable `AWS_SDK_LOAD_CONFIG` is set to a truthy value\n// the shared SDK config will be loaded in addition to the SDK's specific\n// configuration values.\nfunc loadEnvConfig() envConfig {\n\tenableSharedConfig, _ := strconv.ParseBool(os.Getenv(\"AWS_SDK_LOAD_CONFIG\"))\n\treturn envConfigLoad(enableSharedConfig)\n}\n\n// loadEnvSharedConfig retrieves the SDK's environment configuration, and the\n// SDK shared config. See `envConfig` for the values that will be retrieved.\n//\n// Loads the shared configuration in addition to the SDK's specific configuration.\n// This will load the same values as `loadEnvConfig` if the `AWS_SDK_LOAD_CONFIG`\n// environment variable is set.\nfunc loadSharedEnvConfig() envConfig {\n\treturn envConfigLoad(true)\n}\n\nfunc envConfigLoad(enableSharedConfig bool) envConfig {\n\tcfg := envConfig{}\n\n\tcfg.EnableSharedConfig = enableSharedConfig\n\n\tsetFromEnvVal(&cfg.Creds.AccessKeyID, credAccessEnvKey)\n\tsetFromEnvVal(&cfg.Creds.SecretAccessKey, credSecretEnvKey)\n\tsetFromEnvVal(&cfg.Creds.SessionToken, credSessionEnvKey)\n\n\t// Require logical grouping of credentials\n\tif len(cfg.Creds.AccessKeyID) == 0 || len(cfg.Creds.SecretAccessKey) == 0 {\n\t\tcfg.Creds = credentials.Value{}\n\t} else {\n\t\tcfg.Creds.ProviderName = \"EnvConfigCredentials\"\n\t}\n\n\tregionKeys := regionEnvKeys\n\tprofileKeys := profileEnvKeys\n\tif !cfg.EnableSharedConfig {\n\t\tregionKeys = regionKeys[:1]\n\t\tprofileKeys = profileKeys[:1]\n\t}\n\n\tsetFromEnvVal(&cfg.Region, regionKeys)\n\tsetFromEnvVal(&cfg.Profile, profileKeys)\n\n\tcfg.SharedCredentialsFile = sharedCredentialsFilename()\n\tcfg.SharedConfigFile = sharedConfigFilename()\n\n\treturn cfg\n}\n\nfunc setFromEnvVal(dst *string, keys []string) {\n\tfor _, k := range keys {\n\t\tif v := os.Getenv(k); len(v) > 0 {\n\t\t\t*dst = v\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc sharedCredentialsFilename() string {\n\tif name := os.Getenv(\"AWS_SHARED_CREDENTIALS_FILE\"); len(name) > 0 {\n\t\treturn name\n\t}\n\n\treturn filepath.Join(userHomeDir(), \".aws\", \"credentials\")\n}\n\nfunc sharedConfigFilename() string {\n\tif name := os.Getenv(\"AWS_CONFIG_FILE\"); len(name) > 0 {\n\t\treturn name\n\t}\n\n\treturn filepath.Join(userHomeDir(), \".aws\", \"config\")\n}\n\nfunc userHomeDir() string {\n\thomeDir := os.Getenv(\"HOME\") // *nix\n\tif len(homeDir) == 0 {       // windows\n\t\thomeDir = os.Getenv(\"USERPROFILE\")\n\t}\n\n\treturn homeDir\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/session/session.go",
    "content": "package session\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/client\"\n\t\"github.com/aws/aws-sdk-go/aws/corehandlers\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials/stscreds\"\n\t\"github.com/aws/aws-sdk-go/aws/defaults\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n\t\"github.com/aws/aws-sdk-go/private/endpoints\"\n)\n\n// A Session provides a central location to create service clients from and\n// store configurations and request handlers for those services.\n//\n// Sessions are safe to create service clients concurrently, but it is not safe\n// to mutate the Session concurrently.\n//\n// The Session satisfies the service client's client.ClientConfigProvider.\ntype Session struct {\n\tConfig   *aws.Config\n\tHandlers request.Handlers\n}\n\n// New creates a new instance of the handlers merging in the provided configs\n// on top of the SDK's default configurations. Once the Session is created it\n// can be mutated to modify the Config or Handlers. The Session is safe to be\n// read concurrently, but it should not be written to concurrently.\n//\n// If the AWS_SDK_LOAD_CONFIG environment is set to a truthy value, the New\n// method could now encounter an error when loading the configuration. When\n// The environment variable is set, and an error occurs, New will return a\n// session that will fail all requests reporting the error that occured while\n// loading the session. Use NewSession to get the error when creating the\n// session.\n//\n// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value\n// the shared config file (~/.aws/config) will also be loaded, in addition to\n// the shared credentials file (~/.aws/config). Values set in both the\n// shared config, and shared credentials will be taken from the shared\n// credentials file.\n//\n// Deprecated: Use NewSession functiions to create sessions instead. NewSession\n// has the same functionality as New except an error can be returned when the\n// func is called instead of waiting to receive an error until a request is made.\nfunc New(cfgs ...*aws.Config) *Session {\n\t// load initial config from environment\n\tenvCfg := loadEnvConfig()\n\n\tif envCfg.EnableSharedConfig {\n\t\ts, err := newSession(envCfg, cfgs...)\n\t\tif err != nil {\n\t\t\t// Old session.New expected all errors to be discovered when\n\t\t\t// a request is made, and would report the errors then. This\n\t\t\t// needs to be replicated if an error occurs while creating\n\t\t\t// the session.\n\t\t\tmsg := \"failed to create session with AWS_SDK_LOAD_CONFIG enabled. \" +\n\t\t\t\t\"Use session.NewSession to handle errors occuring during session creation.\"\n\n\t\t\t// Session creation failed, need to report the error and prevent\n\t\t\t// any requests from succeeding.\n\t\t\ts = &Session{Config: defaults.Config()}\n\t\t\ts.Config.MergeIn(cfgs...)\n\t\t\ts.Config.Logger.Log(\"ERROR:\", msg, \"Error:\", err)\n\t\t\ts.Handlers.Validate.PushBack(func(r *request.Request) {\n\t\t\t\tr.Error = err\n\t\t\t})\n\t\t}\n\t\treturn s\n\t}\n\n\treturn oldNewSession(cfgs...)\n}\n\n// NewSession returns a new Session created from SDK defaults, config files,\n// environment, and user provided config files. Once the Session is created\n// it can be mutated to modify the Config or Handlers. The Session is safe to\n// be read concurrently, but it should not be written to concurrently.\n//\n// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value\n// the shared config file (~/.aws/config) will also be loaded in addition to\n// the shared credentials file (~/.aws/config). Values set in both the\n// shared config, and shared credentials will be taken from the shared\n// credentials file. Enabling the Shared Config will also allow the Session\n// to be built with retrieving credentials with AssumeRole set in the config.\n//\n// See the NewSessionWithOptions func for information on how to override or\n// control through code how the Session will be created. Such as specifing the\n// config profile, and controlling if shared config is enabled or not.\nfunc NewSession(cfgs ...*aws.Config) (*Session, error) {\n\tenvCfg := loadEnvConfig()\n\n\treturn newSession(envCfg, cfgs...)\n}\n\n// SharedConfigState provides the ability to optionally override the state\n// of the session's creation based on the shared config being enabled or\n// disabled.\ntype SharedConfigState int\n\nconst (\n\t// SharedConfigStateFromEnv does not override any state of the\n\t// AWS_SDK_LOAD_CONFIG env var. It is the default value of the\n\t// SharedConfigState type.\n\tSharedConfigStateFromEnv SharedConfigState = iota\n\n\t// SharedConfigDisable overrides the AWS_SDK_LOAD_CONFIG env var value\n\t// and disables the shared config functionality.\n\tSharedConfigDisable\n\n\t// SharedConfigEnable overrides the AWS_SDK_LOAD_CONFIG env var value\n\t// and enables the shared config functionality.\n\tSharedConfigEnable\n)\n\n// Options provides the means to control how a Session is created and what\n// configuration values will be loaded.\n//\ntype Options struct {\n\t// Provides config values for the SDK to use when creating service clients\n\t// and making API requests to services. Any value set in with this field\n\t// will override the associated value provided by the SDK defaults,\n\t// environment or config files where relevent.\n\t//\n\t// If not set, configuration values from from SDK defaults, environment,\n\t// config will be used.\n\tConfig aws.Config\n\n\t// Overrides the config profile the Session should be created from. If not\n\t// set the value of the environment variable will be loaded (AWS_PROFILE,\n\t// or AWS_DEFAULT_PROFILE if the Shared Config is enabled).\n\t//\n\t// If not set and environment variables are not set the \"default\"\n\t// (DefaultSharedConfigProfile) will be used as the profile to load the\n\t// session config from.\n\tProfile string\n\n\t// Instructs how the Session will be created based on the AWS_SDK_LOAD_CONFIG\n\t// environment variable. By default a Session will be created using the\n\t// value provided by the AWS_SDK_LOAD_CONFIG environment variable.\n\t//\n\t// Setting this value to SharedConfigEnable or SharedConfigDisable\n\t// will allow you to override the AWS_SDK_LOAD_CONFIG environment variable\n\t// and enable or disable the shared config functionality.\n\tSharedConfigState SharedConfigState\n}\n\n// NewSessionWithOptions returns a new Session created from SDK defaults, config files,\n// environment, and user provided config files. This func uses the Options\n// values to configure how the Session is created.\n//\n// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value\n// the shared config file (~/.aws/config) will also be loaded in addition to\n// the shared credentials file (~/.aws/config). Values set in both the\n// shared config, and shared credentials will be taken from the shared\n// credentials file. Enabling the Shared Config will also allow the Session\n// to be built with retrieving credentials with AssumeRole set in the config.\n//\n//     // Equivalent to session.New\n//     sess, err := session.NewSessionWithOptions(session.Options{})\n//\n//     // Specify profile to load for the session's config\n//     sess, err := session.NewSessionWithOptions(session.Options{\n//          Profile: \"profile_name\",\n//     })\n//\n//     // Specify profile for config and region for requests\n//     sess, err := session.NewSessionWithOptions(session.Options{\n//          Config: aws.Config{Region: aws.String(\"us-east-1\")},\n//          Profile: \"profile_name\",\n//     })\n//\n//     // Force enable Shared Config support\n//     sess, err := session.NewSessionWithOptions(session.Options{\n//         SharedConfigState: SharedConfigEnable,\n//     })\nfunc NewSessionWithOptions(opts Options) (*Session, error) {\n\tenvCfg := loadEnvConfig()\n\n\tif len(opts.Profile) > 0 {\n\t\tenvCfg.Profile = opts.Profile\n\t}\n\n\tswitch opts.SharedConfigState {\n\tcase SharedConfigDisable:\n\t\tenvCfg.EnableSharedConfig = false\n\tcase SharedConfigEnable:\n\t\tenvCfg.EnableSharedConfig = true\n\t}\n\n\treturn newSession(envCfg, &opts.Config)\n}\n\n// Must is a helper function to ensure the Session is valid and there was no\n// error when calling a NewSession function.\n//\n// This helper is intended to be used in variable initialization to load the\n// Session and configuration at startup. Such as:\n//\n//     var sess = session.Must(session.NewSession())\nfunc Must(sess *Session, err error) *Session {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn sess\n}\n\nfunc oldNewSession(cfgs ...*aws.Config) *Session {\n\tcfg := defaults.Config()\n\thandlers := defaults.Handlers()\n\n\t// Apply the passed in configs so the configuration can be applied to the\n\t// default credential chain\n\tcfg.MergeIn(cfgs...)\n\tcfg.Credentials = defaults.CredChain(cfg, handlers)\n\n\t// Reapply any passed in configs to override credentials if set\n\tcfg.MergeIn(cfgs...)\n\n\ts := &Session{\n\t\tConfig:   cfg,\n\t\tHandlers: handlers,\n\t}\n\n\tinitHandlers(s)\n\n\treturn s\n}\n\nfunc newSession(envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {\n\tcfg := defaults.Config()\n\thandlers := defaults.Handlers()\n\n\t// Get a merged version of the user provided config to determine if\n\t// credentials were.\n\tuserCfg := &aws.Config{}\n\tuserCfg.MergeIn(cfgs...)\n\n\t// Order config files will be loaded in with later files overwriting\n\t// previous config file values.\n\tcfgFiles := []string{envCfg.SharedConfigFile, envCfg.SharedCredentialsFile}\n\tif !envCfg.EnableSharedConfig {\n\t\t// The shared config file (~/.aws/config) is only loaded if instructed\n\t\t// to load via the envConfig.EnableSharedConfig (AWS_SDK_LOAD_CONFIG).\n\t\tcfgFiles = cfgFiles[1:]\n\t}\n\n\t// Load additional config from file(s)\n\tsharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers)\n\n\ts := &Session{\n\t\tConfig:   cfg,\n\t\tHandlers: handlers,\n\t}\n\n\tinitHandlers(s)\n\n\treturn s, nil\n}\n\nfunc mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers) {\n\t// Merge in user provided configuration\n\tcfg.MergeIn(userCfg)\n\n\t// Region if not already set by user\n\tif len(aws.StringValue(cfg.Region)) == 0 {\n\t\tif len(envCfg.Region) > 0 {\n\t\t\tcfg.WithRegion(envCfg.Region)\n\t\t} else if envCfg.EnableSharedConfig && len(sharedCfg.Region) > 0 {\n\t\t\tcfg.WithRegion(sharedCfg.Region)\n\t\t}\n\t}\n\n\t// Configure credentials if not already set\n\tif cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil {\n\t\tif len(envCfg.Creds.AccessKeyID) > 0 {\n\t\t\tcfg.Credentials = credentials.NewStaticCredentialsFromCreds(\n\t\t\t\tenvCfg.Creds,\n\t\t\t)\n\t\t} else if envCfg.EnableSharedConfig && len(sharedCfg.AssumeRole.RoleARN) > 0 && sharedCfg.AssumeRoleSource != nil {\n\t\t\tcfgCp := *cfg\n\t\t\tcfgCp.Credentials = credentials.NewStaticCredentialsFromCreds(\n\t\t\t\tsharedCfg.AssumeRoleSource.Creds,\n\t\t\t)\n\t\t\tcfg.Credentials = stscreds.NewCredentials(\n\t\t\t\t&Session{\n\t\t\t\t\tConfig:   &cfgCp,\n\t\t\t\t\tHandlers: handlers.Copy(),\n\t\t\t\t},\n\t\t\t\tsharedCfg.AssumeRole.RoleARN,\n\t\t\t\tfunc(opt *stscreds.AssumeRoleProvider) {\n\t\t\t\t\topt.RoleSessionName = sharedCfg.AssumeRole.RoleSessionName\n\n\t\t\t\t\tif len(sharedCfg.AssumeRole.ExternalID) > 0 {\n\t\t\t\t\t\topt.ExternalID = aws.String(sharedCfg.AssumeRole.ExternalID)\n\t\t\t\t\t}\n\n\t\t\t\t\t// MFA not supported\n\t\t\t\t},\n\t\t\t)\n\t\t} else if len(sharedCfg.Creds.AccessKeyID) > 0 {\n\t\t\tcfg.Credentials = credentials.NewStaticCredentialsFromCreds(\n\t\t\t\tsharedCfg.Creds,\n\t\t\t)\n\t\t} else {\n\t\t\t// Fallback to default credentials provider, include mock errors\n\t\t\t// for the credential chain so user can identify why credentials\n\t\t\t// failed to be retrieved.\n\t\t\tcfg.Credentials = credentials.NewCredentials(&credentials.ChainProvider{\n\t\t\t\tVerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors),\n\t\t\t\tProviders: []credentials.Provider{\n\t\t\t\t\t&credProviderError{Err: awserr.New(\"EnvAccessKeyNotFound\", \"failed to find credentials in the environment.\", nil)},\n\t\t\t\t\t&credProviderError{Err: awserr.New(\"SharedCredsLoad\", fmt.Sprintf(\"failed to load profile, %s.\", envCfg.Profile), nil)},\n\t\t\t\t\tdefaults.RemoteCredProvider(*cfg, handlers),\n\t\t\t\t},\n\t\t\t})\n\t\t}\n\t}\n}\n\ntype credProviderError struct {\n\tErr error\n}\n\nvar emptyCreds = credentials.Value{}\n\nfunc (c credProviderError) Retrieve() (credentials.Value, error) {\n\treturn credentials.Value{}, c.Err\n}\nfunc (c credProviderError) IsExpired() bool {\n\treturn true\n}\n\nfunc initHandlers(s *Session) {\n\t// Add the Validate parameter handler if it is not disabled.\n\ts.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler)\n\tif !aws.BoolValue(s.Config.DisableParamValidation) {\n\t\ts.Handlers.Validate.PushBackNamed(corehandlers.ValidateParametersHandler)\n\t}\n}\n\n// Copy creates and returns a copy of the current Session, coping the config\n// and handlers. If any additional configs are provided they will be merged\n// on top of the Session's copied config.\n//\n//     // Create a copy of the current Session, configured for the us-west-2 region.\n//     sess.Copy(&aws.Config{Region: aws.String(\"us-west-2\")})\nfunc (s *Session) Copy(cfgs ...*aws.Config) *Session {\n\tnewSession := &Session{\n\t\tConfig:   s.Config.Copy(cfgs...),\n\t\tHandlers: s.Handlers.Copy(),\n\t}\n\n\tinitHandlers(newSession)\n\n\treturn newSession\n}\n\n// ClientConfig satisfies the client.ConfigProvider interface and is used to\n// configure the service client instances. Passing the Session to the service\n// client's constructor (New) will use this method to configure the client.\nfunc (s *Session) ClientConfig(serviceName string, cfgs ...*aws.Config) client.Config {\n\ts = s.Copy(cfgs...)\n\tendpoint, signingRegion := endpoints.NormalizeEndpoint(\n\t\taws.StringValue(s.Config.Endpoint),\n\t\tserviceName,\n\t\taws.StringValue(s.Config.Region),\n\t\taws.BoolValue(s.Config.DisableSSL),\n\t\taws.BoolValue(s.Config.UseDualStack),\n\t)\n\n\treturn client.Config{\n\t\tConfig:        s.Config,\n\t\tHandlers:      s.Handlers,\n\t\tEndpoint:      endpoint,\n\t\tSigningRegion: signingRegion,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go",
    "content": "package session\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n\t\"github.com/go-ini/ini\"\n)\n\nconst (\n\t// Static Credentials group\n\taccessKeyIDKey  = `aws_access_key_id`     // group required\n\tsecretAccessKey = `aws_secret_access_key` // group required\n\tsessionTokenKey = `aws_session_token`     // optional\n\n\t// Assume Role Credentials group\n\troleArnKey         = `role_arn`          // group required\n\tsourceProfileKey   = `source_profile`    // group required\n\texternalIDKey      = `external_id`       // optional\n\tmfaSerialKey       = `mfa_serial`        // optional\n\troleSessionNameKey = `role_session_name` // optional\n\n\t// Additional Config fields\n\tregionKey = `region`\n\n\t// DefaultSharedConfigProfile is the default profile to be used when\n\t// loading configuration from the config files if another profile name\n\t// is not provided.\n\tDefaultSharedConfigProfile = `default`\n)\n\ntype assumeRoleConfig struct {\n\tRoleARN         string\n\tSourceProfile   string\n\tExternalID      string\n\tMFASerial       string\n\tRoleSessionName string\n}\n\n// sharedConfig represents the configuration fields of the SDK config files.\ntype sharedConfig struct {\n\t// Credentials values from the config file. Both aws_access_key_id\n\t// and aws_secret_access_key must be provided together in the same file\n\t// to be considered valid. The values will be ignored if not a complete group.\n\t// aws_session_token is an optional field that can be provided if both of the\n\t// other two fields are also provided.\n\t//\n\t//\taws_access_key_id\n\t//\taws_secret_access_key\n\t//\taws_session_token\n\tCreds credentials.Value\n\n\tAssumeRole       assumeRoleConfig\n\tAssumeRoleSource *sharedConfig\n\n\t// Region is the region the SDK should use for looking up AWS service endpoints\n\t// and signing requests.\n\t//\n\t//\tregion\n\tRegion string\n}\n\ntype sharedConfigFile struct {\n\tFilename string\n\tIniData  *ini.File\n}\n\n// loadSharedConfig retrieves the configuration from the list of files\n// using the profile provided. The order the files are listed will determine\n// precedence. Values in subsequent files will overwrite values defined in\n// earlier files.\n//\n// For example, given two files A and B. Both define credentials. If the order\n// of the files are A then B, B's credential values will be used instead of A's.\n//\n// See sharedConfig.setFromFile for information how the config files\n// will be loaded.\nfunc loadSharedConfig(profile string, filenames []string) (sharedConfig, error) {\n\tif len(profile) == 0 {\n\t\tprofile = DefaultSharedConfigProfile\n\t}\n\n\tfiles, err := loadSharedConfigIniFiles(filenames)\n\tif err != nil {\n\t\treturn sharedConfig{}, err\n\t}\n\n\tcfg := sharedConfig{}\n\tif err = cfg.setFromIniFiles(profile, files); err != nil {\n\t\treturn sharedConfig{}, err\n\t}\n\n\tif len(cfg.AssumeRole.SourceProfile) > 0 {\n\t\tif err := cfg.setAssumeRoleSource(profile, files); err != nil {\n\t\t\treturn sharedConfig{}, err\n\t\t}\n\t}\n\n\treturn cfg, nil\n}\n\nfunc loadSharedConfigIniFiles(filenames []string) ([]sharedConfigFile, error) {\n\tfiles := make([]sharedConfigFile, 0, len(filenames))\n\n\tfor _, filename := range filenames {\n\t\tif _, err := os.Stat(filename); os.IsNotExist(err) {\n\t\t\t// Trim files from the list that don't exist.\n\t\t\tcontinue\n\t\t}\n\n\t\tf, err := ini.Load(filename)\n\t\tif err != nil {\n\t\t\treturn nil, SharedConfigLoadError{Filename: filename}\n\t\t}\n\n\t\tfiles = append(files, sharedConfigFile{\n\t\t\tFilename: filename, IniData: f,\n\t\t})\n\t}\n\n\treturn files, nil\n}\n\nfunc (cfg *sharedConfig) setAssumeRoleSource(origProfile string, files []sharedConfigFile) error {\n\tvar assumeRoleSrc sharedConfig\n\n\t// Multiple level assume role chains are not support\n\tif cfg.AssumeRole.SourceProfile == origProfile {\n\t\tassumeRoleSrc = *cfg\n\t\tassumeRoleSrc.AssumeRole = assumeRoleConfig{}\n\t} else {\n\t\terr := assumeRoleSrc.setFromIniFiles(cfg.AssumeRole.SourceProfile, files)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(assumeRoleSrc.Creds.AccessKeyID) == 0 {\n\t\treturn SharedConfigAssumeRoleError{RoleARN: cfg.AssumeRole.RoleARN}\n\t}\n\n\tcfg.AssumeRoleSource = &assumeRoleSrc\n\n\treturn nil\n}\n\nfunc (cfg *sharedConfig) setFromIniFiles(profile string, files []sharedConfigFile) error {\n\t// Trim files from the list that don't exist.\n\tfor _, f := range files {\n\t\tif err := cfg.setFromIniFile(profile, f); err != nil {\n\t\t\tif _, ok := err.(SharedConfigProfileNotExistsError); ok {\n\t\t\t\t// Ignore proviles missings\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// setFromFile loads the configuration from the file using\n// the profile provided. A sharedConfig pointer type value is used so that\n// multiple config file loadings can be chained.\n//\n// Only loads complete logically grouped values, and will not set fields in cfg\n// for incomplete grouped values in the config. Such as credentials. For example\n// if a config file only includes aws_access_key_id but no aws_secret_access_key\n// the aws_access_key_id will be ignored.\nfunc (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile) error {\n\tsection, err := file.IniData.GetSection(profile)\n\tif err != nil {\n\t\t// Fallback to to alternate profile name: profile <name>\n\t\tsection, err = file.IniData.GetSection(fmt.Sprintf(\"profile %s\", profile))\n\t\tif err != nil {\n\t\t\treturn SharedConfigProfileNotExistsError{Profile: profile, Err: err}\n\t\t}\n\t}\n\n\t// Shared Credentials\n\takid := section.Key(accessKeyIDKey).String()\n\tsecret := section.Key(secretAccessKey).String()\n\tif len(akid) > 0 && len(secret) > 0 {\n\t\tcfg.Creds = credentials.Value{\n\t\t\tAccessKeyID:     akid,\n\t\t\tSecretAccessKey: secret,\n\t\t\tSessionToken:    section.Key(sessionTokenKey).String(),\n\t\t\tProviderName:    fmt.Sprintf(\"SharedConfigCredentials: %s\", file.Filename),\n\t\t}\n\t}\n\n\t// Assume Role\n\troleArn := section.Key(roleArnKey).String()\n\tsrcProfile := section.Key(sourceProfileKey).String()\n\tif len(roleArn) > 0 && len(srcProfile) > 0 {\n\t\tcfg.AssumeRole = assumeRoleConfig{\n\t\t\tRoleARN:         roleArn,\n\t\t\tSourceProfile:   srcProfile,\n\t\t\tExternalID:      section.Key(externalIDKey).String(),\n\t\t\tMFASerial:       section.Key(mfaSerialKey).String(),\n\t\t\tRoleSessionName: section.Key(roleSessionNameKey).String(),\n\t\t}\n\t}\n\n\t// Region\n\tif v := section.Key(regionKey).String(); len(v) > 0 {\n\t\tcfg.Region = v\n\t}\n\n\treturn nil\n}\n\n// SharedConfigLoadError is an error for the shared config file failed to load.\ntype SharedConfigLoadError struct {\n\tFilename string\n\tErr      error\n}\n\n// Code is the short id of the error.\nfunc (e SharedConfigLoadError) Code() string {\n\treturn \"SharedConfigLoadError\"\n}\n\n// Message is the description of the error\nfunc (e SharedConfigLoadError) Message() string {\n\treturn fmt.Sprintf(\"failed to load config file, %s\", e.Filename)\n}\n\n// OrigErr is the underlying error that caused the failure.\nfunc (e SharedConfigLoadError) OrigErr() error {\n\treturn e.Err\n}\n\n// Error satisfies the error interface.\nfunc (e SharedConfigLoadError) Error() string {\n\treturn awserr.SprintError(e.Code(), e.Message(), \"\", e.Err)\n}\n\n// SharedConfigProfileNotExistsError is an error for the shared config when\n// the profile was not find in the config file.\ntype SharedConfigProfileNotExistsError struct {\n\tProfile string\n\tErr     error\n}\n\n// Code is the short id of the error.\nfunc (e SharedConfigProfileNotExistsError) Code() string {\n\treturn \"SharedConfigProfileNotExistsError\"\n}\n\n// Message is the description of the error\nfunc (e SharedConfigProfileNotExistsError) Message() string {\n\treturn fmt.Sprintf(\"failed to get profile, %s\", e.Profile)\n}\n\n// OrigErr is the underlying error that caused the failure.\nfunc (e SharedConfigProfileNotExistsError) OrigErr() error {\n\treturn e.Err\n}\n\n// Error satisfies the error interface.\nfunc (e SharedConfigProfileNotExistsError) Error() string {\n\treturn awserr.SprintError(e.Code(), e.Message(), \"\", e.Err)\n}\n\n// SharedConfigAssumeRoleError is an error for the shared config when the\n// profile contains assume role information, but that information is invalid\n// or not complete.\ntype SharedConfigAssumeRoleError struct {\n\tRoleARN string\n}\n\n// Code is the short id of the error.\nfunc (e SharedConfigAssumeRoleError) Code() string {\n\treturn \"SharedConfigAssumeRoleError\"\n}\n\n// Message is the description of the error\nfunc (e SharedConfigAssumeRoleError) Message() string {\n\treturn fmt.Sprintf(\"failed to load assume role for %s, source profile has no shared credentials\",\n\t\te.RoleARN)\n}\n\n// OrigErr is the underlying error that caused the failure.\nfunc (e SharedConfigAssumeRoleError) OrigErr() error {\n\treturn nil\n}\n\n// Error satisfies the error interface.\nfunc (e SharedConfigAssumeRoleError) Error() string {\n\treturn awserr.SprintError(e.Code(), e.Message(), \"\", nil)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules.go",
    "content": "package v4\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\n// validator houses a set of rule needed for validation of a\n// string value\ntype rules []rule\n\n// rule interface allows for more flexible rules and just simply\n// checks whether or not a value adheres to that rule\ntype rule interface {\n\tIsValid(value string) bool\n}\n\n// IsValid will iterate through all rules and see if any rules\n// apply to the value and supports nested rules\nfunc (r rules) IsValid(value string) bool {\n\tfor _, rule := range r {\n\t\tif rule.IsValid(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// mapRule generic rule for maps\ntype mapRule map[string]struct{}\n\n// IsValid for the map rule satisfies whether it exists in the map\nfunc (m mapRule) IsValid(value string) bool {\n\t_, ok := m[value]\n\treturn ok\n}\n\n// whitelist is a generic rule for whitelisting\ntype whitelist struct {\n\trule\n}\n\n// IsValid for whitelist checks if the value is within the whitelist\nfunc (w whitelist) IsValid(value string) bool {\n\treturn w.rule.IsValid(value)\n}\n\n// blacklist is a generic rule for blacklisting\ntype blacklist struct {\n\trule\n}\n\n// IsValid for whitelist checks if the value is within the whitelist\nfunc (b blacklist) IsValid(value string) bool {\n\treturn !b.rule.IsValid(value)\n}\n\ntype patterns []string\n\n// IsValid for patterns checks each pattern and returns if a match has\n// been found\nfunc (p patterns) IsValid(value string) bool {\n\tfor _, pattern := range p {\n\t\tif strings.HasPrefix(http.CanonicalHeaderKey(value), pattern) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// inclusiveRules rules allow for rules to depend on one another\ntype inclusiveRules []rule\n\n// IsValid will return true if all rules are true\nfunc (r inclusiveRules) IsValid(value string) bool {\n\tfor _, rule := range r {\n\t\tif !rule.IsValid(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go",
    "content": "// Package v4 implements signing for AWS V4 signer\n//\n// Provides request signing for request that need to be signed with\n// AWS V4 Signatures.\npackage v4\n\nimport (\n\t\"bytes\"\n\t\"crypto/hmac\"\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n\t\"github.com/aws/aws-sdk-go/private/protocol/rest\"\n)\n\nconst (\n\tauthHeaderPrefix = \"AWS4-HMAC-SHA256\"\n\ttimeFormat       = \"20060102T150405Z\"\n\tshortTimeFormat  = \"20060102\"\n\n\t// emptyStringSHA256 is a SHA256 of an empty string\n\temptyStringSHA256 = `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`\n)\n\nvar ignoredHeaders = rules{\n\tblacklist{\n\t\tmapRule{\n\t\t\t\"Authorization\": struct{}{},\n\t\t\t\"User-Agent\":    struct{}{},\n\t\t},\n\t},\n}\n\n// requiredSignedHeaders is a whitelist for build canonical headers.\nvar requiredSignedHeaders = rules{\n\twhitelist{\n\t\tmapRule{\n\t\t\t\"Cache-Control\":                                               struct{}{},\n\t\t\t\"Content-Disposition\":                                         struct{}{},\n\t\t\t\"Content-Encoding\":                                            struct{}{},\n\t\t\t\"Content-Language\":                                            struct{}{},\n\t\t\t\"Content-Md5\":                                                 struct{}{},\n\t\t\t\"Content-Type\":                                                struct{}{},\n\t\t\t\"Expires\":                                                     struct{}{},\n\t\t\t\"If-Match\":                                                    struct{}{},\n\t\t\t\"If-Modified-Since\":                                           struct{}{},\n\t\t\t\"If-None-Match\":                                               struct{}{},\n\t\t\t\"If-Unmodified-Since\":                                         struct{}{},\n\t\t\t\"Range\":                                                       struct{}{},\n\t\t\t\"X-Amz-Acl\":                                                   struct{}{},\n\t\t\t\"X-Amz-Copy-Source\":                                           struct{}{},\n\t\t\t\"X-Amz-Copy-Source-If-Match\":                                  struct{}{},\n\t\t\t\"X-Amz-Copy-Source-If-Modified-Since\":                         struct{}{},\n\t\t\t\"X-Amz-Copy-Source-If-None-Match\":                             struct{}{},\n\t\t\t\"X-Amz-Copy-Source-If-Unmodified-Since\":                       struct{}{},\n\t\t\t\"X-Amz-Copy-Source-Range\":                                     struct{}{},\n\t\t\t\"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm\": struct{}{},\n\t\t\t\"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key\":       struct{}{},\n\t\t\t\"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5\":   struct{}{},\n\t\t\t\"X-Amz-Grant-Full-control\":                                    struct{}{},\n\t\t\t\"X-Amz-Grant-Read\":                                            struct{}{},\n\t\t\t\"X-Amz-Grant-Read-Acp\":                                        struct{}{},\n\t\t\t\"X-Amz-Grant-Write\":                                           struct{}{},\n\t\t\t\"X-Amz-Grant-Write-Acp\":                                       struct{}{},\n\t\t\t\"X-Amz-Metadata-Directive\":                                    struct{}{},\n\t\t\t\"X-Amz-Mfa\":                                                   struct{}{},\n\t\t\t\"X-Amz-Request-Payer\":                                         struct{}{},\n\t\t\t\"X-Amz-Server-Side-Encryption\":                                struct{}{},\n\t\t\t\"X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id\":                 struct{}{},\n\t\t\t\"X-Amz-Server-Side-Encryption-Customer-Algorithm\":             struct{}{},\n\t\t\t\"X-Amz-Server-Side-Encryption-Customer-Key\":                   struct{}{},\n\t\t\t\"X-Amz-Server-Side-Encryption-Customer-Key-Md5\":               struct{}{},\n\t\t\t\"X-Amz-Storage-Class\":                                         struct{}{},\n\t\t\t\"X-Amz-Website-Redirect-Location\":                             struct{}{},\n\t\t},\n\t},\n\tpatterns{\"X-Amz-Meta-\"},\n}\n\n// allowedHoisting is a whitelist for build query headers. The boolean value\n// represents whether or not it is a pattern.\nvar allowedQueryHoisting = inclusiveRules{\n\tblacklist{requiredSignedHeaders},\n\tpatterns{\"X-Amz-\"},\n}\n\n// Signer applies AWS v4 signing to given request. Use this to sign requests\n// that need to be signed with AWS V4 Signatures.\ntype Signer struct {\n\t// The authentication credentials the request will be signed against.\n\t// This value must be set to sign requests.\n\tCredentials *credentials.Credentials\n\n\t// Sets the log level the signer should use when reporting information to\n\t// the logger. If the logger is nil nothing will be logged. See\n\t// aws.LogLevelType for more information on available logging levels\n\t//\n\t// By default nothing will be logged.\n\tDebug aws.LogLevelType\n\n\t// The logger loging information will be written to. If there the logger\n\t// is nil, nothing will be logged.\n\tLogger aws.Logger\n\n\t// Disables the Signer's moving HTTP header key/value pairs from the HTTP\n\t// request header to the request's query string. This is most commonly used\n\t// with pre-signed requests preventing headers from being added to the\n\t// request's query string.\n\tDisableHeaderHoisting bool\n\n\t// currentTimeFn returns the time value which represents the current time.\n\t// This value should only be used for testing. If it is nil the default\n\t// time.Now will be used.\n\tcurrentTimeFn func() time.Time\n}\n\n// NewSigner returns a Signer pointer configured with the credentials and optional\n// option values provided. If not options are provided the Signer will use its\n// default configuration.\nfunc NewSigner(credentials *credentials.Credentials, options ...func(*Signer)) *Signer {\n\tv4 := &Signer{\n\t\tCredentials: credentials,\n\t}\n\n\tfor _, option := range options {\n\t\toption(v4)\n\t}\n\n\treturn v4\n}\n\ntype signingCtx struct {\n\tServiceName      string\n\tRegion           string\n\tRequest          *http.Request\n\tBody             io.ReadSeeker\n\tQuery            url.Values\n\tTime             time.Time\n\tExpireTime       time.Duration\n\tSignedHeaderVals http.Header\n\n\tcredValues         credentials.Value\n\tisPresign          bool\n\tformattedTime      string\n\tformattedShortTime string\n\n\tbodyDigest       string\n\tsignedHeaders    string\n\tcanonicalHeaders string\n\tcanonicalString  string\n\tcredentialString string\n\tstringToSign     string\n\tsignature        string\n\tauthorization    string\n}\n\n// Sign signs AWS v4 requests with the provided body, service name, region the\n// request is made to, and time the request is signed at. The signTime allows\n// you to specify that a request is signed for the future, and cannot be\n// used until then.\n//\n// Returns a list of HTTP headers that were included in the signature or an\n// error if signing the request failed. Generally for signed requests this value\n// is not needed as the full request context will be captured by the http.Request\n// value. It is included for reference though.\n//\n// Sign differs from Presign in that it will sign the request using HTTP\n// header values. This type of signing is intended for http.Request values that\n// will not be shared, or are shared in a way the header values on the request\n// will not be lost.\n//\n// The requests body is an io.ReadSeeker so the SHA256 of the body can be\n// generated. To bypass the signer computing the hash you can set the\n// \"X-Amz-Content-Sha256\" header with a precomputed value. The signer will\n// only compute the hash if the request header value is empty.\nfunc (v4 Signer) Sign(r *http.Request, body io.ReadSeeker, service, region string, signTime time.Time) (http.Header, error) {\n\treturn v4.signWithBody(r, body, service, region, 0, signTime)\n}\n\n// Presign signs AWS v4 requests with the provided body, service name, region\n// the request is made to, and time the request is signed at. The signTime\n// allows you to specify that a request is signed for the future, and cannot\n// be used until then.\n//\n// Returns a list of HTTP headers that were included in the signature or an\n// error if signing the request failed. For presigned requests these headers\n// and their values must be included on the HTTP request when it is made. This\n// is helpful to know what header values need to be shared with the party the\n// presigned request will be distributed to.\n//\n// Presign differs from Sign in that it will sign the request using query string\n// instead of header values. This allows you to share the Presigned Request's\n// URL with third parties, or distribute it throughout your system with minimal\n// dependencies.\n//\n// Presign also takes an exp value which is the duration the\n// signed request will be valid after the signing time. This is allows you to\n// set when the request will expire.\n//\n// The requests body is an io.ReadSeeker so the SHA256 of the body can be\n// generated. To bypass the signer computing the hash you can set the\n// \"X-Amz-Content-Sha256\" header with a precomputed value. The signer will\n// only compute the hash if the request header value is empty.\n//\n// Presigning a S3 request will not compute the body's SHA256 hash by default.\n// This is done due to the general use case for S3 presigned URLs is to share\n// PUT/GET capabilities. If you would like to include the body's SHA256 in the\n// presigned request's signature you can set the \"X-Amz-Content-Sha256\"\n// HTTP header and that will be included in the request's signature.\nfunc (v4 Signer) Presign(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, signTime time.Time) (http.Header, error) {\n\treturn v4.signWithBody(r, body, service, region, exp, signTime)\n}\n\nfunc (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, signTime time.Time) (http.Header, error) {\n\tcurrentTimeFn := v4.currentTimeFn\n\tif currentTimeFn == nil {\n\t\tcurrentTimeFn = time.Now\n\t}\n\n\tctx := &signingCtx{\n\t\tRequest:     r,\n\t\tBody:        body,\n\t\tQuery:       r.URL.Query(),\n\t\tTime:        signTime,\n\t\tExpireTime:  exp,\n\t\tisPresign:   exp != 0,\n\t\tServiceName: service,\n\t\tRegion:      region,\n\t}\n\n\tif ctx.isRequestSigned() {\n\t\tif !v4.Credentials.IsExpired() && currentTimeFn().Before(ctx.Time.Add(10*time.Minute)) {\n\t\t\t// If the request is already signed, and the credentials have not\n\t\t\t// expired, and the request is not too old ignore the signing request.\n\t\t\treturn ctx.SignedHeaderVals, nil\n\t\t}\n\t\tctx.Time = currentTimeFn()\n\t\tctx.handlePresignRemoval()\n\t}\n\n\tvar err error\n\tctx.credValues, err = v4.Credentials.Get()\n\tif err != nil {\n\t\treturn http.Header{}, err\n\t}\n\n\tctx.assignAmzQueryValues()\n\tctx.build(v4.DisableHeaderHoisting)\n\n\tif v4.Debug.Matches(aws.LogDebugWithSigning) {\n\t\tv4.logSigningInfo(ctx)\n\t}\n\n\treturn ctx.SignedHeaderVals, nil\n}\n\nfunc (ctx *signingCtx) handlePresignRemoval() {\n\tif !ctx.isPresign {\n\t\treturn\n\t}\n\n\t// The credentials have expired for this request. The current signing\n\t// is invalid, and needs to be request because the request will fail.\n\tctx.removePresign()\n\n\t// Update the request's query string to ensure the values stays in\n\t// sync in the case retrieving the new credentials fails.\n\tctx.Request.URL.RawQuery = ctx.Query.Encode()\n}\n\nfunc (ctx *signingCtx) assignAmzQueryValues() {\n\tif ctx.isPresign {\n\t\tctx.Query.Set(\"X-Amz-Algorithm\", authHeaderPrefix)\n\t\tif ctx.credValues.SessionToken != \"\" {\n\t\t\tctx.Query.Set(\"X-Amz-Security-Token\", ctx.credValues.SessionToken)\n\t\t} else {\n\t\t\tctx.Query.Del(\"X-Amz-Security-Token\")\n\t\t}\n\n\t\treturn\n\t}\n\n\tif ctx.credValues.SessionToken != \"\" {\n\t\tctx.Request.Header.Set(\"X-Amz-Security-Token\", ctx.credValues.SessionToken)\n\t}\n}\n\n// SignRequestHandler is a named request handler the SDK will use to sign\n// service client request with using the V4 signature.\nvar SignRequestHandler = request.NamedHandler{\n\tName: \"v4.SignRequestHandler\", Fn: SignSDKRequest,\n}\n\n// SignSDKRequest signs an AWS request with the V4 signature. This\n// request handler is bested used only with the SDK's built in service client's\n// API operation requests.\n//\n// This function should not be used on its on its own, but in conjunction with\n// an AWS service client's API operation call. To sign a standalone request\n// not created by a service client's API operation method use the \"Sign\" or\n// \"Presign\" functions of the \"Signer\" type.\n//\n// If the credentials of the request's config are set to\n// credentials.AnonymousCredentials the request will not be signed.\nfunc SignSDKRequest(req *request.Request) {\n\tsignSDKRequestWithCurrTime(req, time.Now)\n}\nfunc signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time) {\n\t// If the request does not need to be signed ignore the signing of the\n\t// request if the AnonymousCredentials object is used.\n\tif req.Config.Credentials == credentials.AnonymousCredentials {\n\t\treturn\n\t}\n\n\tregion := req.ClientInfo.SigningRegion\n\tif region == \"\" {\n\t\tregion = aws.StringValue(req.Config.Region)\n\t}\n\n\tname := req.ClientInfo.SigningName\n\tif name == \"\" {\n\t\tname = req.ClientInfo.ServiceName\n\t}\n\n\tv4 := NewSigner(req.Config.Credentials, func(v4 *Signer) {\n\t\tv4.Debug = req.Config.LogLevel.Value()\n\t\tv4.Logger = req.Config.Logger\n\t\tv4.DisableHeaderHoisting = req.NotHoist\n\t\tv4.currentTimeFn = curTimeFn\n\t})\n\n\tsigningTime := req.Time\n\tif !req.LastSignedAt.IsZero() {\n\t\tsigningTime = req.LastSignedAt\n\t}\n\n\tsignedHeaders, err := v4.signWithBody(req.HTTPRequest, req.Body, name, region, req.ExpireTime, signingTime)\n\tif err != nil {\n\t\treq.Error = err\n\t\treq.SignedHeaderVals = nil\n\t\treturn\n\t}\n\n\treq.SignedHeaderVals = signedHeaders\n\treq.LastSignedAt = curTimeFn()\n}\n\nconst logSignInfoMsg = `DEBUG: Request Signiture:\n---[ CANONICAL STRING  ]-----------------------------\n%s\n---[ STRING TO SIGN ]--------------------------------\n%s%s\n-----------------------------------------------------`\nconst logSignedURLMsg = `\n---[ SIGNED URL ]------------------------------------\n%s`\n\nfunc (v4 *Signer) logSigningInfo(ctx *signingCtx) {\n\tsignedURLMsg := \"\"\n\tif ctx.isPresign {\n\t\tsignedURLMsg = fmt.Sprintf(logSignedURLMsg, ctx.Request.URL.String())\n\t}\n\tmsg := fmt.Sprintf(logSignInfoMsg, ctx.canonicalString, ctx.stringToSign, signedURLMsg)\n\tv4.Logger.Log(msg)\n}\n\nfunc (ctx *signingCtx) build(disableHeaderHoisting bool) {\n\tctx.buildTime()             // no depends\n\tctx.buildCredentialString() // no depends\n\n\tunsignedHeaders := ctx.Request.Header\n\tif ctx.isPresign {\n\t\tif !disableHeaderHoisting {\n\t\t\turlValues := url.Values{}\n\t\t\turlValues, unsignedHeaders = buildQuery(allowedQueryHoisting, unsignedHeaders) // no depends\n\t\t\tfor k := range urlValues {\n\t\t\t\tctx.Query[k] = urlValues[k]\n\t\t\t}\n\t\t}\n\t}\n\n\tctx.buildBodyDigest()\n\tctx.buildCanonicalHeaders(ignoredHeaders, unsignedHeaders)\n\tctx.buildCanonicalString() // depends on canon headers / signed headers\n\tctx.buildStringToSign()    // depends on canon string\n\tctx.buildSignature()       // depends on string to sign\n\n\tif ctx.isPresign {\n\t\tctx.Request.URL.RawQuery += \"&X-Amz-Signature=\" + ctx.signature\n\t} else {\n\t\tparts := []string{\n\t\t\tauthHeaderPrefix + \" Credential=\" + ctx.credValues.AccessKeyID + \"/\" + ctx.credentialString,\n\t\t\t\"SignedHeaders=\" + ctx.signedHeaders,\n\t\t\t\"Signature=\" + ctx.signature,\n\t\t}\n\t\tctx.Request.Header.Set(\"Authorization\", strings.Join(parts, \", \"))\n\t}\n}\n\nfunc (ctx *signingCtx) buildTime() {\n\tctx.formattedTime = ctx.Time.UTC().Format(timeFormat)\n\tctx.formattedShortTime = ctx.Time.UTC().Format(shortTimeFormat)\n\n\tif ctx.isPresign {\n\t\tduration := int64(ctx.ExpireTime / time.Second)\n\t\tctx.Query.Set(\"X-Amz-Date\", ctx.formattedTime)\n\t\tctx.Query.Set(\"X-Amz-Expires\", strconv.FormatInt(duration, 10))\n\t} else {\n\t\tctx.Request.Header.Set(\"X-Amz-Date\", ctx.formattedTime)\n\t}\n}\n\nfunc (ctx *signingCtx) buildCredentialString() {\n\tctx.credentialString = strings.Join([]string{\n\t\tctx.formattedShortTime,\n\t\tctx.Region,\n\t\tctx.ServiceName,\n\t\t\"aws4_request\",\n\t}, \"/\")\n\n\tif ctx.isPresign {\n\t\tctx.Query.Set(\"X-Amz-Credential\", ctx.credValues.AccessKeyID+\"/\"+ctx.credentialString)\n\t}\n}\n\nfunc buildQuery(r rule, header http.Header) (url.Values, http.Header) {\n\tquery := url.Values{}\n\tunsignedHeaders := http.Header{}\n\tfor k, h := range header {\n\t\tif r.IsValid(k) {\n\t\t\tquery[k] = h\n\t\t} else {\n\t\t\tunsignedHeaders[k] = h\n\t\t}\n\t}\n\n\treturn query, unsignedHeaders\n}\nfunc (ctx *signingCtx) buildCanonicalHeaders(r rule, header http.Header) {\n\tvar headers []string\n\theaders = append(headers, \"host\")\n\tfor k, v := range header {\n\t\tcanonicalKey := http.CanonicalHeaderKey(k)\n\t\tif !r.IsValid(canonicalKey) {\n\t\t\tcontinue // ignored header\n\t\t}\n\t\tif ctx.SignedHeaderVals == nil {\n\t\t\tctx.SignedHeaderVals = make(http.Header)\n\t\t}\n\n\t\tlowerCaseKey := strings.ToLower(k)\n\t\tif _, ok := ctx.SignedHeaderVals[lowerCaseKey]; ok {\n\t\t\t// include additional values\n\t\t\tctx.SignedHeaderVals[lowerCaseKey] = append(ctx.SignedHeaderVals[lowerCaseKey], v...)\n\t\t\tcontinue\n\t\t}\n\n\t\theaders = append(headers, lowerCaseKey)\n\t\tctx.SignedHeaderVals[lowerCaseKey] = v\n\t}\n\tsort.Strings(headers)\n\n\tctx.signedHeaders = strings.Join(headers, \";\")\n\n\tif ctx.isPresign {\n\t\tctx.Query.Set(\"X-Amz-SignedHeaders\", ctx.signedHeaders)\n\t}\n\n\theaderValues := make([]string, len(headers))\n\tfor i, k := range headers {\n\t\tif k == \"host\" {\n\t\t\theaderValues[i] = \"host:\" + ctx.Request.URL.Host\n\t\t} else {\n\t\t\theaderValues[i] = k + \":\" +\n\t\t\t\tstrings.Join(ctx.SignedHeaderVals[k], \",\")\n\t\t}\n\t}\n\n\tctx.canonicalHeaders = strings.Join(stripExcessSpaces(headerValues), \"\\n\")\n}\n\nfunc (ctx *signingCtx) buildCanonicalString() {\n\tctx.Request.URL.RawQuery = strings.Replace(ctx.Query.Encode(), \"+\", \"%20\", -1)\n\turi := ctx.Request.URL.Opaque\n\tif uri != \"\" {\n\t\turi = \"/\" + strings.Join(strings.Split(uri, \"/\")[3:], \"/\")\n\t} else {\n\t\turi = ctx.Request.URL.Path\n\t}\n\tif uri == \"\" {\n\t\turi = \"/\"\n\t}\n\n\tif ctx.ServiceName != \"s3\" {\n\t\turi = rest.EscapePath(uri, false)\n\t}\n\n\tctx.canonicalString = strings.Join([]string{\n\t\tctx.Request.Method,\n\t\turi,\n\t\tctx.Request.URL.RawQuery,\n\t\tctx.canonicalHeaders + \"\\n\",\n\t\tctx.signedHeaders,\n\t\tctx.bodyDigest,\n\t}, \"\\n\")\n}\n\nfunc (ctx *signingCtx) buildStringToSign() {\n\tctx.stringToSign = strings.Join([]string{\n\t\tauthHeaderPrefix,\n\t\tctx.formattedTime,\n\t\tctx.credentialString,\n\t\thex.EncodeToString(makeSha256([]byte(ctx.canonicalString))),\n\t}, \"\\n\")\n}\n\nfunc (ctx *signingCtx) buildSignature() {\n\tsecret := ctx.credValues.SecretAccessKey\n\tdate := makeHmac([]byte(\"AWS4\"+secret), []byte(ctx.formattedShortTime))\n\tregion := makeHmac(date, []byte(ctx.Region))\n\tservice := makeHmac(region, []byte(ctx.ServiceName))\n\tcredentials := makeHmac(service, []byte(\"aws4_request\"))\n\tsignature := makeHmac(credentials, []byte(ctx.stringToSign))\n\tctx.signature = hex.EncodeToString(signature)\n}\n\nfunc (ctx *signingCtx) buildBodyDigest() {\n\thash := ctx.Request.Header.Get(\"X-Amz-Content-Sha256\")\n\tif hash == \"\" {\n\t\tif ctx.isPresign && ctx.ServiceName == \"s3\" {\n\t\t\thash = \"UNSIGNED-PAYLOAD\"\n\t\t} else if ctx.Body == nil {\n\t\t\thash = emptyStringSHA256\n\t\t} else {\n\t\t\thash = hex.EncodeToString(makeSha256Reader(ctx.Body))\n\t\t}\n\t\tif ctx.ServiceName == \"s3\" || ctx.ServiceName == \"glacier\" {\n\t\t\tctx.Request.Header.Set(\"X-Amz-Content-Sha256\", hash)\n\t\t}\n\t}\n\tctx.bodyDigest = hash\n}\n\n// isRequestSigned returns if the request is currently signed or presigned\nfunc (ctx *signingCtx) isRequestSigned() bool {\n\tif ctx.isPresign && ctx.Query.Get(\"X-Amz-Signature\") != \"\" {\n\t\treturn true\n\t}\n\tif ctx.Request.Header.Get(\"Authorization\") != \"\" {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n// unsign removes signing flags for both signed and presigned requests.\nfunc (ctx *signingCtx) removePresign() {\n\tctx.Query.Del(\"X-Amz-Algorithm\")\n\tctx.Query.Del(\"X-Amz-Signature\")\n\tctx.Query.Del(\"X-Amz-Security-Token\")\n\tctx.Query.Del(\"X-Amz-Date\")\n\tctx.Query.Del(\"X-Amz-Expires\")\n\tctx.Query.Del(\"X-Amz-Credential\")\n\tctx.Query.Del(\"X-Amz-SignedHeaders\")\n}\n\nfunc makeHmac(key []byte, data []byte) []byte {\n\thash := hmac.New(sha256.New, key)\n\thash.Write(data)\n\treturn hash.Sum(nil)\n}\n\nfunc makeSha256(data []byte) []byte {\n\thash := sha256.New()\n\thash.Write(data)\n\treturn hash.Sum(nil)\n}\n\nfunc makeSha256Reader(reader io.ReadSeeker) []byte {\n\thash := sha256.New()\n\tstart, _ := reader.Seek(0, 1)\n\tdefer reader.Seek(start, 0)\n\n\tio.Copy(hash, reader)\n\treturn hash.Sum(nil)\n}\n\nconst doubleSpaces = \"  \"\n\nvar doubleSpaceBytes = []byte(doubleSpaces)\n\nfunc stripExcessSpaces(headerVals []string) []string {\n\tvals := make([]string, len(headerVals))\n\tfor i, str := range headerVals {\n\t\t// Trim leading and trailing spaces\n\t\ttrimmed := strings.TrimSpace(str)\n\n\t\tidx := strings.Index(trimmed, doubleSpaces)\n\t\tvar buf []byte\n\t\tfor idx > -1 {\n\t\t\t// Multiple adjacent spaces found\n\t\t\tif buf == nil {\n\t\t\t\t// first time create the buffer\n\t\t\t\tbuf = []byte(trimmed)\n\t\t\t}\n\n\t\t\tstripToIdx := -1\n\t\t\tfor j := idx + 1; j < len(buf); j++ {\n\t\t\t\tif buf[j] != ' ' {\n\t\t\t\t\tbuf = append(buf[:idx+1], buf[j:]...)\n\t\t\t\t\tstripToIdx = j\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif stripToIdx >= 0 {\n\t\t\t\tidx = bytes.Index(buf[stripToIdx:], doubleSpaceBytes)\n\t\t\t\tif idx >= 0 {\n\t\t\t\t\tidx += stripToIdx\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tidx = -1\n\t\t\t}\n\t\t}\n\n\t\tif buf != nil {\n\t\t\tvals[i] = string(buf)\n\t\t} else {\n\t\t\tvals[i] = trimmed\n\t\t}\n\t}\n\treturn vals\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/types.go",
    "content": "package aws\n\nimport (\n\t\"io\"\n\t\"sync\"\n)\n\n// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser\nfunc ReadSeekCloser(r io.Reader) ReaderSeekerCloser {\n\treturn ReaderSeekerCloser{r}\n}\n\n// ReaderSeekerCloser represents a reader that can also delegate io.Seeker and\n// io.Closer interfaces to the underlying object if they are available.\ntype ReaderSeekerCloser struct {\n\tr io.Reader\n}\n\n// Read reads from the reader up to size of p. The number of bytes read, and\n// error if it occurred will be returned.\n//\n// If the reader is not an io.Reader zero bytes read, and nil error will be returned.\n//\n// Performs the same functionality as io.Reader Read\nfunc (r ReaderSeekerCloser) Read(p []byte) (int, error) {\n\tswitch t := r.r.(type) {\n\tcase io.Reader:\n\t\treturn t.Read(p)\n\t}\n\treturn 0, nil\n}\n\n// Seek sets the offset for the next Read to offset, interpreted according to\n// whence: 0 means relative to the origin of the file, 1 means relative to the\n// current offset, and 2 means relative to the end. Seek returns the new offset\n// and an error, if any.\n//\n// If the ReaderSeekerCloser is not an io.Seeker nothing will be done.\nfunc (r ReaderSeekerCloser) Seek(offset int64, whence int) (int64, error) {\n\tswitch t := r.r.(type) {\n\tcase io.Seeker:\n\t\treturn t.Seek(offset, whence)\n\t}\n\treturn int64(0), nil\n}\n\n// Close closes the ReaderSeekerCloser.\n//\n// If the ReaderSeekerCloser is not an io.Closer nothing will be done.\nfunc (r ReaderSeekerCloser) Close() error {\n\tswitch t := r.r.(type) {\n\tcase io.Closer:\n\t\treturn t.Close()\n\t}\n\treturn nil\n}\n\n// A WriteAtBuffer provides a in memory buffer supporting the io.WriterAt interface\n// Can be used with the s3manager.Downloader to download content to a buffer\n// in memory. Safe to use concurrently.\ntype WriteAtBuffer struct {\n\tbuf []byte\n\tm   sync.Mutex\n\n\t// GrowthCoeff defines the growth rate of the internal buffer. By\n\t// default, the growth rate is 1, where expanding the internal\n\t// buffer will allocate only enough capacity to fit the new expected\n\t// length.\n\tGrowthCoeff float64\n}\n\n// NewWriteAtBuffer creates a WriteAtBuffer with an internal buffer\n// provided by buf.\nfunc NewWriteAtBuffer(buf []byte) *WriteAtBuffer {\n\treturn &WriteAtBuffer{buf: buf}\n}\n\n// WriteAt writes a slice of bytes to a buffer starting at the position provided\n// The number of bytes written will be returned, or error. Can overwrite previous\n// written slices if the write ats overlap.\nfunc (b *WriteAtBuffer) WriteAt(p []byte, pos int64) (n int, err error) {\n\tpLen := len(p)\n\texpLen := pos + int64(pLen)\n\tb.m.Lock()\n\tdefer b.m.Unlock()\n\tif int64(len(b.buf)) < expLen {\n\t\tif int64(cap(b.buf)) < expLen {\n\t\t\tif b.GrowthCoeff < 1 {\n\t\t\t\tb.GrowthCoeff = 1\n\t\t\t}\n\t\t\tnewBuf := make([]byte, expLen, int64(b.GrowthCoeff*float64(expLen)))\n\t\t\tcopy(newBuf, b.buf)\n\t\t\tb.buf = newBuf\n\t\t}\n\t\tb.buf = b.buf[:expLen]\n\t}\n\tcopy(b.buf[pos:], p)\n\treturn pLen, nil\n}\n\n// Bytes returns a slice of bytes written to the buffer.\nfunc (b *WriteAtBuffer) Bytes() []byte {\n\tb.m.Lock()\n\tdefer b.m.Unlock()\n\treturn b.buf[:len(b.buf):len(b.buf)]\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/aws/version.go",
    "content": "// Package aws provides core functionality for making requests to AWS services.\npackage aws\n\n// SDKName is the name of this AWS SDK\nconst SDKName = \"aws-sdk-go\"\n\n// SDKVersion is the version of this SDK\nconst SDKVersion = \"1.4.10\"\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go",
    "content": "// Package endpoints validates regional endpoints for services.\npackage endpoints\n\n//go:generate go run ../model/cli/gen-endpoints/main.go endpoints.json endpoints_map.go\n//go:generate gofmt -s -w endpoints_map.go\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n)\n\n// NormalizeEndpoint takes and endpoint and service API information to return a\n// normalized endpoint and signing region.  If the endpoint is not an empty string\n// the service name and region will be used to look up the service's API endpoint.\n// If the endpoint is provided the scheme will be added if it is not present.\nfunc NormalizeEndpoint(endpoint, serviceName, region string, disableSSL, useDualStack bool) (normEndpoint, signingRegion string) {\n\tif endpoint == \"\" {\n\t\treturn EndpointForRegion(serviceName, region, disableSSL, useDualStack)\n\t}\n\n\treturn AddScheme(endpoint, disableSSL), \"\"\n}\n\n// EndpointForRegion returns an endpoint and its signing region for a service and region.\n// if the service and region pair are not found endpoint and signingRegion will be empty.\nfunc EndpointForRegion(svcName, region string, disableSSL, useDualStack bool) (endpoint, signingRegion string) {\n\tdualStackField := \"\"\n\tif useDualStack {\n\t\tdualStackField = \"/dualstack\"\n\t}\n\n\tderivedKeys := []string{\n\t\tregion + \"/\" + svcName + dualStackField,\n\t\tregion + \"/*\" + dualStackField,\n\t\t\"*/\" + svcName + dualStackField,\n\t\t\"*/*\" + dualStackField,\n\t}\n\n\tfor _, key := range derivedKeys {\n\t\tif val, ok := endpointsMap.Endpoints[key]; ok {\n\t\t\tep := val.Endpoint\n\t\t\tep = strings.Replace(ep, \"{region}\", region, -1)\n\t\t\tep = strings.Replace(ep, \"{service}\", svcName, -1)\n\n\t\t\tendpoint = ep\n\t\t\tsigningRegion = val.SigningRegion\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn AddScheme(endpoint, disableSSL), signingRegion\n}\n\n// Regular expression to determine if the endpoint string is prefixed with a scheme.\nvar schemeRE = regexp.MustCompile(\"^([^:]+)://\")\n\n// AddScheme adds the HTTP or HTTPS schemes to a endpoint URL if there is no\n// scheme. If disableSSL is true HTTP will be added instead of the default HTTPS.\nfunc AddScheme(endpoint string, disableSSL bool) string {\n\tif endpoint != \"\" && !schemeRE.MatchString(endpoint) {\n\t\tscheme := \"https\"\n\t\tif disableSSL {\n\t\t\tscheme = \"http\"\n\t\t}\n\t\tendpoint = fmt.Sprintf(\"%s://%s\", scheme, endpoint)\n\t}\n\n\treturn endpoint\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json",
    "content": "{\n  \"version\": 2,\n  \"endpoints\": {\n    \"*/*\": {\n      \"endpoint\": \"{service}.{region}.amazonaws.com\"\n    },\n    \"cn-north-1/*\": {\n      \"endpoint\": \"{service}.{region}.amazonaws.com.cn\",\n      \"signatureVersion\": \"v4\"\n    },\n    \"cn-north-1/ec2metadata\": {\n      \"endpoint\": \"http://169.254.169.254/latest\"\n    },\n    \"us-gov-west-1/iam\": {\n      \"endpoint\": \"iam.us-gov.amazonaws.com\"\n    },\n    \"us-gov-west-1/sts\": {\n      \"endpoint\": \"sts.us-gov-west-1.amazonaws.com\"\n    },\n    \"us-gov-west-1/s3\": {\n      \"endpoint\": \"s3-{region}.amazonaws.com\"\n    },\n    \"us-gov-west-1/ec2metadata\": {\n      \"endpoint\": \"http://169.254.169.254/latest\"\n    },\n    \"*/cloudfront\": {\n      \"endpoint\": \"cloudfront.amazonaws.com\",\n      \"signingRegion\": \"us-east-1\"\n    },\n    \"*/cloudsearchdomain\": {\n      \"endpoint\": \"\",\n      \"signingRegion\": \"us-east-1\"\n    },\n    \"*/data.iot\": {\n      \"endpoint\": \"\",\n      \"signingRegion\": \"us-east-1\"\n    },\n    \"*/ec2metadata\": {\n      \"endpoint\": \"http://169.254.169.254/latest\"\n    },\n    \"*/iam\": {\n      \"endpoint\": \"iam.amazonaws.com\",\n      \"signingRegion\": \"us-east-1\"\n    },\n    \"*/importexport\": {\n      \"endpoint\": \"importexport.amazonaws.com\",\n      \"signingRegion\": \"us-east-1\"\n    },\n    \"*/route53\": {\n      \"endpoint\": \"route53.amazonaws.com\",\n      \"signingRegion\": \"us-east-1\"\n    },\n    \"*/sts\": {\n      \"endpoint\": \"sts.amazonaws.com\",\n      \"signingRegion\": \"us-east-1\"\n    },\n    \"*/waf\": {\n      \"endpoint\": \"waf.amazonaws.com\",\n      \"signingRegion\": \"us-east-1\"\n    },\n    \"us-east-1/sdb\": {\n      \"endpoint\": \"sdb.amazonaws.com\",\n      \"signingRegion\": \"us-east-1\"\n    },\n    \"*/s3\": {\n      \"endpoint\": \"s3-{region}.amazonaws.com\"\n    },\n    \"*/s3/dualstack\": {\n      \"endpoint\": \"s3.dualstack.{region}.amazonaws.com\"\n    },\n    \"us-east-1/s3\": {\n      \"endpoint\": \"s3.amazonaws.com\"\n    },\n    \"eu-central-1/s3\": {\n      \"endpoint\": \"{service}.{region}.amazonaws.com\"\n    }\n  }\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go",
    "content": "package endpoints\n\n// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n\ntype endpointStruct struct {\n\tVersion   int\n\tEndpoints map[string]endpointEntry\n}\n\ntype endpointEntry struct {\n\tEndpoint      string\n\tSigningRegion string\n}\n\nvar endpointsMap = endpointStruct{\n\tVersion: 2,\n\tEndpoints: map[string]endpointEntry{\n\t\t\"*/*\": {\n\t\t\tEndpoint: \"{service}.{region}.amazonaws.com\",\n\t\t},\n\t\t\"*/cloudfront\": {\n\t\t\tEndpoint:      \"cloudfront.amazonaws.com\",\n\t\t\tSigningRegion: \"us-east-1\",\n\t\t},\n\t\t\"*/cloudsearchdomain\": {\n\t\t\tEndpoint:      \"\",\n\t\t\tSigningRegion: \"us-east-1\",\n\t\t},\n\t\t\"*/data.iot\": {\n\t\t\tEndpoint:      \"\",\n\t\t\tSigningRegion: \"us-east-1\",\n\t\t},\n\t\t\"*/ec2metadata\": {\n\t\t\tEndpoint: \"http://169.254.169.254/latest\",\n\t\t},\n\t\t\"*/iam\": {\n\t\t\tEndpoint:      \"iam.amazonaws.com\",\n\t\t\tSigningRegion: \"us-east-1\",\n\t\t},\n\t\t\"*/importexport\": {\n\t\t\tEndpoint:      \"importexport.amazonaws.com\",\n\t\t\tSigningRegion: \"us-east-1\",\n\t\t},\n\t\t\"*/route53\": {\n\t\t\tEndpoint:      \"route53.amazonaws.com\",\n\t\t\tSigningRegion: \"us-east-1\",\n\t\t},\n\t\t\"*/s3\": {\n\t\t\tEndpoint: \"s3-{region}.amazonaws.com\",\n\t\t},\n\t\t\"*/s3/dualstack\": {\n\t\t\tEndpoint: \"s3.dualstack.{region}.amazonaws.com\",\n\t\t},\n\t\t\"*/sts\": {\n\t\t\tEndpoint:      \"sts.amazonaws.com\",\n\t\t\tSigningRegion: \"us-east-1\",\n\t\t},\n\t\t\"*/waf\": {\n\t\t\tEndpoint:      \"waf.amazonaws.com\",\n\t\t\tSigningRegion: \"us-east-1\",\n\t\t},\n\t\t\"cn-north-1/*\": {\n\t\t\tEndpoint: \"{service}.{region}.amazonaws.com.cn\",\n\t\t},\n\t\t\"cn-north-1/ec2metadata\": {\n\t\t\tEndpoint: \"http://169.254.169.254/latest\",\n\t\t},\n\t\t\"eu-central-1/s3\": {\n\t\t\tEndpoint: \"{service}.{region}.amazonaws.com\",\n\t\t},\n\t\t\"us-east-1/s3\": {\n\t\t\tEndpoint: \"s3.amazonaws.com\",\n\t\t},\n\t\t\"us-east-1/sdb\": {\n\t\t\tEndpoint:      \"sdb.amazonaws.com\",\n\t\t\tSigningRegion: \"us-east-1\",\n\t\t},\n\t\t\"us-gov-west-1/ec2metadata\": {\n\t\t\tEndpoint: \"http://169.254.169.254/latest\",\n\t\t},\n\t\t\"us-gov-west-1/iam\": {\n\t\t\tEndpoint: \"iam.us-gov.amazonaws.com\",\n\t\t},\n\t\t\"us-gov-west-1/s3\": {\n\t\t\tEndpoint: \"s3-{region}.amazonaws.com\",\n\t\t},\n\t\t\"us-gov-west-1/sts\": {\n\t\t\tEndpoint: \"sts.us-gov-west-1.amazonaws.com\",\n\t\t},\n\t},\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/idempotency.go",
    "content": "package protocol\n\nimport (\n\t\"crypto/rand\"\n\t\"fmt\"\n\t\"reflect\"\n)\n\n// RandReader is the random reader the protocol package will use to read\n// random bytes from. This is exported for testing, and should not be used.\nvar RandReader = rand.Reader\n\nconst idempotencyTokenFillTag = `idempotencyToken`\n\n// CanSetIdempotencyToken returns true if the struct field should be\n// automatically populated with a Idempotency token.\n//\n// Only *string and string type fields that are tagged with idempotencyToken\n// which are not already set can be auto filled.\nfunc CanSetIdempotencyToken(v reflect.Value, f reflect.StructField) bool {\n\tswitch u := v.Interface().(type) {\n\t// To auto fill an Idempotency token the field must be a string,\n\t// tagged for auto fill, and have a zero value.\n\tcase *string:\n\t\treturn u == nil && len(f.Tag.Get(idempotencyTokenFillTag)) != 0\n\tcase string:\n\t\treturn len(u) == 0 && len(f.Tag.Get(idempotencyTokenFillTag)) != 0\n\t}\n\n\treturn false\n}\n\n// GetIdempotencyToken returns a randomly generated idempotency token.\nfunc GetIdempotencyToken() string {\n\tb := make([]byte, 16)\n\tRandReader.Read(b)\n\n\treturn UUIDVersion4(b)\n}\n\n// SetIdempotencyToken will set the value provided with a Idempotency Token.\n// Given that the value can be set. Will panic if value is not setable.\nfunc SetIdempotencyToken(v reflect.Value) {\n\tif v.Kind() == reflect.Ptr {\n\t\tif v.IsNil() && v.CanSet() {\n\t\t\tv.Set(reflect.New(v.Type().Elem()))\n\t\t}\n\t\tv = v.Elem()\n\t}\n\tv = reflect.Indirect(v)\n\n\tif !v.CanSet() {\n\t\tpanic(fmt.Sprintf(\"unable to set idempotnecy token %v\", v))\n\t}\n\n\tb := make([]byte, 16)\n\t_, err := rand.Read(b)\n\tif err != nil {\n\t\t// TODO handle error\n\t\treturn\n\t}\n\n\tv.Set(reflect.ValueOf(UUIDVersion4(b)))\n}\n\n// UUIDVersion4 returns a Version 4 random UUID from the byte slice provided\nfunc UUIDVersion4(u []byte) string {\n\t// https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29\n\t// 13th character is \"4\"\n\tu[6] = (u[6] | 0x40) & 0x4F\n\t// 17th character is \"8\", \"9\", \"a\", or \"b\"\n\tu[8] = (u[8] | 0x80) & 0xBF\n\n\treturn fmt.Sprintf(`%X-%X-%X-%X-%X`, u[0:4], u[4:6], u[6:8], u[8:10], u[10:])\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go",
    "content": "// Package jsonutil provides JSON serialization of AWS requests and responses.\npackage jsonutil\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/private/protocol\"\n)\n\nvar timeType = reflect.ValueOf(time.Time{}).Type()\nvar byteSliceType = reflect.ValueOf([]byte{}).Type()\n\n// BuildJSON builds a JSON string for a given object v.\nfunc BuildJSON(v interface{}) ([]byte, error) {\n\tvar buf bytes.Buffer\n\n\terr := buildAny(reflect.ValueOf(v), &buf, \"\")\n\treturn buf.Bytes(), err\n}\n\nfunc buildAny(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error {\n\tvalue = reflect.Indirect(value)\n\tif !value.IsValid() {\n\t\treturn nil\n\t}\n\n\tvtype := value.Type()\n\n\tt := tag.Get(\"type\")\n\tif t == \"\" {\n\t\tswitch vtype.Kind() {\n\t\tcase reflect.Struct:\n\t\t\t// also it can't be a time object\n\t\t\tif value.Type() != timeType {\n\t\t\t\tt = \"structure\"\n\t\t\t}\n\t\tcase reflect.Slice:\n\t\t\t// also it can't be a byte slice\n\t\t\tif _, ok := value.Interface().([]byte); !ok {\n\t\t\t\tt = \"list\"\n\t\t\t}\n\t\tcase reflect.Map:\n\t\t\tt = \"map\"\n\t\t}\n\t}\n\n\tswitch t {\n\tcase \"structure\":\n\t\tif field, ok := vtype.FieldByName(\"_\"); ok {\n\t\t\ttag = field.Tag\n\t\t}\n\t\treturn buildStruct(value, buf, tag)\n\tcase \"list\":\n\t\treturn buildList(value, buf, tag)\n\tcase \"map\":\n\t\treturn buildMap(value, buf, tag)\n\tdefault:\n\t\treturn buildScalar(value, buf, tag)\n\t}\n}\n\nfunc buildStruct(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error {\n\tif !value.IsValid() {\n\t\treturn nil\n\t}\n\n\t// unwrap payloads\n\tif payload := tag.Get(\"payload\"); payload != \"\" {\n\t\tfield, _ := value.Type().FieldByName(payload)\n\t\ttag = field.Tag\n\t\tvalue = elemOf(value.FieldByName(payload))\n\n\t\tif !value.IsValid() {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tbuf.WriteByte('{')\n\n\tt := value.Type()\n\tfirst := true\n\tfor i := 0; i < t.NumField(); i++ {\n\t\tmember := value.Field(i)\n\t\tfield := t.Field(i)\n\n\t\tif field.PkgPath != \"\" {\n\t\t\tcontinue // ignore unexported fields\n\t\t}\n\t\tif field.Tag.Get(\"json\") == \"-\" {\n\t\t\tcontinue\n\t\t}\n\t\tif field.Tag.Get(\"location\") != \"\" {\n\t\t\tcontinue // ignore non-body elements\n\t\t}\n\n\t\tif protocol.CanSetIdempotencyToken(member, field) {\n\t\t\ttoken := protocol.GetIdempotencyToken()\n\t\t\tmember = reflect.ValueOf(&token)\n\t\t}\n\n\t\tif (member.Kind() == reflect.Ptr || member.Kind() == reflect.Slice || member.Kind() == reflect.Map) && member.IsNil() {\n\t\t\tcontinue // ignore unset fields\n\t\t}\n\n\t\tif first {\n\t\t\tfirst = false\n\t\t} else {\n\t\t\tbuf.WriteByte(',')\n\t\t}\n\n\t\t// figure out what this field is called\n\t\tname := field.Name\n\t\tif locName := field.Tag.Get(\"locationName\"); locName != \"\" {\n\t\t\tname = locName\n\t\t}\n\n\t\twriteString(name, buf)\n\t\tbuf.WriteString(`:`)\n\n\t\terr := buildAny(member, buf, field.Tag)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\tbuf.WriteString(\"}\")\n\n\treturn nil\n}\n\nfunc buildList(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error {\n\tbuf.WriteString(\"[\")\n\n\tfor i := 0; i < value.Len(); i++ {\n\t\tbuildAny(value.Index(i), buf, \"\")\n\n\t\tif i < value.Len()-1 {\n\t\t\tbuf.WriteString(\",\")\n\t\t}\n\t}\n\n\tbuf.WriteString(\"]\")\n\n\treturn nil\n}\n\ntype sortedValues []reflect.Value\n\nfunc (sv sortedValues) Len() int           { return len(sv) }\nfunc (sv sortedValues) Swap(i, j int)      { sv[i], sv[j] = sv[j], sv[i] }\nfunc (sv sortedValues) Less(i, j int) bool { return sv[i].String() < sv[j].String() }\n\nfunc buildMap(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error {\n\tbuf.WriteString(\"{\")\n\n\tsv := sortedValues(value.MapKeys())\n\tsort.Sort(sv)\n\n\tfor i, k := range sv {\n\t\tif i > 0 {\n\t\t\tbuf.WriteByte(',')\n\t\t}\n\n\t\twriteString(k.String(), buf)\n\t\tbuf.WriteString(`:`)\n\n\t\tbuildAny(value.MapIndex(k), buf, \"\")\n\t}\n\n\tbuf.WriteString(\"}\")\n\n\treturn nil\n}\n\nfunc buildScalar(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error {\n\tswitch value.Kind() {\n\tcase reflect.String:\n\t\twriteString(value.String(), buf)\n\tcase reflect.Bool:\n\t\tbuf.WriteString(strconv.FormatBool(value.Bool()))\n\tcase reflect.Int64:\n\t\tbuf.WriteString(strconv.FormatInt(value.Int(), 10))\n\tcase reflect.Float64:\n\t\tbuf.WriteString(strconv.FormatFloat(value.Float(), 'f', -1, 64))\n\tdefault:\n\t\tswitch value.Type() {\n\t\tcase timeType:\n\t\t\tconverted := value.Interface().(time.Time)\n\t\t\tbuf.WriteString(strconv.FormatInt(converted.UTC().Unix(), 10))\n\t\tcase byteSliceType:\n\t\t\tif !value.IsNil() {\n\t\t\t\tconverted := value.Interface().([]byte)\n\t\t\t\tbuf.WriteByte('\"')\n\t\t\t\tif len(converted) < 1024 {\n\t\t\t\t\t// for small buffers, using Encode directly is much faster.\n\t\t\t\t\tdst := make([]byte, base64.StdEncoding.EncodedLen(len(converted)))\n\t\t\t\t\tbase64.StdEncoding.Encode(dst, converted)\n\t\t\t\t\tbuf.Write(dst)\n\t\t\t\t} else {\n\t\t\t\t\t// for large buffers, avoid unnecessary extra temporary\n\t\t\t\t\t// buffer space.\n\t\t\t\t\tenc := base64.NewEncoder(base64.StdEncoding, buf)\n\t\t\t\t\tenc.Write(converted)\n\t\t\t\t\tenc.Close()\n\t\t\t\t}\n\t\t\t\tbuf.WriteByte('\"')\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unsupported JSON value %v (%s)\", value.Interface(), value.Type())\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc writeString(s string, buf *bytes.Buffer) {\n\tbuf.WriteByte('\"')\n\tfor _, r := range s {\n\t\tif r == '\"' {\n\t\t\tbuf.WriteString(`\\\"`)\n\t\t} else if r == '\\\\' {\n\t\t\tbuf.WriteString(`\\\\`)\n\t\t} else if r == '\\b' {\n\t\t\tbuf.WriteString(`\\b`)\n\t\t} else if r == '\\f' {\n\t\t\tbuf.WriteString(`\\f`)\n\t\t} else if r == '\\r' {\n\t\t\tbuf.WriteString(`\\r`)\n\t\t} else if r == '\\t' {\n\t\t\tbuf.WriteString(`\\t`)\n\t\t} else if r == '\\n' {\n\t\t\tbuf.WriteString(`\\n`)\n\t\t} else if r < 32 {\n\t\t\tfmt.Fprintf(buf, \"\\\\u%0.4x\", r)\n\t\t} else {\n\t\t\tbuf.WriteRune(r)\n\t\t}\n\t}\n\tbuf.WriteByte('\"')\n}\n\n// Returns the reflection element of a value, if it is a pointer.\nfunc elemOf(value reflect.Value) reflect.Value {\n\tfor value.Kind() == reflect.Ptr {\n\t\tvalue = value.Elem()\n\t}\n\treturn value\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go",
    "content": "package jsonutil\n\nimport (\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"reflect\"\n\t\"time\"\n)\n\n// UnmarshalJSON reads a stream and unmarshals the results in object v.\nfunc UnmarshalJSON(v interface{}, stream io.Reader) error {\n\tvar out interface{}\n\n\tb, err := ioutil.ReadAll(stream)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(b) == 0 {\n\t\treturn nil\n\t}\n\n\tif err := json.Unmarshal(b, &out); err != nil {\n\t\treturn err\n\t}\n\n\treturn unmarshalAny(reflect.ValueOf(v), out, \"\")\n}\n\nfunc unmarshalAny(value reflect.Value, data interface{}, tag reflect.StructTag) error {\n\tvtype := value.Type()\n\tif vtype.Kind() == reflect.Ptr {\n\t\tvtype = vtype.Elem() // check kind of actual element type\n\t}\n\n\tt := tag.Get(\"type\")\n\tif t == \"\" {\n\t\tswitch vtype.Kind() {\n\t\tcase reflect.Struct:\n\t\t\t// also it can't be a time object\n\t\t\tif _, ok := value.Interface().(*time.Time); !ok {\n\t\t\t\tt = \"structure\"\n\t\t\t}\n\t\tcase reflect.Slice:\n\t\t\t// also it can't be a byte slice\n\t\t\tif _, ok := value.Interface().([]byte); !ok {\n\t\t\t\tt = \"list\"\n\t\t\t}\n\t\tcase reflect.Map:\n\t\t\tt = \"map\"\n\t\t}\n\t}\n\n\tswitch t {\n\tcase \"structure\":\n\t\tif field, ok := vtype.FieldByName(\"_\"); ok {\n\t\t\ttag = field.Tag\n\t\t}\n\t\treturn unmarshalStruct(value, data, tag)\n\tcase \"list\":\n\t\treturn unmarshalList(value, data, tag)\n\tcase \"map\":\n\t\treturn unmarshalMap(value, data, tag)\n\tdefault:\n\t\treturn unmarshalScalar(value, data, tag)\n\t}\n}\n\nfunc unmarshalStruct(value reflect.Value, data interface{}, tag reflect.StructTag) error {\n\tif data == nil {\n\t\treturn nil\n\t}\n\tmapData, ok := data.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"JSON value is not a structure (%#v)\", data)\n\t}\n\n\tt := value.Type()\n\tif value.Kind() == reflect.Ptr {\n\t\tif value.IsNil() { // create the structure if it's nil\n\t\t\ts := reflect.New(value.Type().Elem())\n\t\t\tvalue.Set(s)\n\t\t\tvalue = s\n\t\t}\n\n\t\tvalue = value.Elem()\n\t\tt = t.Elem()\n\t}\n\n\t// unwrap any payloads\n\tif payload := tag.Get(\"payload\"); payload != \"\" {\n\t\tfield, _ := t.FieldByName(payload)\n\t\treturn unmarshalAny(value.FieldByName(payload), data, field.Tag)\n\t}\n\n\tfor i := 0; i < t.NumField(); i++ {\n\t\tfield := t.Field(i)\n\t\tif field.PkgPath != \"\" {\n\t\t\tcontinue // ignore unexported fields\n\t\t}\n\n\t\t// figure out what this field is called\n\t\tname := field.Name\n\t\tif locName := field.Tag.Get(\"locationName\"); locName != \"\" {\n\t\t\tname = locName\n\t\t}\n\n\t\tmember := value.FieldByIndex(field.Index)\n\t\terr := unmarshalAny(member, mapData[name], field.Tag)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc unmarshalList(value reflect.Value, data interface{}, tag reflect.StructTag) error {\n\tif data == nil {\n\t\treturn nil\n\t}\n\tlistData, ok := data.([]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"JSON value is not a list (%#v)\", data)\n\t}\n\n\tif value.IsNil() {\n\t\tl := len(listData)\n\t\tvalue.Set(reflect.MakeSlice(value.Type(), l, l))\n\t}\n\n\tfor i, c := range listData {\n\t\terr := unmarshalAny(value.Index(i), c, \"\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc unmarshalMap(value reflect.Value, data interface{}, tag reflect.StructTag) error {\n\tif data == nil {\n\t\treturn nil\n\t}\n\tmapData, ok := data.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"JSON value is not a map (%#v)\", data)\n\t}\n\n\tif value.IsNil() {\n\t\tvalue.Set(reflect.MakeMap(value.Type()))\n\t}\n\n\tfor k, v := range mapData {\n\t\tkvalue := reflect.ValueOf(k)\n\t\tvvalue := reflect.New(value.Type().Elem()).Elem()\n\n\t\tunmarshalAny(vvalue, v, \"\")\n\t\tvalue.SetMapIndex(kvalue, vvalue)\n\t}\n\n\treturn nil\n}\n\nfunc unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTag) error {\n\terrf := func() error {\n\t\treturn fmt.Errorf(\"unsupported value: %v (%s)\", value.Interface(), value.Type())\n\t}\n\n\tswitch d := data.(type) {\n\tcase nil:\n\t\treturn nil // nothing to do here\n\tcase string:\n\t\tswitch value.Interface().(type) {\n\t\tcase *string:\n\t\t\tvalue.Set(reflect.ValueOf(&d))\n\t\tcase []byte:\n\t\t\tb, err := base64.StdEncoding.DecodeString(d)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tvalue.Set(reflect.ValueOf(b))\n\t\tdefault:\n\t\t\treturn errf()\n\t\t}\n\tcase float64:\n\t\tswitch value.Interface().(type) {\n\t\tcase *int64:\n\t\t\tdi := int64(d)\n\t\t\tvalue.Set(reflect.ValueOf(&di))\n\t\tcase *float64:\n\t\t\tvalue.Set(reflect.ValueOf(&d))\n\t\tcase *time.Time:\n\t\t\tt := time.Unix(int64(d), 0).UTC()\n\t\t\tvalue.Set(reflect.ValueOf(&t))\n\t\tdefault:\n\t\t\treturn errf()\n\t\t}\n\tcase bool:\n\t\tswitch value.Interface().(type) {\n\t\tcase *bool:\n\t\t\tvalue.Set(reflect.ValueOf(&d))\n\t\tdefault:\n\t\t\treturn errf()\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported JSON value (%v)\", data)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go",
    "content": "// Package jsonrpc provides JSON RPC utilities for serialization of AWS\n// requests and responses.\npackage jsonrpc\n\n//go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/json.json build_test.go\n//go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/json.json unmarshal_test.go\n\nimport (\n\t\"encoding/json\"\n\t\"io/ioutil\"\n\t\"strings\"\n\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n\t\"github.com/aws/aws-sdk-go/private/protocol/json/jsonutil\"\n\t\"github.com/aws/aws-sdk-go/private/protocol/rest\"\n)\n\nvar emptyJSON = []byte(\"{}\")\n\n// BuildHandler is a named request handler for building jsonrpc protocol requests\nvar BuildHandler = request.NamedHandler{Name: \"awssdk.jsonrpc.Build\", Fn: Build}\n\n// UnmarshalHandler is a named request handler for unmarshaling jsonrpc protocol requests\nvar UnmarshalHandler = request.NamedHandler{Name: \"awssdk.jsonrpc.Unmarshal\", Fn: Unmarshal}\n\n// UnmarshalMetaHandler is a named request handler for unmarshaling jsonrpc protocol request metadata\nvar UnmarshalMetaHandler = request.NamedHandler{Name: \"awssdk.jsonrpc.UnmarshalMeta\", Fn: UnmarshalMeta}\n\n// UnmarshalErrorHandler is a named request handler for unmarshaling jsonrpc protocol request errors\nvar UnmarshalErrorHandler = request.NamedHandler{Name: \"awssdk.jsonrpc.UnmarshalError\", Fn: UnmarshalError}\n\n// Build builds a JSON payload for a JSON RPC request.\nfunc Build(req *request.Request) {\n\tvar buf []byte\n\tvar err error\n\tif req.ParamsFilled() {\n\t\tbuf, err = jsonutil.BuildJSON(req.Params)\n\t\tif err != nil {\n\t\t\treq.Error = awserr.New(\"SerializationError\", \"failed encoding JSON RPC request\", err)\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tbuf = emptyJSON\n\t}\n\n\tif req.ClientInfo.TargetPrefix != \"\" || string(buf) != \"{}\" {\n\t\treq.SetBufferBody(buf)\n\t}\n\n\tif req.ClientInfo.TargetPrefix != \"\" {\n\t\ttarget := req.ClientInfo.TargetPrefix + \".\" + req.Operation.Name\n\t\treq.HTTPRequest.Header.Add(\"X-Amz-Target\", target)\n\t}\n\tif req.ClientInfo.JSONVersion != \"\" {\n\t\tjsonVersion := req.ClientInfo.JSONVersion\n\t\treq.HTTPRequest.Header.Add(\"Content-Type\", \"application/x-amz-json-\"+jsonVersion)\n\t}\n}\n\n// Unmarshal unmarshals a response for a JSON RPC service.\nfunc Unmarshal(req *request.Request) {\n\tdefer req.HTTPResponse.Body.Close()\n\tif req.DataFilled() {\n\t\terr := jsonutil.UnmarshalJSON(req.Data, req.HTTPResponse.Body)\n\t\tif err != nil {\n\t\t\treq.Error = awserr.New(\"SerializationError\", \"failed decoding JSON RPC response\", err)\n\t\t}\n\t}\n\treturn\n}\n\n// UnmarshalMeta unmarshals headers from a response for a JSON RPC service.\nfunc UnmarshalMeta(req *request.Request) {\n\trest.UnmarshalMeta(req)\n}\n\n// UnmarshalError unmarshals an error response for a JSON RPC service.\nfunc UnmarshalError(req *request.Request) {\n\tdefer req.HTTPResponse.Body.Close()\n\tbodyBytes, err := ioutil.ReadAll(req.HTTPResponse.Body)\n\tif err != nil {\n\t\treq.Error = awserr.New(\"SerializationError\", \"failed reading JSON RPC error response\", err)\n\t\treturn\n\t}\n\tif len(bodyBytes) == 0 {\n\t\treq.Error = awserr.NewRequestFailure(\n\t\t\tawserr.New(\"SerializationError\", req.HTTPResponse.Status, nil),\n\t\t\treq.HTTPResponse.StatusCode,\n\t\t\t\"\",\n\t\t)\n\t\treturn\n\t}\n\tvar jsonErr jsonErrorResponse\n\tif err := json.Unmarshal(bodyBytes, &jsonErr); err != nil {\n\t\treq.Error = awserr.New(\"SerializationError\", \"failed decoding JSON RPC error response\", err)\n\t\treturn\n\t}\n\n\tcodes := strings.SplitN(jsonErr.Code, \"#\", 2)\n\treq.Error = awserr.NewRequestFailure(\n\t\tawserr.New(codes[len(codes)-1], jsonErr.Message, nil),\n\t\treq.HTTPResponse.StatusCode,\n\t\treq.RequestID,\n\t)\n}\n\ntype jsonErrorResponse struct {\n\tCode    string `json:\"__type\"`\n\tMessage string `json:\"message\"`\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go",
    "content": "// Package query provides serialization of AWS query requests, and responses.\npackage query\n\n//go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/query.json build_test.go\n\nimport (\n\t\"net/url\"\n\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n\t\"github.com/aws/aws-sdk-go/private/protocol/query/queryutil\"\n)\n\n// BuildHandler is a named request handler for building query protocol requests\nvar BuildHandler = request.NamedHandler{Name: \"awssdk.query.Build\", Fn: Build}\n\n// Build builds a request for an AWS Query service.\nfunc Build(r *request.Request) {\n\tbody := url.Values{\n\t\t\"Action\":  {r.Operation.Name},\n\t\t\"Version\": {r.ClientInfo.APIVersion},\n\t}\n\tif err := queryutil.Parse(body, r.Params, false); err != nil {\n\t\tr.Error = awserr.New(\"SerializationError\", \"failed encoding Query request\", err)\n\t\treturn\n\t}\n\n\tif r.ExpireTime == 0 {\n\t\tr.HTTPRequest.Method = \"POST\"\n\t\tr.HTTPRequest.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded; charset=utf-8\")\n\t\tr.SetBufferBody([]byte(body.Encode()))\n\t} else { // This is a pre-signed request\n\t\tr.HTTPRequest.Method = \"GET\"\n\t\tr.HTTPRequest.URL.RawQuery = body.Encode()\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go",
    "content": "package queryutil\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/private/protocol\"\n)\n\n// Parse parses an object i and fills a url.Values object. The isEC2 flag\n// indicates if this is the EC2 Query sub-protocol.\nfunc Parse(body url.Values, i interface{}, isEC2 bool) error {\n\tq := queryParser{isEC2: isEC2}\n\treturn q.parseValue(body, reflect.ValueOf(i), \"\", \"\")\n}\n\nfunc elemOf(value reflect.Value) reflect.Value {\n\tfor value.Kind() == reflect.Ptr {\n\t\tvalue = value.Elem()\n\t}\n\treturn value\n}\n\ntype queryParser struct {\n\tisEC2 bool\n}\n\nfunc (q *queryParser) parseValue(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {\n\tvalue = elemOf(value)\n\n\t// no need to handle zero values\n\tif !value.IsValid() {\n\t\treturn nil\n\t}\n\n\tt := tag.Get(\"type\")\n\tif t == \"\" {\n\t\tswitch value.Kind() {\n\t\tcase reflect.Struct:\n\t\t\tt = \"structure\"\n\t\tcase reflect.Slice:\n\t\t\tt = \"list\"\n\t\tcase reflect.Map:\n\t\t\tt = \"map\"\n\t\t}\n\t}\n\n\tswitch t {\n\tcase \"structure\":\n\t\treturn q.parseStruct(v, value, prefix)\n\tcase \"list\":\n\t\treturn q.parseList(v, value, prefix, tag)\n\tcase \"map\":\n\t\treturn q.parseMap(v, value, prefix, tag)\n\tdefault:\n\t\treturn q.parseScalar(v, value, prefix, tag)\n\t}\n}\n\nfunc (q *queryParser) parseStruct(v url.Values, value reflect.Value, prefix string) error {\n\tif !value.IsValid() {\n\t\treturn nil\n\t}\n\n\tt := value.Type()\n\tfor i := 0; i < value.NumField(); i++ {\n\t\telemValue := elemOf(value.Field(i))\n\t\tfield := t.Field(i)\n\n\t\tif field.PkgPath != \"\" {\n\t\t\tcontinue // ignore unexported fields\n\t\t}\n\n\t\tif protocol.CanSetIdempotencyToken(value.Field(i), field) {\n\t\t\ttoken := protocol.GetIdempotencyToken()\n\t\t\telemValue = reflect.ValueOf(token)\n\t\t}\n\n\t\tvar name string\n\t\tif q.isEC2 {\n\t\t\tname = field.Tag.Get(\"queryName\")\n\t\t}\n\t\tif name == \"\" {\n\t\t\tif field.Tag.Get(\"flattened\") != \"\" && field.Tag.Get(\"locationNameList\") != \"\" {\n\t\t\t\tname = field.Tag.Get(\"locationNameList\")\n\t\t\t} else if locName := field.Tag.Get(\"locationName\"); locName != \"\" {\n\t\t\t\tname = locName\n\t\t\t}\n\t\t\tif name != \"\" && q.isEC2 {\n\t\t\t\tname = strings.ToUpper(name[0:1]) + name[1:]\n\t\t\t}\n\t\t}\n\t\tif name == \"\" {\n\t\t\tname = field.Name\n\t\t}\n\n\t\tif prefix != \"\" {\n\t\t\tname = prefix + \".\" + name\n\t\t}\n\n\t\tif err := q.parseValue(v, elemValue, name, field.Tag); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (q *queryParser) parseList(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {\n\t// If it's empty, generate an empty value\n\tif !value.IsNil() && value.Len() == 0 {\n\t\tv.Set(prefix, \"\")\n\t\treturn nil\n\t}\n\n\t// check for unflattened list member\n\tif !q.isEC2 && tag.Get(\"flattened\") == \"\" {\n\t\tprefix += \".member\"\n\t}\n\n\tfor i := 0; i < value.Len(); i++ {\n\t\tslicePrefix := prefix\n\t\tif slicePrefix == \"\" {\n\t\t\tslicePrefix = strconv.Itoa(i + 1)\n\t\t} else {\n\t\t\tslicePrefix = slicePrefix + \".\" + strconv.Itoa(i+1)\n\t\t}\n\t\tif err := q.parseValue(v, value.Index(i), slicePrefix, \"\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (q *queryParser) parseMap(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {\n\t// If it's empty, generate an empty value\n\tif !value.IsNil() && value.Len() == 0 {\n\t\tv.Set(prefix, \"\")\n\t\treturn nil\n\t}\n\n\t// check for unflattened list member\n\tif !q.isEC2 && tag.Get(\"flattened\") == \"\" {\n\t\tprefix += \".entry\"\n\t}\n\n\t// sort keys for improved serialization consistency.\n\t// this is not strictly necessary for protocol support.\n\tmapKeyValues := value.MapKeys()\n\tmapKeys := map[string]reflect.Value{}\n\tmapKeyNames := make([]string, len(mapKeyValues))\n\tfor i, mapKey := range mapKeyValues {\n\t\tname := mapKey.String()\n\t\tmapKeys[name] = mapKey\n\t\tmapKeyNames[i] = name\n\t}\n\tsort.Strings(mapKeyNames)\n\n\tfor i, mapKeyName := range mapKeyNames {\n\t\tmapKey := mapKeys[mapKeyName]\n\t\tmapValue := value.MapIndex(mapKey)\n\n\t\tkname := tag.Get(\"locationNameKey\")\n\t\tif kname == \"\" {\n\t\t\tkname = \"key\"\n\t\t}\n\t\tvname := tag.Get(\"locationNameValue\")\n\t\tif vname == \"\" {\n\t\t\tvname = \"value\"\n\t\t}\n\n\t\t// serialize key\n\t\tvar keyName string\n\t\tif prefix == \"\" {\n\t\t\tkeyName = strconv.Itoa(i+1) + \".\" + kname\n\t\t} else {\n\t\t\tkeyName = prefix + \".\" + strconv.Itoa(i+1) + \".\" + kname\n\t\t}\n\n\t\tif err := q.parseValue(v, mapKey, keyName, \"\"); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// serialize value\n\t\tvar valueName string\n\t\tif prefix == \"\" {\n\t\t\tvalueName = strconv.Itoa(i+1) + \".\" + vname\n\t\t} else {\n\t\t\tvalueName = prefix + \".\" + strconv.Itoa(i+1) + \".\" + vname\n\t\t}\n\n\t\tif err := q.parseValue(v, mapValue, valueName, \"\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (q *queryParser) parseScalar(v url.Values, r reflect.Value, name string, tag reflect.StructTag) error {\n\tswitch value := r.Interface().(type) {\n\tcase string:\n\t\tv.Set(name, value)\n\tcase []byte:\n\t\tif !r.IsNil() {\n\t\t\tv.Set(name, base64.StdEncoding.EncodeToString(value))\n\t\t}\n\tcase bool:\n\t\tv.Set(name, strconv.FormatBool(value))\n\tcase int64:\n\t\tv.Set(name, strconv.FormatInt(value, 10))\n\tcase int:\n\t\tv.Set(name, strconv.Itoa(value))\n\tcase float64:\n\t\tv.Set(name, strconv.FormatFloat(value, 'f', -1, 64))\n\tcase float32:\n\t\tv.Set(name, strconv.FormatFloat(float64(value), 'f', -1, 32))\n\tcase time.Time:\n\t\tconst ISO8601UTC = \"2006-01-02T15:04:05Z\"\n\t\tv.Set(name, value.UTC().Format(ISO8601UTC))\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported value for param %s: %v (%s)\", name, r.Interface(), r.Type().Name())\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go",
    "content": "package query\n\n//go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/query.json unmarshal_test.go\n\nimport (\n\t\"encoding/xml\"\n\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n\t\"github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil\"\n)\n\n// UnmarshalHandler is a named request handler for unmarshaling query protocol requests\nvar UnmarshalHandler = request.NamedHandler{Name: \"awssdk.query.Unmarshal\", Fn: Unmarshal}\n\n// UnmarshalMetaHandler is a named request handler for unmarshaling query protocol request metadata\nvar UnmarshalMetaHandler = request.NamedHandler{Name: \"awssdk.query.UnmarshalMeta\", Fn: UnmarshalMeta}\n\n// Unmarshal unmarshals a response for an AWS Query service.\nfunc Unmarshal(r *request.Request) {\n\tdefer r.HTTPResponse.Body.Close()\n\tif r.DataFilled() {\n\t\tdecoder := xml.NewDecoder(r.HTTPResponse.Body)\n\t\terr := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+\"Result\")\n\t\tif err != nil {\n\t\t\tr.Error = awserr.New(\"SerializationError\", \"failed decoding Query response\", err)\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// UnmarshalMeta unmarshals header response values for an AWS Query service.\nfunc UnmarshalMeta(r *request.Request) {\n\tr.RequestID = r.HTTPResponse.Header.Get(\"X-Amzn-Requestid\")\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go",
    "content": "package query\n\nimport (\n\t\"encoding/xml\"\n\t\"io/ioutil\"\n\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n)\n\ntype xmlErrorResponse struct {\n\tXMLName   xml.Name `xml:\"ErrorResponse\"`\n\tCode      string   `xml:\"Error>Code\"`\n\tMessage   string   `xml:\"Error>Message\"`\n\tRequestID string   `xml:\"RequestId\"`\n}\n\ntype xmlServiceUnavailableResponse struct {\n\tXMLName xml.Name `xml:\"ServiceUnavailableException\"`\n}\n\n// UnmarshalErrorHandler is a name request handler to unmarshal request errors\nvar UnmarshalErrorHandler = request.NamedHandler{Name: \"awssdk.query.UnmarshalError\", Fn: UnmarshalError}\n\n// UnmarshalError unmarshals an error response for an AWS Query service.\nfunc UnmarshalError(r *request.Request) {\n\tdefer r.HTTPResponse.Body.Close()\n\n\tbodyBytes, err := ioutil.ReadAll(r.HTTPResponse.Body)\n\tif err != nil {\n\t\tr.Error = awserr.New(\"SerializationError\", \"failed to read from query HTTP response body\", err)\n\t\treturn\n\t}\n\n\t// First check for specific error\n\tresp := xmlErrorResponse{}\n\tdecodeErr := xml.Unmarshal(bodyBytes, &resp)\n\tif decodeErr == nil {\n\t\treqID := resp.RequestID\n\t\tif reqID == \"\" {\n\t\t\treqID = r.RequestID\n\t\t}\n\t\tr.Error = awserr.NewRequestFailure(\n\t\t\tawserr.New(resp.Code, resp.Message, nil),\n\t\t\tr.HTTPResponse.StatusCode,\n\t\t\treqID,\n\t\t)\n\t\treturn\n\t}\n\n\t// Check for unhandled error\n\tservUnavailResp := xmlServiceUnavailableResponse{}\n\tunavailErr := xml.Unmarshal(bodyBytes, &servUnavailResp)\n\tif unavailErr == nil {\n\t\tr.Error = awserr.NewRequestFailure(\n\t\t\tawserr.New(\"ServiceUnavailableException\", \"service is unavailable\", nil),\n\t\t\tr.HTTPResponse.StatusCode,\n\t\t\tr.RequestID,\n\t\t)\n\t\treturn\n\t}\n\n\t// Failed to retrieve any error message from the response body\n\tr.Error = awserr.New(\"SerializationError\",\n\t\t\"failed to decode query XML error response\", decodeErr)\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go",
    "content": "// Package rest provides RESTful serialization of AWS requests and responses.\npackage rest\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"path\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n)\n\n// RFC822 returns an RFC822 formatted timestamp for AWS protocols\nconst RFC822 = \"Mon, 2 Jan 2006 15:04:05 GMT\"\n\n// Whether the byte value can be sent without escaping in AWS URLs\nvar noEscape [256]bool\n\nvar errValueNotSet = fmt.Errorf(\"value not set\")\n\nfunc init() {\n\tfor i := 0; i < len(noEscape); i++ {\n\t\t// AWS expects every character except these to be escaped\n\t\tnoEscape[i] = (i >= 'A' && i <= 'Z') ||\n\t\t\t(i >= 'a' && i <= 'z') ||\n\t\t\t(i >= '0' && i <= '9') ||\n\t\t\ti == '-' ||\n\t\t\ti == '.' ||\n\t\t\ti == '_' ||\n\t\t\ti == '~'\n\t}\n}\n\n// BuildHandler is a named request handler for building rest protocol requests\nvar BuildHandler = request.NamedHandler{Name: \"awssdk.rest.Build\", Fn: Build}\n\n// Build builds the REST component of a service request.\nfunc Build(r *request.Request) {\n\tif r.ParamsFilled() {\n\t\tv := reflect.ValueOf(r.Params).Elem()\n\t\tbuildLocationElements(r, v)\n\t\tbuildBody(r, v)\n\t}\n}\n\nfunc buildLocationElements(r *request.Request, v reflect.Value) {\n\tquery := r.HTTPRequest.URL.Query()\n\n\tfor i := 0; i < v.NumField(); i++ {\n\t\tm := v.Field(i)\n\t\tif n := v.Type().Field(i).Name; n[0:1] == strings.ToLower(n[0:1]) {\n\t\t\tcontinue\n\t\t}\n\n\t\tif m.IsValid() {\n\t\t\tfield := v.Type().Field(i)\n\t\t\tname := field.Tag.Get(\"locationName\")\n\t\t\tif name == \"\" {\n\t\t\t\tname = field.Name\n\t\t\t}\n\t\t\tif m.Kind() == reflect.Ptr {\n\t\t\t\tm = m.Elem()\n\t\t\t}\n\t\t\tif !m.IsValid() {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tvar err error\n\t\t\tswitch field.Tag.Get(\"location\") {\n\t\t\tcase \"headers\": // header maps\n\t\t\t\terr = buildHeaderMap(&r.HTTPRequest.Header, m, field.Tag.Get(\"locationName\"))\n\t\t\tcase \"header\":\n\t\t\t\terr = buildHeader(&r.HTTPRequest.Header, m, name)\n\t\t\tcase \"uri\":\n\t\t\t\terr = buildURI(r.HTTPRequest.URL, m, name)\n\t\t\tcase \"querystring\":\n\t\t\t\terr = buildQueryString(query, m, name)\n\t\t\t}\n\t\t\tr.Error = err\n\t\t}\n\t\tif r.Error != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tr.HTTPRequest.URL.RawQuery = query.Encode()\n\tupdatePath(r.HTTPRequest.URL, r.HTTPRequest.URL.Path)\n}\n\nfunc buildBody(r *request.Request, v reflect.Value) {\n\tif field, ok := v.Type().FieldByName(\"_\"); ok {\n\t\tif payloadName := field.Tag.Get(\"payload\"); payloadName != \"\" {\n\t\t\tpfield, _ := v.Type().FieldByName(payloadName)\n\t\t\tif ptag := pfield.Tag.Get(\"type\"); ptag != \"\" && ptag != \"structure\" {\n\t\t\t\tpayload := reflect.Indirect(v.FieldByName(payloadName))\n\t\t\t\tif payload.IsValid() && payload.Interface() != nil {\n\t\t\t\t\tswitch reader := payload.Interface().(type) {\n\t\t\t\t\tcase io.ReadSeeker:\n\t\t\t\t\t\tr.SetReaderBody(reader)\n\t\t\t\t\tcase []byte:\n\t\t\t\t\t\tr.SetBufferBody(reader)\n\t\t\t\t\tcase string:\n\t\t\t\t\t\tr.SetStringBody(reader)\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tr.Error = awserr.New(\"SerializationError\",\n\t\t\t\t\t\t\t\"failed to encode REST request\",\n\t\t\t\t\t\t\tfmt.Errorf(\"unknown payload type %s\", payload.Type()))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc buildHeader(header *http.Header, v reflect.Value, name string) error {\n\tstr, err := convertType(v)\n\tif err == errValueNotSet {\n\t\treturn nil\n\t} else if err != nil {\n\t\treturn awserr.New(\"SerializationError\", \"failed to encode REST request\", err)\n\t}\n\n\theader.Add(name, str)\n\n\treturn nil\n}\n\nfunc buildHeaderMap(header *http.Header, v reflect.Value, prefix string) error {\n\tfor _, key := range v.MapKeys() {\n\t\tstr, err := convertType(v.MapIndex(key))\n\t\tif err == errValueNotSet {\n\t\t\tcontinue\n\t\t} else if err != nil {\n\t\t\treturn awserr.New(\"SerializationError\", \"failed to encode REST request\", err)\n\n\t\t}\n\n\t\theader.Add(prefix+key.String(), str)\n\t}\n\treturn nil\n}\n\nfunc buildURI(u *url.URL, v reflect.Value, name string) error {\n\tvalue, err := convertType(v)\n\tif err == errValueNotSet {\n\t\treturn nil\n\t} else if err != nil {\n\t\treturn awserr.New(\"SerializationError\", \"failed to encode REST request\", err)\n\t}\n\n\turi := u.Path\n\turi = strings.Replace(uri, \"{\"+name+\"}\", EscapePath(value, true), -1)\n\turi = strings.Replace(uri, \"{\"+name+\"+}\", EscapePath(value, false), -1)\n\tu.Path = uri\n\n\treturn nil\n}\n\nfunc buildQueryString(query url.Values, v reflect.Value, name string) error {\n\tswitch value := v.Interface().(type) {\n\tcase []*string:\n\t\tfor _, item := range value {\n\t\t\tquery.Add(name, *item)\n\t\t}\n\tcase map[string]*string:\n\t\tfor key, item := range value {\n\t\t\tquery.Add(key, *item)\n\t\t}\n\tcase map[string][]*string:\n\t\tfor key, items := range value {\n\t\t\tfor _, item := range items {\n\t\t\t\tquery.Add(key, *item)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tstr, err := convertType(v)\n\t\tif err == errValueNotSet {\n\t\t\treturn nil\n\t\t} else if err != nil {\n\t\t\treturn awserr.New(\"SerializationError\", \"failed to encode REST request\", err)\n\t\t}\n\t\tquery.Set(name, str)\n\t}\n\n\treturn nil\n}\n\nfunc updatePath(url *url.URL, urlPath string) {\n\tscheme, query := url.Scheme, url.RawQuery\n\n\thasSlash := strings.HasSuffix(urlPath, \"/\")\n\n\t// clean up path\n\turlPath = path.Clean(urlPath)\n\tif hasSlash && !strings.HasSuffix(urlPath, \"/\") {\n\t\turlPath += \"/\"\n\t}\n\n\t// get formatted URL minus scheme so we can build this into Opaque\n\turl.Scheme, url.Path, url.RawQuery = \"\", \"\", \"\"\n\ts := url.String()\n\turl.Scheme = scheme\n\turl.RawQuery = query\n\n\t// build opaque URI\n\turl.Opaque = s + urlPath\n}\n\n// EscapePath escapes part of a URL path in Amazon style\nfunc EscapePath(path string, encodeSep bool) string {\n\tvar buf bytes.Buffer\n\tfor i := 0; i < len(path); i++ {\n\t\tc := path[i]\n\t\tif noEscape[c] || (c == '/' && !encodeSep) {\n\t\t\tbuf.WriteByte(c)\n\t\t} else {\n\t\t\tfmt.Fprintf(&buf, \"%%%02X\", c)\n\t\t}\n\t}\n\treturn buf.String()\n}\n\nfunc convertType(v reflect.Value) (string, error) {\n\tv = reflect.Indirect(v)\n\tif !v.IsValid() {\n\t\treturn \"\", errValueNotSet\n\t}\n\n\tvar str string\n\tswitch value := v.Interface().(type) {\n\tcase string:\n\t\tstr = value\n\tcase []byte:\n\t\tstr = base64.StdEncoding.EncodeToString(value)\n\tcase bool:\n\t\tstr = strconv.FormatBool(value)\n\tcase int64:\n\t\tstr = strconv.FormatInt(value, 10)\n\tcase float64:\n\t\tstr = strconv.FormatFloat(value, 'f', -1, 64)\n\tcase time.Time:\n\t\tstr = value.UTC().Format(RFC822)\n\tdefault:\n\t\terr := fmt.Errorf(\"Unsupported value for param %v (%s)\", v.Interface(), v.Type())\n\t\treturn \"\", err\n\t}\n\treturn str, nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go",
    "content": "package rest\n\nimport \"reflect\"\n\n// PayloadMember returns the payload field member of i if there is one, or nil.\nfunc PayloadMember(i interface{}) interface{} {\n\tif i == nil {\n\t\treturn nil\n\t}\n\n\tv := reflect.ValueOf(i).Elem()\n\tif !v.IsValid() {\n\t\treturn nil\n\t}\n\tif field, ok := v.Type().FieldByName(\"_\"); ok {\n\t\tif payloadName := field.Tag.Get(\"payload\"); payloadName != \"\" {\n\t\t\tfield, _ := v.Type().FieldByName(payloadName)\n\t\t\tif field.Tag.Get(\"type\") != \"structure\" {\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tpayload := v.FieldByName(payloadName)\n\t\t\tif payload.IsValid() || (payload.Kind() == reflect.Ptr && !payload.IsNil()) {\n\t\t\t\treturn payload.Interface()\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// PayloadType returns the type of a payload field member of i if there is one, or \"\".\nfunc PayloadType(i interface{}) string {\n\tv := reflect.Indirect(reflect.ValueOf(i))\n\tif !v.IsValid() {\n\t\treturn \"\"\n\t}\n\tif field, ok := v.Type().FieldByName(\"_\"); ok {\n\t\tif payloadName := field.Tag.Get(\"payload\"); payloadName != \"\" {\n\t\t\tif member, ok := v.Type().FieldByName(payloadName); ok {\n\t\t\t\treturn member.Tag.Get(\"type\")\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go",
    "content": "package rest\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n)\n\n// UnmarshalHandler is a named request handler for unmarshaling rest protocol requests\nvar UnmarshalHandler = request.NamedHandler{Name: \"awssdk.rest.Unmarshal\", Fn: Unmarshal}\n\n// UnmarshalMetaHandler is a named request handler for unmarshaling rest protocol request metadata\nvar UnmarshalMetaHandler = request.NamedHandler{Name: \"awssdk.rest.UnmarshalMeta\", Fn: UnmarshalMeta}\n\n// Unmarshal unmarshals the REST component of a response in a REST service.\nfunc Unmarshal(r *request.Request) {\n\tif r.DataFilled() {\n\t\tv := reflect.Indirect(reflect.ValueOf(r.Data))\n\t\tunmarshalBody(r, v)\n\t}\n}\n\n// UnmarshalMeta unmarshals the REST metadata of a response in a REST service\nfunc UnmarshalMeta(r *request.Request) {\n\tr.RequestID = r.HTTPResponse.Header.Get(\"X-Amzn-Requestid\")\n\tif r.RequestID == \"\" {\n\t\t// Alternative version of request id in the header\n\t\tr.RequestID = r.HTTPResponse.Header.Get(\"X-Amz-Request-Id\")\n\t}\n\tif r.DataFilled() {\n\t\tv := reflect.Indirect(reflect.ValueOf(r.Data))\n\t\tunmarshalLocationElements(r, v)\n\t}\n}\n\nfunc unmarshalBody(r *request.Request, v reflect.Value) {\n\tif field, ok := v.Type().FieldByName(\"_\"); ok {\n\t\tif payloadName := field.Tag.Get(\"payload\"); payloadName != \"\" {\n\t\t\tpfield, _ := v.Type().FieldByName(payloadName)\n\t\t\tif ptag := pfield.Tag.Get(\"type\"); ptag != \"\" && ptag != \"structure\" {\n\t\t\t\tpayload := v.FieldByName(payloadName)\n\t\t\t\tif payload.IsValid() {\n\t\t\t\t\tswitch payload.Interface().(type) {\n\t\t\t\t\tcase []byte:\n\t\t\t\t\t\tdefer r.HTTPResponse.Body.Close()\n\t\t\t\t\t\tb, err := ioutil.ReadAll(r.HTTPResponse.Body)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tr.Error = awserr.New(\"SerializationError\", \"failed to decode REST response\", err)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpayload.Set(reflect.ValueOf(b))\n\t\t\t\t\t\t}\n\t\t\t\t\tcase *string:\n\t\t\t\t\t\tdefer r.HTTPResponse.Body.Close()\n\t\t\t\t\t\tb, err := ioutil.ReadAll(r.HTTPResponse.Body)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tr.Error = awserr.New(\"SerializationError\", \"failed to decode REST response\", err)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstr := string(b)\n\t\t\t\t\t\t\tpayload.Set(reflect.ValueOf(&str))\n\t\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tswitch payload.Type().String() {\n\t\t\t\t\t\tcase \"io.ReadSeeker\":\n\t\t\t\t\t\t\tpayload.Set(reflect.ValueOf(aws.ReadSeekCloser(r.HTTPResponse.Body)))\n\t\t\t\t\t\tcase \"aws.ReadSeekCloser\", \"io.ReadCloser\":\n\t\t\t\t\t\t\tpayload.Set(reflect.ValueOf(r.HTTPResponse.Body))\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tio.Copy(ioutil.Discard, r.HTTPResponse.Body)\n\t\t\t\t\t\t\tdefer r.HTTPResponse.Body.Close()\n\t\t\t\t\t\t\tr.Error = awserr.New(\"SerializationError\",\n\t\t\t\t\t\t\t\t\"failed to decode REST response\",\n\t\t\t\t\t\t\t\tfmt.Errorf(\"unknown payload type %s\", payload.Type()))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc unmarshalLocationElements(r *request.Request, v reflect.Value) {\n\tfor i := 0; i < v.NumField(); i++ {\n\t\tm, field := v.Field(i), v.Type().Field(i)\n\t\tif n := field.Name; n[0:1] == strings.ToLower(n[0:1]) {\n\t\t\tcontinue\n\t\t}\n\n\t\tif m.IsValid() {\n\t\t\tname := field.Tag.Get(\"locationName\")\n\t\t\tif name == \"\" {\n\t\t\t\tname = field.Name\n\t\t\t}\n\n\t\t\tswitch field.Tag.Get(\"location\") {\n\t\t\tcase \"statusCode\":\n\t\t\t\tunmarshalStatusCode(m, r.HTTPResponse.StatusCode)\n\t\t\tcase \"header\":\n\t\t\t\terr := unmarshalHeader(m, r.HTTPResponse.Header.Get(name))\n\t\t\t\tif err != nil {\n\t\t\t\t\tr.Error = awserr.New(\"SerializationError\", \"failed to decode REST response\", err)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\tcase \"headers\":\n\t\t\t\tprefix := field.Tag.Get(\"locationName\")\n\t\t\t\terr := unmarshalHeaderMap(m, r.HTTPResponse.Header, prefix)\n\t\t\t\tif err != nil {\n\t\t\t\t\tr.Error = awserr.New(\"SerializationError\", \"failed to decode REST response\", err)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif r.Error != nil {\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc unmarshalStatusCode(v reflect.Value, statusCode int) {\n\tif !v.IsValid() {\n\t\treturn\n\t}\n\n\tswitch v.Interface().(type) {\n\tcase *int64:\n\t\ts := int64(statusCode)\n\t\tv.Set(reflect.ValueOf(&s))\n\t}\n}\n\nfunc unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) error {\n\tswitch r.Interface().(type) {\n\tcase map[string]*string: // we only support string map value types\n\t\tout := map[string]*string{}\n\t\tfor k, v := range headers {\n\t\t\tk = http.CanonicalHeaderKey(k)\n\t\t\tif strings.HasPrefix(strings.ToLower(k), strings.ToLower(prefix)) {\n\t\t\t\tout[k[len(prefix):]] = &v[0]\n\t\t\t}\n\t\t}\n\t\tr.Set(reflect.ValueOf(out))\n\t}\n\treturn nil\n}\n\nfunc unmarshalHeader(v reflect.Value, header string) error {\n\tif !v.IsValid() || (header == \"\" && v.Elem().Kind() != reflect.String) {\n\t\treturn nil\n\t}\n\n\tswitch v.Interface().(type) {\n\tcase *string:\n\t\tv.Set(reflect.ValueOf(&header))\n\tcase []byte:\n\t\tb, err := base64.StdEncoding.DecodeString(header)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv.Set(reflect.ValueOf(&b))\n\tcase *bool:\n\t\tb, err := strconv.ParseBool(header)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv.Set(reflect.ValueOf(&b))\n\tcase *int64:\n\t\ti, err := strconv.ParseInt(header, 10, 64)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv.Set(reflect.ValueOf(&i))\n\tcase *float64:\n\t\tf, err := strconv.ParseFloat(header, 64)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv.Set(reflect.ValueOf(&f))\n\tcase *time.Time:\n\t\tt, err := time.Parse(RFC822, header)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv.Set(reflect.ValueOf(&t))\n\tdefault:\n\t\terr := fmt.Errorf(\"Unsupported value for param %v (%s)\", v.Interface(), v.Type())\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go",
    "content": "package protocol\n\nimport (\n\t\"io\"\n\t\"io/ioutil\"\n\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n)\n\n// UnmarshalDiscardBodyHandler is a named request handler to empty and close a response's body\nvar UnmarshalDiscardBodyHandler = request.NamedHandler{Name: \"awssdk.shared.UnmarshalDiscardBody\", Fn: UnmarshalDiscardBody}\n\n// UnmarshalDiscardBody is a request handler to empty a response's body and closing it.\nfunc UnmarshalDiscardBody(r *request.Request) {\n\tif r.HTTPResponse == nil || r.HTTPResponse.Body == nil {\n\t\treturn\n\t}\n\n\tio.Copy(ioutil.Discard, r.HTTPResponse.Body)\n\tr.HTTPResponse.Body.Close()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go",
    "content": "// Package xmlutil provides XML serialization of AWS requests and responses.\npackage xmlutil\n\nimport (\n\t\"encoding/base64\"\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/private/protocol\"\n)\n\n// BuildXML will serialize params into an xml.Encoder.\n// Error will be returned if the serialization of any of the params or nested values fails.\nfunc BuildXML(params interface{}, e *xml.Encoder) error {\n\tb := xmlBuilder{encoder: e, namespaces: map[string]string{}}\n\troot := NewXMLElement(xml.Name{})\n\tif err := b.buildValue(reflect.ValueOf(params), root, \"\"); err != nil {\n\t\treturn err\n\t}\n\tfor _, c := range root.Children {\n\t\tfor _, v := range c {\n\t\t\treturn StructToXML(e, v, false)\n\t\t}\n\t}\n\treturn nil\n}\n\n// Returns the reflection element of a value, if it is a pointer.\nfunc elemOf(value reflect.Value) reflect.Value {\n\tfor value.Kind() == reflect.Ptr {\n\t\tvalue = value.Elem()\n\t}\n\treturn value\n}\n\n// A xmlBuilder serializes values from Go code to XML\ntype xmlBuilder struct {\n\tencoder    *xml.Encoder\n\tnamespaces map[string]string\n}\n\n// buildValue generic XMLNode builder for any type. Will build value for their specific type\n// struct, list, map, scalar.\n//\n// Also takes a \"type\" tag value to set what type a value should be converted to XMLNode as. If\n// type is not provided reflect will be used to determine the value's type.\nfunc (b *xmlBuilder) buildValue(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {\n\tvalue = elemOf(value)\n\tif !value.IsValid() { // no need to handle zero values\n\t\treturn nil\n\t} else if tag.Get(\"location\") != \"\" { // don't handle non-body location values\n\t\treturn nil\n\t}\n\n\tt := tag.Get(\"type\")\n\tif t == \"\" {\n\t\tswitch value.Kind() {\n\t\tcase reflect.Struct:\n\t\t\tt = \"structure\"\n\t\tcase reflect.Slice:\n\t\t\tt = \"list\"\n\t\tcase reflect.Map:\n\t\t\tt = \"map\"\n\t\t}\n\t}\n\n\tswitch t {\n\tcase \"structure\":\n\t\tif field, ok := value.Type().FieldByName(\"_\"); ok {\n\t\t\ttag = tag + reflect.StructTag(\" \") + field.Tag\n\t\t}\n\t\treturn b.buildStruct(value, current, tag)\n\tcase \"list\":\n\t\treturn b.buildList(value, current, tag)\n\tcase \"map\":\n\t\treturn b.buildMap(value, current, tag)\n\tdefault:\n\t\treturn b.buildScalar(value, current, tag)\n\t}\n}\n\n// buildStruct adds a struct and its fields to the current XMLNode. All fields any any nested\n// types are converted to XMLNodes also.\nfunc (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {\n\tif !value.IsValid() {\n\t\treturn nil\n\t}\n\n\tfieldAdded := false\n\n\t// unwrap payloads\n\tif payload := tag.Get(\"payload\"); payload != \"\" {\n\t\tfield, _ := value.Type().FieldByName(payload)\n\t\ttag = field.Tag\n\t\tvalue = elemOf(value.FieldByName(payload))\n\n\t\tif !value.IsValid() {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tchild := NewXMLElement(xml.Name{Local: tag.Get(\"locationName\")})\n\n\t// there is an xmlNamespace associated with this struct\n\tif prefix, uri := tag.Get(\"xmlPrefix\"), tag.Get(\"xmlURI\"); uri != \"\" {\n\t\tns := xml.Attr{\n\t\t\tName:  xml.Name{Local: \"xmlns\"},\n\t\t\tValue: uri,\n\t\t}\n\t\tif prefix != \"\" {\n\t\t\tb.namespaces[prefix] = uri // register the namespace\n\t\t\tns.Name.Local = \"xmlns:\" + prefix\n\t\t}\n\n\t\tchild.Attr = append(child.Attr, ns)\n\t}\n\n\tt := value.Type()\n\tfor i := 0; i < value.NumField(); i++ {\n\t\tmember := elemOf(value.Field(i))\n\t\tfield := t.Field(i)\n\n\t\tif field.PkgPath != \"\" {\n\t\t\tcontinue // ignore unexported fields\n\t\t}\n\n\t\tmTag := field.Tag\n\t\tif mTag.Get(\"location\") != \"\" { // skip non-body members\n\t\t\tcontinue\n\t\t}\n\n\t\tif protocol.CanSetIdempotencyToken(value.Field(i), field) {\n\t\t\ttoken := protocol.GetIdempotencyToken()\n\t\t\tmember = reflect.ValueOf(token)\n\t\t}\n\n\t\tmemberName := mTag.Get(\"locationName\")\n\t\tif memberName == \"\" {\n\t\t\tmemberName = field.Name\n\t\t\tmTag = reflect.StructTag(string(mTag) + ` locationName:\"` + memberName + `\"`)\n\t\t}\n\t\tif err := b.buildValue(member, child, mTag); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfieldAdded = true\n\t}\n\n\tif fieldAdded { // only append this child if we have one ore more valid members\n\t\tcurrent.AddChild(child)\n\t}\n\n\treturn nil\n}\n\n// buildList adds the value's list items to the current XMLNode as children nodes. All\n// nested values in the list are converted to XMLNodes also.\nfunc (b *xmlBuilder) buildList(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {\n\tif value.IsNil() { // don't build omitted lists\n\t\treturn nil\n\t}\n\n\t// check for unflattened list member\n\tflattened := tag.Get(\"flattened\") != \"\"\n\n\txname := xml.Name{Local: tag.Get(\"locationName\")}\n\tif flattened {\n\t\tfor i := 0; i < value.Len(); i++ {\n\t\t\tchild := NewXMLElement(xname)\n\t\t\tcurrent.AddChild(child)\n\t\t\tif err := b.buildValue(value.Index(i), child, \"\"); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t} else {\n\t\tlist := NewXMLElement(xname)\n\t\tcurrent.AddChild(list)\n\n\t\tfor i := 0; i < value.Len(); i++ {\n\t\t\tiname := tag.Get(\"locationNameList\")\n\t\t\tif iname == \"\" {\n\t\t\t\tiname = \"member\"\n\t\t\t}\n\n\t\t\tchild := NewXMLElement(xml.Name{Local: iname})\n\t\t\tlist.AddChild(child)\n\t\t\tif err := b.buildValue(value.Index(i), child, \"\"); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// buildMap adds the value's key/value pairs to the current XMLNode as children nodes. All\n// nested values in the map are converted to XMLNodes also.\n//\n// Error will be returned if it is unable to build the map's values into XMLNodes\nfunc (b *xmlBuilder) buildMap(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {\n\tif value.IsNil() { // don't build omitted maps\n\t\treturn nil\n\t}\n\n\tmaproot := NewXMLElement(xml.Name{Local: tag.Get(\"locationName\")})\n\tcurrent.AddChild(maproot)\n\tcurrent = maproot\n\n\tkname, vname := \"key\", \"value\"\n\tif n := tag.Get(\"locationNameKey\"); n != \"\" {\n\t\tkname = n\n\t}\n\tif n := tag.Get(\"locationNameValue\"); n != \"\" {\n\t\tvname = n\n\t}\n\n\t// sorting is not required for compliance, but it makes testing easier\n\tkeys := make([]string, value.Len())\n\tfor i, k := range value.MapKeys() {\n\t\tkeys[i] = k.String()\n\t}\n\tsort.Strings(keys)\n\n\tfor _, k := range keys {\n\t\tv := value.MapIndex(reflect.ValueOf(k))\n\n\t\tmapcur := current\n\t\tif tag.Get(\"flattened\") == \"\" { // add \"entry\" tag to non-flat maps\n\t\t\tchild := NewXMLElement(xml.Name{Local: \"entry\"})\n\t\t\tmapcur.AddChild(child)\n\t\t\tmapcur = child\n\t\t}\n\n\t\tkchild := NewXMLElement(xml.Name{Local: kname})\n\t\tkchild.Text = k\n\t\tvchild := NewXMLElement(xml.Name{Local: vname})\n\t\tmapcur.AddChild(kchild)\n\t\tmapcur.AddChild(vchild)\n\n\t\tif err := b.buildValue(v, vchild, \"\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// buildScalar will convert the value into a string and append it as a attribute or child\n// of the current XMLNode.\n//\n// The value will be added as an attribute if tag contains a \"xmlAttribute\" attribute value.\n//\n// Error will be returned if the value type is unsupported.\nfunc (b *xmlBuilder) buildScalar(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {\n\tvar str string\n\tswitch converted := value.Interface().(type) {\n\tcase string:\n\t\tstr = converted\n\tcase []byte:\n\t\tif !value.IsNil() {\n\t\t\tstr = base64.StdEncoding.EncodeToString(converted)\n\t\t}\n\tcase bool:\n\t\tstr = strconv.FormatBool(converted)\n\tcase int64:\n\t\tstr = strconv.FormatInt(converted, 10)\n\tcase int:\n\t\tstr = strconv.Itoa(converted)\n\tcase float64:\n\t\tstr = strconv.FormatFloat(converted, 'f', -1, 64)\n\tcase float32:\n\t\tstr = strconv.FormatFloat(float64(converted), 'f', -1, 32)\n\tcase time.Time:\n\t\tconst ISO8601UTC = \"2006-01-02T15:04:05Z\"\n\t\tstr = converted.UTC().Format(ISO8601UTC)\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported value for param %s: %v (%s)\",\n\t\t\ttag.Get(\"locationName\"), value.Interface(), value.Type().Name())\n\t}\n\n\txname := xml.Name{Local: tag.Get(\"locationName\")}\n\tif tag.Get(\"xmlAttribute\") != \"\" { // put into current node's attribute list\n\t\tattr := xml.Attr{Name: xname, Value: str}\n\t\tcurrent.Attr = append(current.Attr, attr)\n\t} else { // regular text node\n\t\tcurrent.AddChild(&XMLNode{Name: xname, Text: str})\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go",
    "content": "package xmlutil\n\nimport (\n\t\"encoding/base64\"\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\n// UnmarshalXML deserializes an xml.Decoder into the container v. V\n// needs to match the shape of the XML expected to be decoded.\n// If the shape doesn't match unmarshaling will fail.\nfunc UnmarshalXML(v interface{}, d *xml.Decoder, wrapper string) error {\n\tn, _ := XMLToStruct(d, nil)\n\tif n.Children != nil {\n\t\tfor _, root := range n.Children {\n\t\t\tfor _, c := range root {\n\t\t\t\tif wrappedChild, ok := c.Children[wrapper]; ok {\n\t\t\t\t\tc = wrappedChild[0] // pull out wrapped element\n\t\t\t\t}\n\n\t\t\t\terr := parse(reflect.ValueOf(v), c, \"\")\n\t\t\t\tif err != nil {\n\t\t\t\t\tif err == io.EOF {\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\treturn nil\n}\n\n// parse deserializes any value from the XMLNode. The type tag is used to infer the type, or reflect\n// will be used to determine the type from r.\nfunc parse(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {\n\trtype := r.Type()\n\tif rtype.Kind() == reflect.Ptr {\n\t\trtype = rtype.Elem() // check kind of actual element type\n\t}\n\n\tt := tag.Get(\"type\")\n\tif t == \"\" {\n\t\tswitch rtype.Kind() {\n\t\tcase reflect.Struct:\n\t\t\tt = \"structure\"\n\t\tcase reflect.Slice:\n\t\t\tt = \"list\"\n\t\tcase reflect.Map:\n\t\t\tt = \"map\"\n\t\t}\n\t}\n\n\tswitch t {\n\tcase \"structure\":\n\t\tif field, ok := rtype.FieldByName(\"_\"); ok {\n\t\t\ttag = field.Tag\n\t\t}\n\t\treturn parseStruct(r, node, tag)\n\tcase \"list\":\n\t\treturn parseList(r, node, tag)\n\tcase \"map\":\n\t\treturn parseMap(r, node, tag)\n\tdefault:\n\t\treturn parseScalar(r, node, tag)\n\t}\n}\n\n// parseStruct deserializes a structure and its fields from an XMLNode. Any nested\n// types in the structure will also be deserialized.\nfunc parseStruct(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {\n\tt := r.Type()\n\tif r.Kind() == reflect.Ptr {\n\t\tif r.IsNil() { // create the structure if it's nil\n\t\t\ts := reflect.New(r.Type().Elem())\n\t\t\tr.Set(s)\n\t\t\tr = s\n\t\t}\n\n\t\tr = r.Elem()\n\t\tt = t.Elem()\n\t}\n\n\t// unwrap any payloads\n\tif payload := tag.Get(\"payload\"); payload != \"\" {\n\t\tfield, _ := t.FieldByName(payload)\n\t\treturn parseStruct(r.FieldByName(payload), node, field.Tag)\n\t}\n\n\tfor i := 0; i < t.NumField(); i++ {\n\t\tfield := t.Field(i)\n\t\tif c := field.Name[0:1]; strings.ToLower(c) == c {\n\t\t\tcontinue // ignore unexported fields\n\t\t}\n\n\t\t// figure out what this field is called\n\t\tname := field.Name\n\t\tif field.Tag.Get(\"flattened\") != \"\" && field.Tag.Get(\"locationNameList\") != \"\" {\n\t\t\tname = field.Tag.Get(\"locationNameList\")\n\t\t} else if locName := field.Tag.Get(\"locationName\"); locName != \"\" {\n\t\t\tname = locName\n\t\t}\n\n\t\t// try to find the field by name in elements\n\t\telems := node.Children[name]\n\n\t\tif elems == nil { // try to find the field in attributes\n\t\t\tfor _, a := range node.Attr {\n\t\t\t\tif name == a.Name.Local {\n\t\t\t\t\t// turn this into a text node for de-serializing\n\t\t\t\t\telems = []*XMLNode{{Text: a.Value}}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmember := r.FieldByName(field.Name)\n\t\tfor _, elem := range elems {\n\t\t\terr := parse(member, elem, field.Tag)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// parseList deserializes a list of values from an XML node. Each list entry\n// will also be deserialized.\nfunc parseList(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {\n\tt := r.Type()\n\n\tif tag.Get(\"flattened\") == \"\" { // look at all item entries\n\t\tmname := \"member\"\n\t\tif name := tag.Get(\"locationNameList\"); name != \"\" {\n\t\t\tmname = name\n\t\t}\n\n\t\tif Children, ok := node.Children[mname]; ok {\n\t\t\tif r.IsNil() {\n\t\t\t\tr.Set(reflect.MakeSlice(t, len(Children), len(Children)))\n\t\t\t}\n\n\t\t\tfor i, c := range Children {\n\t\t\t\terr := parse(r.Index(i), c, \"\")\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else { // flattened list means this is a single element\n\t\tif r.IsNil() {\n\t\t\tr.Set(reflect.MakeSlice(t, 0, 0))\n\t\t}\n\n\t\tchildR := reflect.Zero(t.Elem())\n\t\tr.Set(reflect.Append(r, childR))\n\t\terr := parse(r.Index(r.Len()-1), node, \"\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// parseMap deserializes a map from an XMLNode. The direct children of the XMLNode\n// will also be deserialized as map entries.\nfunc parseMap(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {\n\tif r.IsNil() {\n\t\tr.Set(reflect.MakeMap(r.Type()))\n\t}\n\n\tif tag.Get(\"flattened\") == \"\" { // look at all child entries\n\t\tfor _, entry := range node.Children[\"entry\"] {\n\t\t\tparseMapEntry(r, entry, tag)\n\t\t}\n\t} else { // this element is itself an entry\n\t\tparseMapEntry(r, node, tag)\n\t}\n\n\treturn nil\n}\n\n// parseMapEntry deserializes a map entry from a XML node.\nfunc parseMapEntry(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {\n\tkname, vname := \"key\", \"value\"\n\tif n := tag.Get(\"locationNameKey\"); n != \"\" {\n\t\tkname = n\n\t}\n\tif n := tag.Get(\"locationNameValue\"); n != \"\" {\n\t\tvname = n\n\t}\n\n\tkeys, ok := node.Children[kname]\n\tvalues := node.Children[vname]\n\tif ok {\n\t\tfor i, key := range keys {\n\t\t\tkeyR := reflect.ValueOf(key.Text)\n\t\t\tvalue := values[i]\n\t\t\tvalueR := reflect.New(r.Type().Elem()).Elem()\n\n\t\t\tparse(valueR, value, \"\")\n\t\t\tr.SetMapIndex(keyR, valueR)\n\t\t}\n\t}\n\treturn nil\n}\n\n// parseScaller deserializes an XMLNode value into a concrete type based on the\n// interface type of r.\n//\n// Error is returned if the deserialization fails due to invalid type conversion,\n// or unsupported interface type.\nfunc parseScalar(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {\n\tswitch r.Interface().(type) {\n\tcase *string:\n\t\tr.Set(reflect.ValueOf(&node.Text))\n\t\treturn nil\n\tcase []byte:\n\t\tb, err := base64.StdEncoding.DecodeString(node.Text)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tr.Set(reflect.ValueOf(b))\n\tcase *bool:\n\t\tv, err := strconv.ParseBool(node.Text)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tr.Set(reflect.ValueOf(&v))\n\tcase *int64:\n\t\tv, err := strconv.ParseInt(node.Text, 10, 64)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tr.Set(reflect.ValueOf(&v))\n\tcase *float64:\n\t\tv, err := strconv.ParseFloat(node.Text, 64)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tr.Set(reflect.ValueOf(&v))\n\tcase *time.Time:\n\t\tconst ISO8601UTC = \"2006-01-02T15:04:05Z\"\n\t\tt, err := time.Parse(ISO8601UTC, node.Text)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tr.Set(reflect.ValueOf(&t))\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported value: %v (%s)\", r.Interface(), r.Type())\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go",
    "content": "package xmlutil\n\nimport (\n\t\"encoding/xml\"\n\t\"io\"\n\t\"sort\"\n)\n\n// A XMLNode contains the values to be encoded or decoded.\ntype XMLNode struct {\n\tName     xml.Name              `json:\",omitempty\"`\n\tChildren map[string][]*XMLNode `json:\",omitempty\"`\n\tText     string                `json:\",omitempty\"`\n\tAttr     []xml.Attr            `json:\",omitempty\"`\n}\n\n// NewXMLElement returns a pointer to a new XMLNode initialized to default values.\nfunc NewXMLElement(name xml.Name) *XMLNode {\n\treturn &XMLNode{\n\t\tName:     name,\n\t\tChildren: map[string][]*XMLNode{},\n\t\tAttr:     []xml.Attr{},\n\t}\n}\n\n// AddChild adds child to the XMLNode.\nfunc (n *XMLNode) AddChild(child *XMLNode) {\n\tif _, ok := n.Children[child.Name.Local]; !ok {\n\t\tn.Children[child.Name.Local] = []*XMLNode{}\n\t}\n\tn.Children[child.Name.Local] = append(n.Children[child.Name.Local], child)\n}\n\n// XMLToStruct converts a xml.Decoder stream to XMLNode with nested values.\nfunc XMLToStruct(d *xml.Decoder, s *xml.StartElement) (*XMLNode, error) {\n\tout := &XMLNode{}\n\tfor {\n\t\ttok, err := d.Token()\n\t\tif tok == nil || err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn out, err\n\t\t}\n\n\t\tswitch typed := tok.(type) {\n\t\tcase xml.CharData:\n\t\t\tout.Text = string(typed.Copy())\n\t\tcase xml.StartElement:\n\t\t\tel := typed.Copy()\n\t\t\tout.Attr = el.Attr\n\t\t\tif out.Children == nil {\n\t\t\t\tout.Children = map[string][]*XMLNode{}\n\t\t\t}\n\n\t\t\tname := typed.Name.Local\n\t\t\tslice := out.Children[name]\n\t\t\tif slice == nil {\n\t\t\t\tslice = []*XMLNode{}\n\t\t\t}\n\t\t\tnode, e := XMLToStruct(d, &el)\n\t\t\tif e != nil {\n\t\t\t\treturn out, e\n\t\t\t}\n\t\t\tnode.Name = typed.Name\n\t\t\tslice = append(slice, node)\n\t\t\tout.Children[name] = slice\n\t\tcase xml.EndElement:\n\t\t\tif s != nil && s.Name.Local == typed.Name.Local { // matching end token\n\t\t\t\treturn out, nil\n\t\t\t}\n\t\t}\n\t}\n\treturn out, nil\n}\n\n// StructToXML writes an XMLNode to a xml.Encoder as tokens.\nfunc StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error {\n\te.EncodeToken(xml.StartElement{Name: node.Name, Attr: node.Attr})\n\n\tif node.Text != \"\" {\n\t\te.EncodeToken(xml.CharData([]byte(node.Text)))\n\t} else if sorted {\n\t\tsortedNames := []string{}\n\t\tfor k := range node.Children {\n\t\t\tsortedNames = append(sortedNames, k)\n\t\t}\n\t\tsort.Strings(sortedNames)\n\n\t\tfor _, k := range sortedNames {\n\t\t\tfor _, v := range node.Children[k] {\n\t\t\t\tStructToXML(e, v, sorted)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor _, c := range node.Children {\n\t\t\tfor _, v := range c {\n\t\t\t\tStructToXML(e, v, sorted)\n\t\t\t}\n\t\t}\n\t}\n\n\te.EncodeToken(xml.EndElement{Name: node.Name})\n\treturn e.Flush()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/api.go",
    "content": "// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n\n// Package cloudwatchlogs provides a client for Amazon CloudWatch Logs.\npackage cloudwatchlogs\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/aws/aws-sdk-go/aws/awsutil\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n\t\"github.com/aws/aws-sdk-go/private/protocol\"\n\t\"github.com/aws/aws-sdk-go/private/protocol/jsonrpc\"\n)\n\nconst opCancelExportTask = \"CancelExportTask\"\n\n// CancelExportTaskRequest generates a \"aws/request.Request\" representing the\n// client's request for the CancelExportTask operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the CancelExportTask method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the CancelExportTaskRequest method.\n//    req, resp := client.CancelExportTaskRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) CancelExportTaskRequest(input *CancelExportTaskInput) (req *request.Request, output *CancelExportTaskOutput) {\n\top := &request.Operation{\n\t\tName:       opCancelExportTask,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &CancelExportTaskInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\treq.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)\n\treq.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)\n\toutput = &CancelExportTaskOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Cancels an export task if it is in PENDING or RUNNING state.\nfunc (c *CloudWatchLogs) CancelExportTask(input *CancelExportTaskInput) (*CancelExportTaskOutput, error) {\n\treq, out := c.CancelExportTaskRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opCreateExportTask = \"CreateExportTask\"\n\n// CreateExportTaskRequest generates a \"aws/request.Request\" representing the\n// client's request for the CreateExportTask operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the CreateExportTask method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the CreateExportTaskRequest method.\n//    req, resp := client.CreateExportTaskRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) CreateExportTaskRequest(input *CreateExportTaskInput) (req *request.Request, output *CreateExportTaskOutput) {\n\top := &request.Operation{\n\t\tName:       opCreateExportTask,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &CreateExportTaskInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &CreateExportTaskOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Creates an ExportTask which allows you to efficiently export data from a\n// Log Group to your Amazon S3 bucket.\n//\n// This is an asynchronous call. If all the required information is provided,\n// this API will initiate an export task and respond with the task Id. Once\n// started, DescribeExportTasks can be used to get the status of an export task.\n// You can only have one active (RUNNING or PENDING) export task at a time,\n// per account.\n//\n// You can export logs from multiple log groups or multiple time ranges to\n// the same Amazon S3 bucket. To separate out log data for each export task,\n// you can specify a prefix that will be used as the Amazon S3 key prefix for\n// all exported objects.\nfunc (c *CloudWatchLogs) CreateExportTask(input *CreateExportTaskInput) (*CreateExportTaskOutput, error) {\n\treq, out := c.CreateExportTaskRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opCreateLogGroup = \"CreateLogGroup\"\n\n// CreateLogGroupRequest generates a \"aws/request.Request\" representing the\n// client's request for the CreateLogGroup operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the CreateLogGroup method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the CreateLogGroupRequest method.\n//    req, resp := client.CreateLogGroupRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) (req *request.Request, output *CreateLogGroupOutput) {\n\top := &request.Operation{\n\t\tName:       opCreateLogGroup,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &CreateLogGroupInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\treq.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)\n\treq.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)\n\toutput = &CreateLogGroupOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Creates a new log group with the specified name. The name of the log group\n// must be unique within a region for an AWS account. You can create up to 500\n// log groups per account.\n//\n// You must use the following guidelines when naming a log group:\n//\n//   Log group names can be between 1 and 512 characters long.\n//\n//   Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen),\n// '/' (forward slash), and '.' (period).\nfunc (c *CloudWatchLogs) CreateLogGroup(input *CreateLogGroupInput) (*CreateLogGroupOutput, error) {\n\treq, out := c.CreateLogGroupRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opCreateLogStream = \"CreateLogStream\"\n\n// CreateLogStreamRequest generates a \"aws/request.Request\" representing the\n// client's request for the CreateLogStream operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the CreateLogStream method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the CreateLogStreamRequest method.\n//    req, resp := client.CreateLogStreamRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) CreateLogStreamRequest(input *CreateLogStreamInput) (req *request.Request, output *CreateLogStreamOutput) {\n\top := &request.Operation{\n\t\tName:       opCreateLogStream,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &CreateLogStreamInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\treq.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)\n\treq.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)\n\toutput = &CreateLogStreamOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Creates a new log stream in the specified log group. The name of the log\n// stream must be unique within the log group. There is no limit on the number\n// of log streams that can exist in a log group.\n//\n// You must use the following guidelines when naming a log stream:\n//\n//   Log stream names can be between 1 and 512 characters long.\n//\n//   The ':' colon character is not allowed.\nfunc (c *CloudWatchLogs) CreateLogStream(input *CreateLogStreamInput) (*CreateLogStreamOutput, error) {\n\treq, out := c.CreateLogStreamRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opDeleteDestination = \"DeleteDestination\"\n\n// DeleteDestinationRequest generates a \"aws/request.Request\" representing the\n// client's request for the DeleteDestination operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DeleteDestination method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the DeleteDestinationRequest method.\n//    req, resp := client.DeleteDestinationRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) DeleteDestinationRequest(input *DeleteDestinationInput) (req *request.Request, output *DeleteDestinationOutput) {\n\top := &request.Operation{\n\t\tName:       opDeleteDestination,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &DeleteDestinationInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\treq.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)\n\treq.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)\n\toutput = &DeleteDestinationOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Deletes the destination with the specified name and eventually disables all\n// the subscription filters that publish to it. This will not delete the physical\n// resource encapsulated by the destination.\nfunc (c *CloudWatchLogs) DeleteDestination(input *DeleteDestinationInput) (*DeleteDestinationOutput, error) {\n\treq, out := c.DeleteDestinationRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opDeleteLogGroup = \"DeleteLogGroup\"\n\n// DeleteLogGroupRequest generates a \"aws/request.Request\" representing the\n// client's request for the DeleteLogGroup operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DeleteLogGroup method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the DeleteLogGroupRequest method.\n//    req, resp := client.DeleteLogGroupRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) DeleteLogGroupRequest(input *DeleteLogGroupInput) (req *request.Request, output *DeleteLogGroupOutput) {\n\top := &request.Operation{\n\t\tName:       opDeleteLogGroup,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &DeleteLogGroupInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\treq.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)\n\treq.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)\n\toutput = &DeleteLogGroupOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Deletes the log group with the specified name and permanently deletes all\n// the archived log events associated with it.\nfunc (c *CloudWatchLogs) DeleteLogGroup(input *DeleteLogGroupInput) (*DeleteLogGroupOutput, error) {\n\treq, out := c.DeleteLogGroupRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opDeleteLogStream = \"DeleteLogStream\"\n\n// DeleteLogStreamRequest generates a \"aws/request.Request\" representing the\n// client's request for the DeleteLogStream operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DeleteLogStream method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the DeleteLogStreamRequest method.\n//    req, resp := client.DeleteLogStreamRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) DeleteLogStreamRequest(input *DeleteLogStreamInput) (req *request.Request, output *DeleteLogStreamOutput) {\n\top := &request.Operation{\n\t\tName:       opDeleteLogStream,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &DeleteLogStreamInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\treq.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)\n\treq.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)\n\toutput = &DeleteLogStreamOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Deletes a log stream and permanently deletes all the archived log events\n// associated with it.\nfunc (c *CloudWatchLogs) DeleteLogStream(input *DeleteLogStreamInput) (*DeleteLogStreamOutput, error) {\n\treq, out := c.DeleteLogStreamRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opDeleteMetricFilter = \"DeleteMetricFilter\"\n\n// DeleteMetricFilterRequest generates a \"aws/request.Request\" representing the\n// client's request for the DeleteMetricFilter operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DeleteMetricFilter method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the DeleteMetricFilterRequest method.\n//    req, resp := client.DeleteMetricFilterRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) DeleteMetricFilterRequest(input *DeleteMetricFilterInput) (req *request.Request, output *DeleteMetricFilterOutput) {\n\top := &request.Operation{\n\t\tName:       opDeleteMetricFilter,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &DeleteMetricFilterInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\treq.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)\n\treq.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)\n\toutput = &DeleteMetricFilterOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Deletes a metric filter associated with the specified log group.\nfunc (c *CloudWatchLogs) DeleteMetricFilter(input *DeleteMetricFilterInput) (*DeleteMetricFilterOutput, error) {\n\treq, out := c.DeleteMetricFilterRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opDeleteRetentionPolicy = \"DeleteRetentionPolicy\"\n\n// DeleteRetentionPolicyRequest generates a \"aws/request.Request\" representing the\n// client's request for the DeleteRetentionPolicy operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DeleteRetentionPolicy method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the DeleteRetentionPolicyRequest method.\n//    req, resp := client.DeleteRetentionPolicyRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) DeleteRetentionPolicyRequest(input *DeleteRetentionPolicyInput) (req *request.Request, output *DeleteRetentionPolicyOutput) {\n\top := &request.Operation{\n\t\tName:       opDeleteRetentionPolicy,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &DeleteRetentionPolicyInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\treq.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)\n\treq.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)\n\toutput = &DeleteRetentionPolicyOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Deletes the retention policy of the specified log group. Log events would\n// not expire if they belong to log groups without a retention policy.\nfunc (c *CloudWatchLogs) DeleteRetentionPolicy(input *DeleteRetentionPolicyInput) (*DeleteRetentionPolicyOutput, error) {\n\treq, out := c.DeleteRetentionPolicyRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opDeleteSubscriptionFilter = \"DeleteSubscriptionFilter\"\n\n// DeleteSubscriptionFilterRequest generates a \"aws/request.Request\" representing the\n// client's request for the DeleteSubscriptionFilter operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DeleteSubscriptionFilter method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the DeleteSubscriptionFilterRequest method.\n//    req, resp := client.DeleteSubscriptionFilterRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) DeleteSubscriptionFilterRequest(input *DeleteSubscriptionFilterInput) (req *request.Request, output *DeleteSubscriptionFilterOutput) {\n\top := &request.Operation{\n\t\tName:       opDeleteSubscriptionFilter,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &DeleteSubscriptionFilterInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\treq.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)\n\treq.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)\n\toutput = &DeleteSubscriptionFilterOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Deletes a subscription filter associated with the specified log group.\nfunc (c *CloudWatchLogs) DeleteSubscriptionFilter(input *DeleteSubscriptionFilterInput) (*DeleteSubscriptionFilterOutput, error) {\n\treq, out := c.DeleteSubscriptionFilterRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opDescribeDestinations = \"DescribeDestinations\"\n\n// DescribeDestinationsRequest generates a \"aws/request.Request\" representing the\n// client's request for the DescribeDestinations operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DescribeDestinations method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the DescribeDestinationsRequest method.\n//    req, resp := client.DescribeDestinationsRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) DescribeDestinationsRequest(input *DescribeDestinationsInput) (req *request.Request, output *DescribeDestinationsOutput) {\n\top := &request.Operation{\n\t\tName:       opDescribeDestinations,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t\tPaginator: &request.Paginator{\n\t\t\tInputTokens:     []string{\"nextToken\"},\n\t\t\tOutputTokens:    []string{\"nextToken\"},\n\t\t\tLimitToken:      \"limit\",\n\t\t\tTruncationToken: \"\",\n\t\t},\n\t}\n\n\tif input == nil {\n\t\tinput = &DescribeDestinationsInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &DescribeDestinationsOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Returns all the destinations that are associated with the AWS account making\n// the request. The list returned in the response is ASCII-sorted by destination\n// name.\n//\n// By default, this operation returns up to 50 destinations. If there are more\n// destinations to list, the response would contain a nextToken value in the\n// response body. You can also limit the number of destinations returned in\n// the response by specifying the limit parameter in the request.\nfunc (c *CloudWatchLogs) DescribeDestinations(input *DescribeDestinationsInput) (*DescribeDestinationsOutput, error) {\n\treq, out := c.DescribeDestinationsRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\n// DescribeDestinationsPages iterates over the pages of a DescribeDestinations operation,\n// calling the \"fn\" function with the response data for each page. To stop\n// iterating, return false from the fn function.\n//\n// See DescribeDestinations method for more information on how to use this operation.\n//\n// Note: This operation can generate multiple requests to a service.\n//\n//    // Example iterating over at most 3 pages of a DescribeDestinations operation.\n//    pageNum := 0\n//    err := client.DescribeDestinationsPages(params,\n//        func(page *DescribeDestinationsOutput, lastPage bool) bool {\n//            pageNum++\n//            fmt.Println(page)\n//            return pageNum <= 3\n//        })\n//\nfunc (c *CloudWatchLogs) DescribeDestinationsPages(input *DescribeDestinationsInput, fn func(p *DescribeDestinationsOutput, lastPage bool) (shouldContinue bool)) error {\n\tpage, _ := c.DescribeDestinationsRequest(input)\n\tpage.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler(\"Paginator\"))\n\treturn page.EachPage(func(p interface{}, lastPage bool) bool {\n\t\treturn fn(p.(*DescribeDestinationsOutput), lastPage)\n\t})\n}\n\nconst opDescribeExportTasks = \"DescribeExportTasks\"\n\n// DescribeExportTasksRequest generates a \"aws/request.Request\" representing the\n// client's request for the DescribeExportTasks operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DescribeExportTasks method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the DescribeExportTasksRequest method.\n//    req, resp := client.DescribeExportTasksRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) DescribeExportTasksRequest(input *DescribeExportTasksInput) (req *request.Request, output *DescribeExportTasksOutput) {\n\top := &request.Operation{\n\t\tName:       opDescribeExportTasks,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &DescribeExportTasksInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &DescribeExportTasksOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Returns all the export tasks that are associated with the AWS account making\n// the request. The export tasks can be filtered based on TaskId or TaskStatus.\n//\n// By default, this operation returns up to 50 export tasks that satisfy the\n// specified filters. If there are more export tasks to list, the response would\n// contain a nextToken value in the response body. You can also limit the number\n// of export tasks returned in the response by specifying the limit parameter\n// in the request.\nfunc (c *CloudWatchLogs) DescribeExportTasks(input *DescribeExportTasksInput) (*DescribeExportTasksOutput, error) {\n\treq, out := c.DescribeExportTasksRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opDescribeLogGroups = \"DescribeLogGroups\"\n\n// DescribeLogGroupsRequest generates a \"aws/request.Request\" representing the\n// client's request for the DescribeLogGroups operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DescribeLogGroups method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the DescribeLogGroupsRequest method.\n//    req, resp := client.DescribeLogGroupsRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) DescribeLogGroupsRequest(input *DescribeLogGroupsInput) (req *request.Request, output *DescribeLogGroupsOutput) {\n\top := &request.Operation{\n\t\tName:       opDescribeLogGroups,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t\tPaginator: &request.Paginator{\n\t\t\tInputTokens:     []string{\"nextToken\"},\n\t\t\tOutputTokens:    []string{\"nextToken\"},\n\t\t\tLimitToken:      \"limit\",\n\t\t\tTruncationToken: \"\",\n\t\t},\n\t}\n\n\tif input == nil {\n\t\tinput = &DescribeLogGroupsInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &DescribeLogGroupsOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Returns all the log groups that are associated with the AWS account making\n// the request. The list returned in the response is ASCII-sorted by log group\n// name.\n//\n// By default, this operation returns up to 50 log groups. If there are more\n// log groups to list, the response would contain a nextToken value in the response\n// body. You can also limit the number of log groups returned in the response\n// by specifying the limit parameter in the request.\nfunc (c *CloudWatchLogs) DescribeLogGroups(input *DescribeLogGroupsInput) (*DescribeLogGroupsOutput, error) {\n\treq, out := c.DescribeLogGroupsRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\n// DescribeLogGroupsPages iterates over the pages of a DescribeLogGroups operation,\n// calling the \"fn\" function with the response data for each page. To stop\n// iterating, return false from the fn function.\n//\n// See DescribeLogGroups method for more information on how to use this operation.\n//\n// Note: This operation can generate multiple requests to a service.\n//\n//    // Example iterating over at most 3 pages of a DescribeLogGroups operation.\n//    pageNum := 0\n//    err := client.DescribeLogGroupsPages(params,\n//        func(page *DescribeLogGroupsOutput, lastPage bool) bool {\n//            pageNum++\n//            fmt.Println(page)\n//            return pageNum <= 3\n//        })\n//\nfunc (c *CloudWatchLogs) DescribeLogGroupsPages(input *DescribeLogGroupsInput, fn func(p *DescribeLogGroupsOutput, lastPage bool) (shouldContinue bool)) error {\n\tpage, _ := c.DescribeLogGroupsRequest(input)\n\tpage.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler(\"Paginator\"))\n\treturn page.EachPage(func(p interface{}, lastPage bool) bool {\n\t\treturn fn(p.(*DescribeLogGroupsOutput), lastPage)\n\t})\n}\n\nconst opDescribeLogStreams = \"DescribeLogStreams\"\n\n// DescribeLogStreamsRequest generates a \"aws/request.Request\" representing the\n// client's request for the DescribeLogStreams operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DescribeLogStreams method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the DescribeLogStreamsRequest method.\n//    req, resp := client.DescribeLogStreamsRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) DescribeLogStreamsRequest(input *DescribeLogStreamsInput) (req *request.Request, output *DescribeLogStreamsOutput) {\n\top := &request.Operation{\n\t\tName:       opDescribeLogStreams,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t\tPaginator: &request.Paginator{\n\t\t\tInputTokens:     []string{\"nextToken\"},\n\t\t\tOutputTokens:    []string{\"nextToken\"},\n\t\t\tLimitToken:      \"limit\",\n\t\t\tTruncationToken: \"\",\n\t\t},\n\t}\n\n\tif input == nil {\n\t\tinput = &DescribeLogStreamsInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &DescribeLogStreamsOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Returns all the log streams that are associated with the specified log group.\n// The list returned in the response is ASCII-sorted by log stream name.\n//\n// By default, this operation returns up to 50 log streams. If there are more\n// log streams to list, the response would contain a nextToken value in the\n// response body. You can also limit the number of log streams returned in the\n// response by specifying the limit parameter in the request. This operation\n// has a limit of five transactions per second, after which transactions are\n// throttled.\nfunc (c *CloudWatchLogs) DescribeLogStreams(input *DescribeLogStreamsInput) (*DescribeLogStreamsOutput, error) {\n\treq, out := c.DescribeLogStreamsRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\n// DescribeLogStreamsPages iterates over the pages of a DescribeLogStreams operation,\n// calling the \"fn\" function with the response data for each page. To stop\n// iterating, return false from the fn function.\n//\n// See DescribeLogStreams method for more information on how to use this operation.\n//\n// Note: This operation can generate multiple requests to a service.\n//\n//    // Example iterating over at most 3 pages of a DescribeLogStreams operation.\n//    pageNum := 0\n//    err := client.DescribeLogStreamsPages(params,\n//        func(page *DescribeLogStreamsOutput, lastPage bool) bool {\n//            pageNum++\n//            fmt.Println(page)\n//            return pageNum <= 3\n//        })\n//\nfunc (c *CloudWatchLogs) DescribeLogStreamsPages(input *DescribeLogStreamsInput, fn func(p *DescribeLogStreamsOutput, lastPage bool) (shouldContinue bool)) error {\n\tpage, _ := c.DescribeLogStreamsRequest(input)\n\tpage.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler(\"Paginator\"))\n\treturn page.EachPage(func(p interface{}, lastPage bool) bool {\n\t\treturn fn(p.(*DescribeLogStreamsOutput), lastPage)\n\t})\n}\n\nconst opDescribeMetricFilters = \"DescribeMetricFilters\"\n\n// DescribeMetricFiltersRequest generates a \"aws/request.Request\" representing the\n// client's request for the DescribeMetricFilters operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DescribeMetricFilters method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the DescribeMetricFiltersRequest method.\n//    req, resp := client.DescribeMetricFiltersRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) DescribeMetricFiltersRequest(input *DescribeMetricFiltersInput) (req *request.Request, output *DescribeMetricFiltersOutput) {\n\top := &request.Operation{\n\t\tName:       opDescribeMetricFilters,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t\tPaginator: &request.Paginator{\n\t\t\tInputTokens:     []string{\"nextToken\"},\n\t\t\tOutputTokens:    []string{\"nextToken\"},\n\t\t\tLimitToken:      \"limit\",\n\t\t\tTruncationToken: \"\",\n\t\t},\n\t}\n\n\tif input == nil {\n\t\tinput = &DescribeMetricFiltersInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &DescribeMetricFiltersOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Returns all the metrics filters associated with the specified log group.\n// The list returned in the response is ASCII-sorted by filter name.\n//\n// By default, this operation returns up to 50 metric filters. If there are\n// more metric filters to list, the response would contain a nextToken value\n// in the response body. You can also limit the number of metric filters returned\n// in the response by specifying the limit parameter in the request.\nfunc (c *CloudWatchLogs) DescribeMetricFilters(input *DescribeMetricFiltersInput) (*DescribeMetricFiltersOutput, error) {\n\treq, out := c.DescribeMetricFiltersRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\n// DescribeMetricFiltersPages iterates over the pages of a DescribeMetricFilters operation,\n// calling the \"fn\" function with the response data for each page. To stop\n// iterating, return false from the fn function.\n//\n// See DescribeMetricFilters method for more information on how to use this operation.\n//\n// Note: This operation can generate multiple requests to a service.\n//\n//    // Example iterating over at most 3 pages of a DescribeMetricFilters operation.\n//    pageNum := 0\n//    err := client.DescribeMetricFiltersPages(params,\n//        func(page *DescribeMetricFiltersOutput, lastPage bool) bool {\n//            pageNum++\n//            fmt.Println(page)\n//            return pageNum <= 3\n//        })\n//\nfunc (c *CloudWatchLogs) DescribeMetricFiltersPages(input *DescribeMetricFiltersInput, fn func(p *DescribeMetricFiltersOutput, lastPage bool) (shouldContinue bool)) error {\n\tpage, _ := c.DescribeMetricFiltersRequest(input)\n\tpage.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler(\"Paginator\"))\n\treturn page.EachPage(func(p interface{}, lastPage bool) bool {\n\t\treturn fn(p.(*DescribeMetricFiltersOutput), lastPage)\n\t})\n}\n\nconst opDescribeSubscriptionFilters = \"DescribeSubscriptionFilters\"\n\n// DescribeSubscriptionFiltersRequest generates a \"aws/request.Request\" representing the\n// client's request for the DescribeSubscriptionFilters operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DescribeSubscriptionFilters method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the DescribeSubscriptionFiltersRequest method.\n//    req, resp := client.DescribeSubscriptionFiltersRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) DescribeSubscriptionFiltersRequest(input *DescribeSubscriptionFiltersInput) (req *request.Request, output *DescribeSubscriptionFiltersOutput) {\n\top := &request.Operation{\n\t\tName:       opDescribeSubscriptionFilters,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t\tPaginator: &request.Paginator{\n\t\t\tInputTokens:     []string{\"nextToken\"},\n\t\t\tOutputTokens:    []string{\"nextToken\"},\n\t\t\tLimitToken:      \"limit\",\n\t\t\tTruncationToken: \"\",\n\t\t},\n\t}\n\n\tif input == nil {\n\t\tinput = &DescribeSubscriptionFiltersInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &DescribeSubscriptionFiltersOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Returns all the subscription filters associated with the specified log group.\n// The list returned in the response is ASCII-sorted by filter name.\n//\n// By default, this operation returns up to 50 subscription filters. If there\n// are more subscription filters to list, the response would contain a nextToken\n// value in the response body. You can also limit the number of subscription\n// filters returned in the response by specifying the limit parameter in the\n// request.\nfunc (c *CloudWatchLogs) DescribeSubscriptionFilters(input *DescribeSubscriptionFiltersInput) (*DescribeSubscriptionFiltersOutput, error) {\n\treq, out := c.DescribeSubscriptionFiltersRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\n// DescribeSubscriptionFiltersPages iterates over the pages of a DescribeSubscriptionFilters operation,\n// calling the \"fn\" function with the response data for each page. To stop\n// iterating, return false from the fn function.\n//\n// See DescribeSubscriptionFilters method for more information on how to use this operation.\n//\n// Note: This operation can generate multiple requests to a service.\n//\n//    // Example iterating over at most 3 pages of a DescribeSubscriptionFilters operation.\n//    pageNum := 0\n//    err := client.DescribeSubscriptionFiltersPages(params,\n//        func(page *DescribeSubscriptionFiltersOutput, lastPage bool) bool {\n//            pageNum++\n//            fmt.Println(page)\n//            return pageNum <= 3\n//        })\n//\nfunc (c *CloudWatchLogs) DescribeSubscriptionFiltersPages(input *DescribeSubscriptionFiltersInput, fn func(p *DescribeSubscriptionFiltersOutput, lastPage bool) (shouldContinue bool)) error {\n\tpage, _ := c.DescribeSubscriptionFiltersRequest(input)\n\tpage.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler(\"Paginator\"))\n\treturn page.EachPage(func(p interface{}, lastPage bool) bool {\n\t\treturn fn(p.(*DescribeSubscriptionFiltersOutput), lastPage)\n\t})\n}\n\nconst opFilterLogEvents = \"FilterLogEvents\"\n\n// FilterLogEventsRequest generates a \"aws/request.Request\" representing the\n// client's request for the FilterLogEvents operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the FilterLogEvents method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the FilterLogEventsRequest method.\n//    req, resp := client.FilterLogEventsRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) FilterLogEventsRequest(input *FilterLogEventsInput) (req *request.Request, output *FilterLogEventsOutput) {\n\top := &request.Operation{\n\t\tName:       opFilterLogEvents,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t\tPaginator: &request.Paginator{\n\t\t\tInputTokens:     []string{\"nextToken\"},\n\t\t\tOutputTokens:    []string{\"nextToken\"},\n\t\t\tLimitToken:      \"limit\",\n\t\t\tTruncationToken: \"\",\n\t\t},\n\t}\n\n\tif input == nil {\n\t\tinput = &FilterLogEventsInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &FilterLogEventsOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Retrieves log events, optionally filtered by a filter pattern from the specified\n// log group. You can provide an optional time range to filter the results on\n// the event timestamp. You can limit the streams searched to an explicit list\n// of logStreamNames.\n//\n// By default, this operation returns as much matching log events as can fit\n// in a response size of 1MB, up to 10,000 log events, or all the events found\n// within a time-bounded scan window. If the response includes a nextToken,\n// then there is more data to search, and the search can be resumed with a new\n// request providing the nextToken. The response will contain a list of searchedLogStreams\n// that contains information about which streams were searched in the request\n// and whether they have been searched completely or require further pagination.\n// The limit parameter in the request can be used to specify the maximum number\n// of events to return in a page.\nfunc (c *CloudWatchLogs) FilterLogEvents(input *FilterLogEventsInput) (*FilterLogEventsOutput, error) {\n\treq, out := c.FilterLogEventsRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\n// FilterLogEventsPages iterates over the pages of a FilterLogEvents operation,\n// calling the \"fn\" function with the response data for each page. To stop\n// iterating, return false from the fn function.\n//\n// See FilterLogEvents method for more information on how to use this operation.\n//\n// Note: This operation can generate multiple requests to a service.\n//\n//    // Example iterating over at most 3 pages of a FilterLogEvents operation.\n//    pageNum := 0\n//    err := client.FilterLogEventsPages(params,\n//        func(page *FilterLogEventsOutput, lastPage bool) bool {\n//            pageNum++\n//            fmt.Println(page)\n//            return pageNum <= 3\n//        })\n//\nfunc (c *CloudWatchLogs) FilterLogEventsPages(input *FilterLogEventsInput, fn func(p *FilterLogEventsOutput, lastPage bool) (shouldContinue bool)) error {\n\tpage, _ := c.FilterLogEventsRequest(input)\n\tpage.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler(\"Paginator\"))\n\treturn page.EachPage(func(p interface{}, lastPage bool) bool {\n\t\treturn fn(p.(*FilterLogEventsOutput), lastPage)\n\t})\n}\n\nconst opGetLogEvents = \"GetLogEvents\"\n\n// GetLogEventsRequest generates a \"aws/request.Request\" representing the\n// client's request for the GetLogEvents operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the GetLogEvents method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the GetLogEventsRequest method.\n//    req, resp := client.GetLogEventsRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) GetLogEventsRequest(input *GetLogEventsInput) (req *request.Request, output *GetLogEventsOutput) {\n\top := &request.Operation{\n\t\tName:       opGetLogEvents,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t\tPaginator: &request.Paginator{\n\t\t\tInputTokens:     []string{\"nextToken\"},\n\t\t\tOutputTokens:    []string{\"nextForwardToken\"},\n\t\t\tLimitToken:      \"limit\",\n\t\t\tTruncationToken: \"\",\n\t\t},\n\t}\n\n\tif input == nil {\n\t\tinput = &GetLogEventsInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &GetLogEventsOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Retrieves log events from the specified log stream. You can provide an optional\n// time range to filter the results on the event timestamp.\n//\n// By default, this operation returns as much log events as can fit in a response\n// size of 1MB, up to 10,000 log events. The response will always include a\n// nextForwardToken and a nextBackwardToken in the response body. You can use\n// any of these tokens in subsequent GetLogEvents requests to paginate through\n// events in either forward or backward direction. You can also limit the number\n// of log events returned in the response by specifying the limit parameter\n// in the request.\nfunc (c *CloudWatchLogs) GetLogEvents(input *GetLogEventsInput) (*GetLogEventsOutput, error) {\n\treq, out := c.GetLogEventsRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\n// GetLogEventsPages iterates over the pages of a GetLogEvents operation,\n// calling the \"fn\" function with the response data for each page. To stop\n// iterating, return false from the fn function.\n//\n// See GetLogEvents method for more information on how to use this operation.\n//\n// Note: This operation can generate multiple requests to a service.\n//\n//    // Example iterating over at most 3 pages of a GetLogEvents operation.\n//    pageNum := 0\n//    err := client.GetLogEventsPages(params,\n//        func(page *GetLogEventsOutput, lastPage bool) bool {\n//            pageNum++\n//            fmt.Println(page)\n//            return pageNum <= 3\n//        })\n//\nfunc (c *CloudWatchLogs) GetLogEventsPages(input *GetLogEventsInput, fn func(p *GetLogEventsOutput, lastPage bool) (shouldContinue bool)) error {\n\tpage, _ := c.GetLogEventsRequest(input)\n\tpage.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler(\"Paginator\"))\n\treturn page.EachPage(func(p interface{}, lastPage bool) bool {\n\t\treturn fn(p.(*GetLogEventsOutput), lastPage)\n\t})\n}\n\nconst opPutDestination = \"PutDestination\"\n\n// PutDestinationRequest generates a \"aws/request.Request\" representing the\n// client's request for the PutDestination operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the PutDestination method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the PutDestinationRequest method.\n//    req, resp := client.PutDestinationRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) PutDestinationRequest(input *PutDestinationInput) (req *request.Request, output *PutDestinationOutput) {\n\top := &request.Operation{\n\t\tName:       opPutDestination,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &PutDestinationInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &PutDestinationOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Creates or updates a Destination. A destination encapsulates a physical resource\n// (such as a Kinesis stream) and allows you to subscribe to a real-time stream\n// of log events of a different account, ingested through PutLogEvents requests.\n// Currently, the only supported physical resource is a Amazon Kinesis stream\n// belonging to the same account as the destination.\n//\n// A destination controls what is written to its Amazon Kinesis stream through\n// an access policy. By default, PutDestination does not set any access policy\n// with the destination, which means a cross-account user will not be able to\n// call PutSubscriptionFilter against this destination. To enable that, the\n// destination owner must call PutDestinationPolicy after PutDestination.\nfunc (c *CloudWatchLogs) PutDestination(input *PutDestinationInput) (*PutDestinationOutput, error) {\n\treq, out := c.PutDestinationRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opPutDestinationPolicy = \"PutDestinationPolicy\"\n\n// PutDestinationPolicyRequest generates a \"aws/request.Request\" representing the\n// client's request for the PutDestinationPolicy operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the PutDestinationPolicy method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the PutDestinationPolicyRequest method.\n//    req, resp := client.PutDestinationPolicyRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) PutDestinationPolicyRequest(input *PutDestinationPolicyInput) (req *request.Request, output *PutDestinationPolicyOutput) {\n\top := &request.Operation{\n\t\tName:       opPutDestinationPolicy,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &PutDestinationPolicyInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\treq.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)\n\treq.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)\n\toutput = &PutDestinationPolicyOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Creates or updates an access policy associated with an existing Destination.\n// An access policy is an IAM policy document (http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.html)\n// that is used to authorize claims to register a subscription filter against\n// a given destination.\nfunc (c *CloudWatchLogs) PutDestinationPolicy(input *PutDestinationPolicyInput) (*PutDestinationPolicyOutput, error) {\n\treq, out := c.PutDestinationPolicyRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opPutLogEvents = \"PutLogEvents\"\n\n// PutLogEventsRequest generates a \"aws/request.Request\" representing the\n// client's request for the PutLogEvents operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the PutLogEvents method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the PutLogEventsRequest method.\n//    req, resp := client.PutLogEventsRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) PutLogEventsRequest(input *PutLogEventsInput) (req *request.Request, output *PutLogEventsOutput) {\n\top := &request.Operation{\n\t\tName:       opPutLogEvents,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &PutLogEventsInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &PutLogEventsOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Uploads a batch of log events to the specified log stream.\n//\n// Every PutLogEvents request must include the sequenceToken obtained from\n// the response of the previous request. An upload in a newly created log stream\n// does not require a sequenceToken. You can also get the sequenceToken using\n// DescribeLogStreams.\n//\n// The batch of events must satisfy the following constraints:\n//\n//   The maximum batch size is 1,048,576 bytes, and this size is calculated\n// as the sum of all event messages in UTF-8, plus 26 bytes for each log event.\n//\n//   None of the log events in the batch can be more than 2 hours in the future.\n//\n//   None of the log events in the batch can be older than 14 days or the retention\n// period of the log group.\n//\n//   The log events in the batch must be in chronological ordered by their\n// timestamp.\n//\n//   The maximum number of log events in a batch is 10,000.\n//\n//   A batch of log events in a single PutLogEvents request cannot span more\n// than 24 hours. Otherwise, the PutLogEvents operation will fail.\nfunc (c *CloudWatchLogs) PutLogEvents(input *PutLogEventsInput) (*PutLogEventsOutput, error) {\n\treq, out := c.PutLogEventsRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opPutMetricFilter = \"PutMetricFilter\"\n\n// PutMetricFilterRequest generates a \"aws/request.Request\" representing the\n// client's request for the PutMetricFilter operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the PutMetricFilter method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the PutMetricFilterRequest method.\n//    req, resp := client.PutMetricFilterRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) PutMetricFilterRequest(input *PutMetricFilterInput) (req *request.Request, output *PutMetricFilterOutput) {\n\top := &request.Operation{\n\t\tName:       opPutMetricFilter,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &PutMetricFilterInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\treq.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)\n\treq.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)\n\toutput = &PutMetricFilterOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Creates or updates a metric filter and associates it with the specified log\n// group. Metric filters allow you to configure rules to extract metric data\n// from log events ingested through PutLogEvents requests.\n//\n// The maximum number of metric filters that can be associated with a log group\n// is 100.\nfunc (c *CloudWatchLogs) PutMetricFilter(input *PutMetricFilterInput) (*PutMetricFilterOutput, error) {\n\treq, out := c.PutMetricFilterRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opPutRetentionPolicy = \"PutRetentionPolicy\"\n\n// PutRetentionPolicyRequest generates a \"aws/request.Request\" representing the\n// client's request for the PutRetentionPolicy operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the PutRetentionPolicy method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the PutRetentionPolicyRequest method.\n//    req, resp := client.PutRetentionPolicyRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) PutRetentionPolicyRequest(input *PutRetentionPolicyInput) (req *request.Request, output *PutRetentionPolicyOutput) {\n\top := &request.Operation{\n\t\tName:       opPutRetentionPolicy,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &PutRetentionPolicyInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\treq.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)\n\treq.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)\n\toutput = &PutRetentionPolicyOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Sets the retention of the specified log group. A retention policy allows\n// you to configure the number of days you want to retain log events in the\n// specified log group.\nfunc (c *CloudWatchLogs) PutRetentionPolicy(input *PutRetentionPolicyInput) (*PutRetentionPolicyOutput, error) {\n\treq, out := c.PutRetentionPolicyRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opPutSubscriptionFilter = \"PutSubscriptionFilter\"\n\n// PutSubscriptionFilterRequest generates a \"aws/request.Request\" representing the\n// client's request for the PutSubscriptionFilter operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the PutSubscriptionFilter method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the PutSubscriptionFilterRequest method.\n//    req, resp := client.PutSubscriptionFilterRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) PutSubscriptionFilterRequest(input *PutSubscriptionFilterInput) (req *request.Request, output *PutSubscriptionFilterOutput) {\n\top := &request.Operation{\n\t\tName:       opPutSubscriptionFilter,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &PutSubscriptionFilterInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\treq.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)\n\treq.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)\n\toutput = &PutSubscriptionFilterOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Creates or updates a subscription filter and associates it with the specified\n// log group. Subscription filters allow you to subscribe to a real-time stream\n// of log events ingested through PutLogEvents requests and have them delivered\n// to a specific destination. Currently, the supported destinations are:\n//\n//   An Amazon Kinesis stream belonging to the same account as the subscription\n// filter, for same-account delivery.\n//\n//    A logical destination (used via an ARN of Destination) belonging to a\n// different account, for cross-account delivery.\n//\n//   An Amazon Kinesis Firehose stream belonging to the same account as the\n// subscription filter, for same-account delivery.\n//\n//   An AWS Lambda function belonging to the same account as the subscription\n// filter, for same-account delivery.\n//\n//   Currently there can only be one subscription filter associated with a\n// log group.\nfunc (c *CloudWatchLogs) PutSubscriptionFilter(input *PutSubscriptionFilterInput) (*PutSubscriptionFilterOutput, error) {\n\treq, out := c.PutSubscriptionFilterRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opTestMetricFilter = \"TestMetricFilter\"\n\n// TestMetricFilterRequest generates a \"aws/request.Request\" representing the\n// client's request for the TestMetricFilter operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the TestMetricFilter method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the TestMetricFilterRequest method.\n//    req, resp := client.TestMetricFilterRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *CloudWatchLogs) TestMetricFilterRequest(input *TestMetricFilterInput) (req *request.Request, output *TestMetricFilterOutput) {\n\top := &request.Operation{\n\t\tName:       opTestMetricFilter,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &TestMetricFilterInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &TestMetricFilterOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Tests the filter pattern of a metric filter against a sample of log event\n// messages. You can use this operation to validate the correctness of a metric\n// filter pattern.\nfunc (c *CloudWatchLogs) TestMetricFilter(input *TestMetricFilterInput) (*TestMetricFilterOutput, error) {\n\treq, out := c.TestMetricFilterRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\ntype CancelExportTaskInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Id of the export task to cancel.\n\tTaskId *string `locationName:\"taskId\" min:\"1\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s CancelExportTaskInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s CancelExportTaskInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *CancelExportTaskInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CancelExportTaskInput\"}\n\tif s.TaskId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"TaskId\"))\n\t}\n\tif s.TaskId != nil && len(*s.TaskId) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"TaskId\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype CancelExportTaskOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s CancelExportTaskOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s CancelExportTaskOutput) GoString() string {\n\treturn s.String()\n}\n\ntype CreateExportTaskInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Name of Amazon S3 bucket to which the log data will be exported.\n\t//\n\t//  Note: Only buckets in the same AWS region are supported.\n\tDestination *string `locationName:\"destination\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// Prefix that will be used as the start of Amazon S3 key for every object exported.\n\t// If not specified, this defaults to 'exportedlogs'.\n\tDestinationPrefix *string `locationName:\"destinationPrefix\" type:\"string\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC. It indicates the start time of the range for the request. Events\n\t// with a timestamp prior to this time will not be exported.\n\tFrom *int64 `locationName:\"from\" type:\"long\" required:\"true\"`\n\n\t// The name of the log group to export.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// Will only export log streams that match the provided logStreamNamePrefix.\n\t// If you don't specify a value, no prefix filter is applied.\n\tLogStreamNamePrefix *string `locationName:\"logStreamNamePrefix\" min:\"1\" type:\"string\"`\n\n\t// The name of the export task.\n\tTaskName *string `locationName:\"taskName\" min:\"1\" type:\"string\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC. It indicates the end time of the range for the request. Events\n\t// with a timestamp later than this time will not be exported.\n\tTo *int64 `locationName:\"to\" type:\"long\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s CreateExportTaskInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s CreateExportTaskInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *CreateExportTaskInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateExportTaskInput\"}\n\tif s.Destination == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Destination\"))\n\t}\n\tif s.Destination != nil && len(*s.Destination) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Destination\", 1))\n\t}\n\tif s.From == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"From\"))\n\t}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\tif s.LogStreamNamePrefix != nil && len(*s.LogStreamNamePrefix) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogStreamNamePrefix\", 1))\n\t}\n\tif s.TaskName != nil && len(*s.TaskName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"TaskName\", 1))\n\t}\n\tif s.To == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"To\"))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype CreateExportTaskOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Id of the export task that got created.\n\tTaskId *string `locationName:\"taskId\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s CreateExportTaskOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s CreateExportTaskOutput) GoString() string {\n\treturn s.String()\n}\n\ntype CreateLogGroupInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The name of the log group to create.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s CreateLogGroupInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s CreateLogGroupInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *CreateLogGroupInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateLogGroupInput\"}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype CreateLogGroupOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s CreateLogGroupOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s CreateLogGroupOutput) GoString() string {\n\treturn s.String()\n}\n\ntype CreateLogStreamInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The name of the log group under which the log stream is to be created.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// The name of the log stream to create.\n\tLogStreamName *string `locationName:\"logStreamName\" min:\"1\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s CreateLogStreamInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s CreateLogStreamInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *CreateLogStreamInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateLogStreamInput\"}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\tif s.LogStreamName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogStreamName\"))\n\t}\n\tif s.LogStreamName != nil && len(*s.LogStreamName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogStreamName\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype CreateLogStreamOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s CreateLogStreamOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s CreateLogStreamOutput) GoString() string {\n\treturn s.String()\n}\n\ntype DeleteDestinationInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The name of destination to delete.\n\tDestinationName *string `locationName:\"destinationName\" min:\"1\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s DeleteDestinationInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DeleteDestinationInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *DeleteDestinationInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DeleteDestinationInput\"}\n\tif s.DestinationName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"DestinationName\"))\n\t}\n\tif s.DestinationName != nil && len(*s.DestinationName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"DestinationName\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype DeleteDestinationOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s DeleteDestinationOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DeleteDestinationOutput) GoString() string {\n\treturn s.String()\n}\n\ntype DeleteLogGroupInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The name of the log group to delete.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s DeleteLogGroupInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DeleteLogGroupInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *DeleteLogGroupInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DeleteLogGroupInput\"}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype DeleteLogGroupOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s DeleteLogGroupOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DeleteLogGroupOutput) GoString() string {\n\treturn s.String()\n}\n\ntype DeleteLogStreamInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The name of the log group under which the log stream to delete belongs.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// The name of the log stream to delete.\n\tLogStreamName *string `locationName:\"logStreamName\" min:\"1\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s DeleteLogStreamInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DeleteLogStreamInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *DeleteLogStreamInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DeleteLogStreamInput\"}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\tif s.LogStreamName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogStreamName\"))\n\t}\n\tif s.LogStreamName != nil && len(*s.LogStreamName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogStreamName\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype DeleteLogStreamOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s DeleteLogStreamOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DeleteLogStreamOutput) GoString() string {\n\treturn s.String()\n}\n\ntype DeleteMetricFilterInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The name of the metric filter to delete.\n\tFilterName *string `locationName:\"filterName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// The name of the log group that is associated with the metric filter to delete.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s DeleteMetricFilterInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DeleteMetricFilterInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *DeleteMetricFilterInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DeleteMetricFilterInput\"}\n\tif s.FilterName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"FilterName\"))\n\t}\n\tif s.FilterName != nil && len(*s.FilterName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"FilterName\", 1))\n\t}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype DeleteMetricFilterOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s DeleteMetricFilterOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DeleteMetricFilterOutput) GoString() string {\n\treturn s.String()\n}\n\ntype DeleteRetentionPolicyInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The name of the log group that is associated with the retention policy to\n\t// delete.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s DeleteRetentionPolicyInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DeleteRetentionPolicyInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *DeleteRetentionPolicyInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DeleteRetentionPolicyInput\"}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype DeleteRetentionPolicyOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s DeleteRetentionPolicyOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DeleteRetentionPolicyOutput) GoString() string {\n\treturn s.String()\n}\n\ntype DeleteSubscriptionFilterInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The name of the subscription filter to delete.\n\tFilterName *string `locationName:\"filterName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// The name of the log group that is associated with the subscription filter\n\t// to delete.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s DeleteSubscriptionFilterInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DeleteSubscriptionFilterInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *DeleteSubscriptionFilterInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DeleteSubscriptionFilterInput\"}\n\tif s.FilterName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"FilterName\"))\n\t}\n\tif s.FilterName != nil && len(*s.FilterName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"FilterName\", 1))\n\t}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype DeleteSubscriptionFilterOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s DeleteSubscriptionFilterOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DeleteSubscriptionFilterOutput) GoString() string {\n\treturn s.String()\n}\n\ntype DescribeDestinationsInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Will only return destinations that match the provided destinationNamePrefix.\n\t// If you don't specify a value, no prefix is applied.\n\tDestinationNamePrefix *string `min:\"1\" type:\"string\"`\n\n\t// The maximum number of results to return.\n\tLimit *int64 `locationName:\"limit\" min:\"1\" type:\"integer\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the response of the previous request. The\n\t// token expires after 24 hours.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s DescribeDestinationsInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DescribeDestinationsInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *DescribeDestinationsInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DescribeDestinationsInput\"}\n\tif s.DestinationNamePrefix != nil && len(*s.DestinationNamePrefix) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"DestinationNamePrefix\", 1))\n\t}\n\tif s.Limit != nil && *s.Limit < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"Limit\", 1))\n\t}\n\tif s.NextToken != nil && len(*s.NextToken) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"NextToken\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype DescribeDestinationsOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\tDestinations []*Destination `locationName:\"destinations\" type:\"list\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the response of the previous request. The\n\t// token expires after 24 hours.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s DescribeDestinationsOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DescribeDestinationsOutput) GoString() string {\n\treturn s.String()\n}\n\ntype DescribeExportTasksInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The maximum number of items returned in the response. If you don't specify\n\t// a value, the request would return up to 50 items.\n\tLimit *int64 `locationName:\"limit\" min:\"1\" type:\"integer\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the response of the previous DescribeExportTasks\n\t// request.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n\n\t// All export tasks that matches the specified status code will be returned.\n\t// This can return zero or more export tasks.\n\tStatusCode *string `locationName:\"statusCode\" type:\"string\" enum:\"ExportTaskStatusCode\"`\n\n\t// Export task that matches the specified task Id will be returned. This can\n\t// result in zero or one export task.\n\tTaskId *string `locationName:\"taskId\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s DescribeExportTasksInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DescribeExportTasksInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *DescribeExportTasksInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DescribeExportTasksInput\"}\n\tif s.Limit != nil && *s.Limit < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"Limit\", 1))\n\t}\n\tif s.NextToken != nil && len(*s.NextToken) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"NextToken\", 1))\n\t}\n\tif s.TaskId != nil && len(*s.TaskId) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"TaskId\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype DescribeExportTasksOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A list of export tasks.\n\tExportTasks []*ExportTask `locationName:\"exportTasks\" type:\"list\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the response of the previous request. The\n\t// token expires after 24 hours.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s DescribeExportTasksOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DescribeExportTasksOutput) GoString() string {\n\treturn s.String()\n}\n\ntype DescribeLogGroupsInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The maximum number of items returned in the response. If you don't specify\n\t// a value, the request would return up to 50 items.\n\tLimit *int64 `locationName:\"limit\" min:\"1\" type:\"integer\"`\n\n\t// Will only return log groups that match the provided logGroupNamePrefix. If\n\t// you don't specify a value, no prefix filter is applied.\n\tLogGroupNamePrefix *string `locationName:\"logGroupNamePrefix\" min:\"1\" type:\"string\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the response of the previous DescribeLogGroups\n\t// request.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s DescribeLogGroupsInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DescribeLogGroupsInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *DescribeLogGroupsInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DescribeLogGroupsInput\"}\n\tif s.Limit != nil && *s.Limit < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"Limit\", 1))\n\t}\n\tif s.LogGroupNamePrefix != nil && len(*s.LogGroupNamePrefix) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupNamePrefix\", 1))\n\t}\n\tif s.NextToken != nil && len(*s.NextToken) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"NextToken\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype DescribeLogGroupsOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A list of log groups.\n\tLogGroups []*LogGroup `locationName:\"logGroups\" type:\"list\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the response of the previous request. The\n\t// token expires after 24 hours.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s DescribeLogGroupsOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DescribeLogGroupsOutput) GoString() string {\n\treturn s.String()\n}\n\ntype DescribeLogStreamsInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// If set to true, results are returned in descending order. If you don't specify\n\t// a value or set it to false, results are returned in ascending order.\n\tDescending *bool `locationName:\"descending\" type:\"boolean\"`\n\n\t// The maximum number of items returned in the response. If you don't specify\n\t// a value, the request would return up to 50 items.\n\tLimit *int64 `locationName:\"limit\" min:\"1\" type:\"integer\"`\n\n\t// The log group name for which log streams are to be listed.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// Will only return log streams that match the provided logStreamNamePrefix.\n\t// If you don't specify a value, no prefix filter is applied.\n\tLogStreamNamePrefix *string `locationName:\"logStreamNamePrefix\" min:\"1\" type:\"string\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the response of the previous DescribeLogStreams\n\t// request.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n\n\t// Specifies what to order the returned log streams by. Valid arguments are\n\t// 'LogStreamName' or 'LastEventTime'. If you don't specify a value, results\n\t// are ordered by LogStreamName. If 'LastEventTime' is chosen, the request cannot\n\t// also contain a logStreamNamePrefix.\n\tOrderBy *string `locationName:\"orderBy\" type:\"string\" enum:\"OrderBy\"`\n}\n\n// String returns the string representation\nfunc (s DescribeLogStreamsInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DescribeLogStreamsInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *DescribeLogStreamsInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DescribeLogStreamsInput\"}\n\tif s.Limit != nil && *s.Limit < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"Limit\", 1))\n\t}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\tif s.LogStreamNamePrefix != nil && len(*s.LogStreamNamePrefix) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogStreamNamePrefix\", 1))\n\t}\n\tif s.NextToken != nil && len(*s.NextToken) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"NextToken\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype DescribeLogStreamsOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A list of log streams.\n\tLogStreams []*LogStream `locationName:\"logStreams\" type:\"list\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the response of the previous request. The\n\t// token expires after 24 hours.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s DescribeLogStreamsOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DescribeLogStreamsOutput) GoString() string {\n\treturn s.String()\n}\n\ntype DescribeMetricFiltersInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Will only return metric filters that match the provided filterNamePrefix.\n\t// If you don't specify a value, no prefix filter is applied.\n\tFilterNamePrefix *string `locationName:\"filterNamePrefix\" min:\"1\" type:\"string\"`\n\n\t// The maximum number of items returned in the response. If you don't specify\n\t// a value, the request would return up to 50 items.\n\tLimit *int64 `locationName:\"limit\" min:\"1\" type:\"integer\"`\n\n\t// The log group name for which metric filters are to be listed.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the response of the previous DescribeMetricFilters\n\t// request.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s DescribeMetricFiltersInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DescribeMetricFiltersInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *DescribeMetricFiltersInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DescribeMetricFiltersInput\"}\n\tif s.FilterNamePrefix != nil && len(*s.FilterNamePrefix) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"FilterNamePrefix\", 1))\n\t}\n\tif s.Limit != nil && *s.Limit < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"Limit\", 1))\n\t}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\tif s.NextToken != nil && len(*s.NextToken) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"NextToken\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype DescribeMetricFiltersOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\tMetricFilters []*MetricFilter `locationName:\"metricFilters\" type:\"list\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the response of the previous request. The\n\t// token expires after 24 hours.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s DescribeMetricFiltersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DescribeMetricFiltersOutput) GoString() string {\n\treturn s.String()\n}\n\ntype DescribeSubscriptionFiltersInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Will only return subscription filters that match the provided filterNamePrefix.\n\t// If you don't specify a value, no prefix filter is applied.\n\tFilterNamePrefix *string `locationName:\"filterNamePrefix\" min:\"1\" type:\"string\"`\n\n\t// The maximum number of results to return.\n\tLimit *int64 `locationName:\"limit\" min:\"1\" type:\"integer\"`\n\n\t// The log group name for which subscription filters are to be listed.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the response of the previous request. The\n\t// token expires after 24 hours.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s DescribeSubscriptionFiltersInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DescribeSubscriptionFiltersInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *DescribeSubscriptionFiltersInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DescribeSubscriptionFiltersInput\"}\n\tif s.FilterNamePrefix != nil && len(*s.FilterNamePrefix) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"FilterNamePrefix\", 1))\n\t}\n\tif s.Limit != nil && *s.Limit < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"Limit\", 1))\n\t}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\tif s.NextToken != nil && len(*s.NextToken) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"NextToken\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype DescribeSubscriptionFiltersOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the response of the previous request. The\n\t// token expires after 24 hours.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n\n\tSubscriptionFilters []*SubscriptionFilter `locationName:\"subscriptionFilters\" type:\"list\"`\n}\n\n// String returns the string representation\nfunc (s DescribeSubscriptionFiltersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DescribeSubscriptionFiltersOutput) GoString() string {\n\treturn s.String()\n}\n\n// A cross account destination that is the recipient of subscription log events.\ntype Destination struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// An IAM policy document that governs which AWS accounts can create subscription\n\t// filters against this destination.\n\tAccessPolicy *string `locationName:\"accessPolicy\" min:\"1\" type:\"string\"`\n\n\t// ARN of this destination.\n\tArn *string `locationName:\"arn\" type:\"string\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC specifying when this destination was created.\n\tCreationTime *int64 `locationName:\"creationTime\" type:\"long\"`\n\n\t// Name of the destination.\n\tDestinationName *string `locationName:\"destinationName\" min:\"1\" type:\"string\"`\n\n\t// A role for impersonation for delivering log events to the target.\n\tRoleArn *string `locationName:\"roleArn\" min:\"1\" type:\"string\"`\n\n\t// ARN of the physical target where the log events will be delivered (eg. ARN\n\t// of a Kinesis stream).\n\tTargetArn *string `locationName:\"targetArn\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s Destination) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s Destination) GoString() string {\n\treturn s.String()\n}\n\n// Represents an export task.\ntype ExportTask struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Name of Amazon S3 bucket to which the log data was exported.\n\tDestination *string `locationName:\"destination\" min:\"1\" type:\"string\"`\n\n\t// Prefix that was used as the start of Amazon S3 key for every object exported.\n\tDestinationPrefix *string `locationName:\"destinationPrefix\" type:\"string\"`\n\n\t// Execution info about the export task.\n\tExecutionInfo *ExportTaskExecutionInfo `locationName:\"executionInfo\" type:\"structure\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC. Events with a timestamp prior to this time are not exported.\n\tFrom *int64 `locationName:\"from\" type:\"long\"`\n\n\t// The name of the log group from which logs data was exported.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\"`\n\n\t// Status of the export task.\n\tStatus *ExportTaskStatus `locationName:\"status\" type:\"structure\"`\n\n\t// Id of the export task.\n\tTaskId *string `locationName:\"taskId\" min:\"1\" type:\"string\"`\n\n\t// The name of the export task.\n\tTaskName *string `locationName:\"taskName\" min:\"1\" type:\"string\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC. Events with a timestamp later than this time are not exported.\n\tTo *int64 `locationName:\"to\" type:\"long\"`\n}\n\n// String returns the string representation\nfunc (s ExportTask) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s ExportTask) GoString() string {\n\treturn s.String()\n}\n\n// Represents the status of an export task.\ntype ExportTaskExecutionInfo struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A point in time when the export task got completed.\n\tCompletionTime *int64 `locationName:\"completionTime\" type:\"long\"`\n\n\t// A point in time when the export task got created.\n\tCreationTime *int64 `locationName:\"creationTime\" type:\"long\"`\n}\n\n// String returns the string representation\nfunc (s ExportTaskExecutionInfo) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s ExportTaskExecutionInfo) GoString() string {\n\treturn s.String()\n}\n\n// Represents the status of an export task.\ntype ExportTaskStatus struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Status code of the export task.\n\tCode *string `locationName:\"code\" type:\"string\" enum:\"ExportTaskStatusCode\"`\n\n\t// Status message related to the code.\n\tMessage *string `locationName:\"message\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s ExportTaskStatus) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s ExportTaskStatus) GoString() string {\n\treturn s.String()\n}\n\ntype FilterLogEventsInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC. If provided, events with a timestamp later than this time are\n\t// not returned.\n\tEndTime *int64 `locationName:\"endTime\" type:\"long\"`\n\n\t// A valid CloudWatch Logs filter pattern to use for filtering the response.\n\t// If not provided, all the events are matched.\n\tFilterPattern *string `locationName:\"filterPattern\" type:\"string\"`\n\n\t// If provided, the API will make a best effort to provide responses that contain\n\t// events from multiple log streams within the log group interleaved in a single\n\t// response. If not provided, all the matched log events in the first log stream\n\t// will be searched first, then those in the next log stream, etc.\n\tInterleaved *bool `locationName:\"interleaved\" type:\"boolean\"`\n\n\t// The maximum number of events to return in a page of results. Default is 10,000\n\t// events.\n\tLimit *int64 `locationName:\"limit\" min:\"1\" type:\"integer\"`\n\n\t// The name of the log group to query.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// Optional list of log stream names within the specified log group to search.\n\t// Defaults to all the log streams in the log group.\n\tLogStreamNames []*string `locationName:\"logStreamNames\" min:\"1\" type:\"list\"`\n\n\t// A pagination token obtained from a FilterLogEvents response to continue paginating\n\t// the FilterLogEvents results. This token is omitted from the response when\n\t// there are no other events to display.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC. If provided, events with a timestamp prior to this time are\n\t// not returned.\n\tStartTime *int64 `locationName:\"startTime\" type:\"long\"`\n}\n\n// String returns the string representation\nfunc (s FilterLogEventsInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s FilterLogEventsInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *FilterLogEventsInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"FilterLogEventsInput\"}\n\tif s.Limit != nil && *s.Limit < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"Limit\", 1))\n\t}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\tif s.LogStreamNames != nil && len(s.LogStreamNames) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogStreamNames\", 1))\n\t}\n\tif s.NextToken != nil && len(*s.NextToken) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"NextToken\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype FilterLogEventsOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A list of FilteredLogEvent objects representing the matched events from the\n\t// request.\n\tEvents []*FilteredLogEvent `locationName:\"events\" type:\"list\"`\n\n\t// A pagination token obtained from a FilterLogEvents response to continue paginating\n\t// the FilterLogEvents results. This token is omitted from the response when\n\t// there are no other events to display.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n\n\t// A list of SearchedLogStream objects indicating which log streams have been\n\t// searched in this request and whether each has been searched completely or\n\t// still has more to be paginated.\n\tSearchedLogStreams []*SearchedLogStream `locationName:\"searchedLogStreams\" type:\"list\"`\n}\n\n// String returns the string representation\nfunc (s FilterLogEventsOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s FilterLogEventsOutput) GoString() string {\n\treturn s.String()\n}\n\n// Represents a matched event from a FilterLogEvents request.\ntype FilteredLogEvent struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A unique identifier for this event.\n\tEventId *string `locationName:\"eventId\" type:\"string\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC.\n\tIngestionTime *int64 `locationName:\"ingestionTime\" type:\"long\"`\n\n\t// The name of the log stream this event belongs to.\n\tLogStreamName *string `locationName:\"logStreamName\" min:\"1\" type:\"string\"`\n\n\t// The data contained in the log event.\n\tMessage *string `locationName:\"message\" min:\"1\" type:\"string\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC.\n\tTimestamp *int64 `locationName:\"timestamp\" type:\"long\"`\n}\n\n// String returns the string representation\nfunc (s FilteredLogEvent) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s FilteredLogEvent) GoString() string {\n\treturn s.String()\n}\n\ntype GetLogEventsInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC.\n\tEndTime *int64 `locationName:\"endTime\" type:\"long\"`\n\n\t// The maximum number of log events returned in the response. If you don't specify\n\t// a value, the request would return as many log events as can fit in a response\n\t// size of 1MB, up to 10,000 log events.\n\tLimit *int64 `locationName:\"limit\" min:\"1\" type:\"integer\"`\n\n\t// The name of the log group to query.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// The name of the log stream to query.\n\tLogStreamName *string `locationName:\"logStreamName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the nextForwardToken or nextBackwardToken\n\t// fields in the response of the previous GetLogEvents request.\n\tNextToken *string `locationName:\"nextToken\" min:\"1\" type:\"string\"`\n\n\t// If set to true, the earliest log events would be returned first. The default\n\t// is false (the latest log events are returned first).\n\tStartFromHead *bool `locationName:\"startFromHead\" type:\"boolean\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC.\n\tStartTime *int64 `locationName:\"startTime\" type:\"long\"`\n}\n\n// String returns the string representation\nfunc (s GetLogEventsInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s GetLogEventsInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *GetLogEventsInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"GetLogEventsInput\"}\n\tif s.Limit != nil && *s.Limit < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"Limit\", 1))\n\t}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\tif s.LogStreamName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogStreamName\"))\n\t}\n\tif s.LogStreamName != nil && len(*s.LogStreamName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogStreamName\", 1))\n\t}\n\tif s.NextToken != nil && len(*s.NextToken) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"NextToken\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype GetLogEventsOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\tEvents []*OutputLogEvent `locationName:\"events\" type:\"list\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the response of the previous request. The\n\t// token expires after 24 hours.\n\tNextBackwardToken *string `locationName:\"nextBackwardToken\" min:\"1\" type:\"string\"`\n\n\t// A string token used for pagination that points to the next page of results.\n\t// It must be a value obtained from the response of the previous request. The\n\t// token expires after 24 hours.\n\tNextForwardToken *string `locationName:\"nextForwardToken\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s GetLogEventsOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s GetLogEventsOutput) GoString() string {\n\treturn s.String()\n}\n\n// A log event is a record of some activity that was recorded by the application\n// or resource being monitored. The log event record that CloudWatch Logs understands\n// contains two properties: the timestamp of when the event occurred, and the\n// raw event message.\ntype InputLogEvent struct {\n\t_ struct{} `type:\"structure\"`\n\n\tMessage *string `locationName:\"message\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC.\n\tTimestamp *int64 `locationName:\"timestamp\" type:\"long\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s InputLogEvent) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s InputLogEvent) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *InputLogEvent) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"InputLogEvent\"}\n\tif s.Message == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Message\"))\n\t}\n\tif s.Message != nil && len(*s.Message) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Message\", 1))\n\t}\n\tif s.Timestamp == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Timestamp\"))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype LogGroup struct {\n\t_ struct{} `type:\"structure\"`\n\n\tArn *string `locationName:\"arn\" type:\"string\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC.\n\tCreationTime *int64 `locationName:\"creationTime\" type:\"long\"`\n\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\"`\n\n\t// The number of metric filters associated with the log group.\n\tMetricFilterCount *int64 `locationName:\"metricFilterCount\" type:\"integer\"`\n\n\t// Specifies the number of days you want to retain log events in the specified\n\t// log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180,\n\t// 365, 400, 545, 731, 1827, 3653.\n\tRetentionInDays *int64 `locationName:\"retentionInDays\" type:\"integer\"`\n\n\tStoredBytes *int64 `locationName:\"storedBytes\" type:\"long\"`\n}\n\n// String returns the string representation\nfunc (s LogGroup) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s LogGroup) GoString() string {\n\treturn s.String()\n}\n\n// A log stream is sequence of log events from a single emitter of logs.\ntype LogStream struct {\n\t_ struct{} `type:\"structure\"`\n\n\tArn *string `locationName:\"arn\" type:\"string\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC.\n\tCreationTime *int64 `locationName:\"creationTime\" type:\"long\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC.\n\tFirstEventTimestamp *int64 `locationName:\"firstEventTimestamp\" type:\"long\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC.\n\tLastEventTimestamp *int64 `locationName:\"lastEventTimestamp\" type:\"long\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC.\n\tLastIngestionTime *int64 `locationName:\"lastIngestionTime\" type:\"long\"`\n\n\tLogStreamName *string `locationName:\"logStreamName\" min:\"1\" type:\"string\"`\n\n\tStoredBytes *int64 `locationName:\"storedBytes\" type:\"long\"`\n\n\t// A string token used for making PutLogEvents requests. A sequenceToken can\n\t// only be used once, and PutLogEvents requests must include the sequenceToken\n\t// obtained from the response of the previous request.\n\tUploadSequenceToken *string `locationName:\"uploadSequenceToken\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s LogStream) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s LogStream) GoString() string {\n\treturn s.String()\n}\n\n// Metric filters can be used to express how CloudWatch Logs would extract metric\n// observations from ingested log events and transform them to metric data in\n// a CloudWatch metric.\ntype MetricFilter struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC.\n\tCreationTime *int64 `locationName:\"creationTime\" type:\"long\"`\n\n\t// A name for a metric or subscription filter.\n\tFilterName *string `locationName:\"filterName\" min:\"1\" type:\"string\"`\n\n\t// A symbolic description of how CloudWatch Logs should interpret the data in\n\t// each log event. For example, a log event may contain timestamps, IP addresses,\n\t// strings, and so on. You use the filter pattern to specify what to look for\n\t// in the log event message.\n\tFilterPattern *string `locationName:\"filterPattern\" type:\"string\"`\n\n\tMetricTransformations []*MetricTransformation `locationName:\"metricTransformations\" min:\"1\" type:\"list\"`\n}\n\n// String returns the string representation\nfunc (s MetricFilter) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s MetricFilter) GoString() string {\n\treturn s.String()\n}\n\ntype MetricFilterMatchRecord struct {\n\t_ struct{} `type:\"structure\"`\n\n\tEventMessage *string `locationName:\"eventMessage\" min:\"1\" type:\"string\"`\n\n\tEventNumber *int64 `locationName:\"eventNumber\" type:\"long\"`\n\n\tExtractedValues map[string]*string `locationName:\"extractedValues\" type:\"map\"`\n}\n\n// String returns the string representation\nfunc (s MetricFilterMatchRecord) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s MetricFilterMatchRecord) GoString() string {\n\treturn s.String()\n}\n\ntype MetricTransformation struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// (Optional) A default value to emit when a filter pattern does not match a\n\t// log event. Can be null.\n\tDefaultValue *float64 `locationName:\"defaultValue\" type:\"double\"`\n\n\t// Name of the metric.\n\tMetricName *string `locationName:\"metricName\" type:\"string\" required:\"true\"`\n\n\t// Namespace to which the metric belongs.\n\tMetricNamespace *string `locationName:\"metricNamespace\" type:\"string\" required:\"true\"`\n\n\t// A string representing a value to publish to this metric when a filter pattern\n\t// matches a log event.\n\tMetricValue *string `locationName:\"metricValue\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s MetricTransformation) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s MetricTransformation) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *MetricTransformation) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"MetricTransformation\"}\n\tif s.MetricName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"MetricName\"))\n\t}\n\tif s.MetricNamespace == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"MetricNamespace\"))\n\t}\n\tif s.MetricValue == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"MetricValue\"))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype OutputLogEvent struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC.\n\tIngestionTime *int64 `locationName:\"ingestionTime\" type:\"long\"`\n\n\tMessage *string `locationName:\"message\" min:\"1\" type:\"string\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC.\n\tTimestamp *int64 `locationName:\"timestamp\" type:\"long\"`\n}\n\n// String returns the string representation\nfunc (s OutputLogEvent) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s OutputLogEvent) GoString() string {\n\treturn s.String()\n}\n\ntype PutDestinationInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A name for the destination.\n\tDestinationName *string `locationName:\"destinationName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// The ARN of an IAM role that grants CloudWatch Logs permissions to do Amazon\n\t// Kinesis PutRecord requests on the destination stream.\n\tRoleArn *string `locationName:\"roleArn\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// The ARN of an Amazon Kinesis stream to deliver matching log events to.\n\tTargetArn *string `locationName:\"targetArn\" min:\"1\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s PutDestinationInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s PutDestinationInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *PutDestinationInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"PutDestinationInput\"}\n\tif s.DestinationName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"DestinationName\"))\n\t}\n\tif s.DestinationName != nil && len(*s.DestinationName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"DestinationName\", 1))\n\t}\n\tif s.RoleArn == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"RoleArn\"))\n\t}\n\tif s.RoleArn != nil && len(*s.RoleArn) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"RoleArn\", 1))\n\t}\n\tif s.TargetArn == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"TargetArn\"))\n\t}\n\tif s.TargetArn != nil && len(*s.TargetArn) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"TargetArn\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype PutDestinationOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A cross account destination that is the recipient of subscription log events.\n\tDestination *Destination `locationName:\"destination\" type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s PutDestinationOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s PutDestinationOutput) GoString() string {\n\treturn s.String()\n}\n\ntype PutDestinationPolicyInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// An IAM policy document that authorizes cross-account users to deliver their\n\t// log events to associated destination.\n\tAccessPolicy *string `locationName:\"accessPolicy\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// A name for an existing destination.\n\tDestinationName *string `locationName:\"destinationName\" min:\"1\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s PutDestinationPolicyInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s PutDestinationPolicyInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *PutDestinationPolicyInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"PutDestinationPolicyInput\"}\n\tif s.AccessPolicy == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"AccessPolicy\"))\n\t}\n\tif s.AccessPolicy != nil && len(*s.AccessPolicy) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"AccessPolicy\", 1))\n\t}\n\tif s.DestinationName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"DestinationName\"))\n\t}\n\tif s.DestinationName != nil && len(*s.DestinationName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"DestinationName\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype PutDestinationPolicyOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s PutDestinationPolicyOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s PutDestinationPolicyOutput) GoString() string {\n\treturn s.String()\n}\n\ntype PutLogEventsInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A list of log events belonging to a log stream.\n\tLogEvents []*InputLogEvent `locationName:\"logEvents\" min:\"1\" type:\"list\" required:\"true\"`\n\n\t// The name of the log group to put log events to.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// The name of the log stream to put log events to.\n\tLogStreamName *string `locationName:\"logStreamName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// A string token that must be obtained from the response of the previous PutLogEvents\n\t// request.\n\tSequenceToken *string `locationName:\"sequenceToken\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s PutLogEventsInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s PutLogEventsInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *PutLogEventsInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"PutLogEventsInput\"}\n\tif s.LogEvents == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogEvents\"))\n\t}\n\tif s.LogEvents != nil && len(s.LogEvents) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogEvents\", 1))\n\t}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\tif s.LogStreamName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogStreamName\"))\n\t}\n\tif s.LogStreamName != nil && len(*s.LogStreamName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogStreamName\", 1))\n\t}\n\tif s.SequenceToken != nil && len(*s.SequenceToken) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"SequenceToken\", 1))\n\t}\n\tif s.LogEvents != nil {\n\t\tfor i, v := range s.LogEvents {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"LogEvents\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype PutLogEventsOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A string token used for making PutLogEvents requests. A sequenceToken can\n\t// only be used once, and PutLogEvents requests must include the sequenceToken\n\t// obtained from the response of the previous request.\n\tNextSequenceToken *string `locationName:\"nextSequenceToken\" min:\"1\" type:\"string\"`\n\n\tRejectedLogEventsInfo *RejectedLogEventsInfo `locationName:\"rejectedLogEventsInfo\" type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s PutLogEventsOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s PutLogEventsOutput) GoString() string {\n\treturn s.String()\n}\n\ntype PutMetricFilterInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A name for the metric filter.\n\tFilterName *string `locationName:\"filterName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// A valid CloudWatch Logs filter pattern for extracting metric data out of\n\t// ingested log events.\n\tFilterPattern *string `locationName:\"filterPattern\" type:\"string\" required:\"true\"`\n\n\t// The name of the log group to associate the metric filter with.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// A collection of information needed to define how metric data gets emitted.\n\tMetricTransformations []*MetricTransformation `locationName:\"metricTransformations\" min:\"1\" type:\"list\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s PutMetricFilterInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s PutMetricFilterInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *PutMetricFilterInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"PutMetricFilterInput\"}\n\tif s.FilterName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"FilterName\"))\n\t}\n\tif s.FilterName != nil && len(*s.FilterName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"FilterName\", 1))\n\t}\n\tif s.FilterPattern == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"FilterPattern\"))\n\t}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\tif s.MetricTransformations == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"MetricTransformations\"))\n\t}\n\tif s.MetricTransformations != nil && len(s.MetricTransformations) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"MetricTransformations\", 1))\n\t}\n\tif s.MetricTransformations != nil {\n\t\tfor i, v := range s.MetricTransformations {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"MetricTransformations\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype PutMetricFilterOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s PutMetricFilterOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s PutMetricFilterOutput) GoString() string {\n\treturn s.String()\n}\n\ntype PutRetentionPolicyInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The name of the log group to associate the retention policy with.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// Specifies the number of days you want to retain log events in the specified\n\t// log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180,\n\t// 365, 400, 545, 731, 1827, 3653.\n\tRetentionInDays *int64 `locationName:\"retentionInDays\" type:\"integer\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s PutRetentionPolicyInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s PutRetentionPolicyInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *PutRetentionPolicyInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"PutRetentionPolicyInput\"}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\tif s.RetentionInDays == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"RetentionInDays\"))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype PutRetentionPolicyOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s PutRetentionPolicyOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s PutRetentionPolicyOutput) GoString() string {\n\treturn s.String()\n}\n\ntype PutSubscriptionFilterInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The ARN of the destination to deliver matching log events to. Currently,\n\t// the supported destinations are:\n\t//\n\t//   An Amazon Kinesis stream belonging to the same account as the subscription\n\t// filter, for same-account delivery.\n\t//\n\t//   A logical destination (used via an ARN of Destination) belonging to a\n\t// different account, for cross-account delivery.\n\t//\n\t//   An Amazon Kinesis Firehose stream belonging to the same account as the\n\t// subscription filter, for same-account delivery.\n\t//\n\t//   An AWS Lambda function belonging to the same account as the subscription\n\t// filter, for same-account delivery.\n\tDestinationArn *string `locationName:\"destinationArn\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// A name for the subscription filter.\n\tFilterName *string `locationName:\"filterName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// A valid CloudWatch Logs filter pattern for subscribing to a filtered stream\n\t// of log events.\n\tFilterPattern *string `locationName:\"filterPattern\" type:\"string\" required:\"true\"`\n\n\t// The name of the log group to associate the subscription filter with.\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\" required:\"true\"`\n\n\t// The ARN of an IAM role that grants CloudWatch Logs permissions to deliver\n\t// ingested log events to the destination stream. You don't need to provide\n\t// the ARN when you are working with a logical destination (used via an ARN\n\t// of Destination) for cross-account delivery.\n\tRoleArn *string `locationName:\"roleArn\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s PutSubscriptionFilterInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s PutSubscriptionFilterInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *PutSubscriptionFilterInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"PutSubscriptionFilterInput\"}\n\tif s.DestinationArn == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"DestinationArn\"))\n\t}\n\tif s.DestinationArn != nil && len(*s.DestinationArn) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"DestinationArn\", 1))\n\t}\n\tif s.FilterName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"FilterName\"))\n\t}\n\tif s.FilterName != nil && len(*s.FilterName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"FilterName\", 1))\n\t}\n\tif s.FilterPattern == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"FilterPattern\"))\n\t}\n\tif s.LogGroupName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogGroupName\"))\n\t}\n\tif s.LogGroupName != nil && len(*s.LogGroupName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogGroupName\", 1))\n\t}\n\tif s.RoleArn != nil && len(*s.RoleArn) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"RoleArn\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype PutSubscriptionFilterOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s PutSubscriptionFilterOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s PutSubscriptionFilterOutput) GoString() string {\n\treturn s.String()\n}\n\ntype RejectedLogEventsInfo struct {\n\t_ struct{} `type:\"structure\"`\n\n\tExpiredLogEventEndIndex *int64 `locationName:\"expiredLogEventEndIndex\" type:\"integer\"`\n\n\tTooNewLogEventStartIndex *int64 `locationName:\"tooNewLogEventStartIndex\" type:\"integer\"`\n\n\tTooOldLogEventEndIndex *int64 `locationName:\"tooOldLogEventEndIndex\" type:\"integer\"`\n}\n\n// String returns the string representation\nfunc (s RejectedLogEventsInfo) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s RejectedLogEventsInfo) GoString() string {\n\treturn s.String()\n}\n\n// An object indicating the search status of a log stream in a FilterLogEvents\n// request.\ntype SearchedLogStream struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The name of the log stream.\n\tLogStreamName *string `locationName:\"logStreamName\" min:\"1\" type:\"string\"`\n\n\t// Indicates whether all the events in this log stream were searched or more\n\t// data exists to search by paginating further.\n\tSearchedCompletely *bool `locationName:\"searchedCompletely\" type:\"boolean\"`\n}\n\n// String returns the string representation\nfunc (s SearchedLogStream) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s SearchedLogStream) GoString() string {\n\treturn s.String()\n}\n\ntype SubscriptionFilter struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A point in time expressed as the number of milliseconds since Jan 1, 1970\n\t// 00:00:00 UTC.\n\tCreationTime *int64 `locationName:\"creationTime\" type:\"long\"`\n\n\tDestinationArn *string `locationName:\"destinationArn\" min:\"1\" type:\"string\"`\n\n\t// A name for a metric or subscription filter.\n\tFilterName *string `locationName:\"filterName\" min:\"1\" type:\"string\"`\n\n\t// A symbolic description of how CloudWatch Logs should interpret the data in\n\t// each log event. For example, a log event may contain timestamps, IP addresses,\n\t// strings, and so on. You use the filter pattern to specify what to look for\n\t// in the log event message.\n\tFilterPattern *string `locationName:\"filterPattern\" type:\"string\"`\n\n\tLogGroupName *string `locationName:\"logGroupName\" min:\"1\" type:\"string\"`\n\n\tRoleArn *string `locationName:\"roleArn\" min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s SubscriptionFilter) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s SubscriptionFilter) GoString() string {\n\treturn s.String()\n}\n\ntype TestMetricFilterInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A symbolic description of how CloudWatch Logs should interpret the data in\n\t// each log event. For example, a log event may contain timestamps, IP addresses,\n\t// strings, and so on. You use the filter pattern to specify what to look for\n\t// in the log event message.\n\tFilterPattern *string `locationName:\"filterPattern\" type:\"string\" required:\"true\"`\n\n\t// A list of log event messages to test.\n\tLogEventMessages []*string `locationName:\"logEventMessages\" min:\"1\" type:\"list\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s TestMetricFilterInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s TestMetricFilterInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *TestMetricFilterInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"TestMetricFilterInput\"}\n\tif s.FilterPattern == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"FilterPattern\"))\n\t}\n\tif s.LogEventMessages == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"LogEventMessages\"))\n\t}\n\tif s.LogEventMessages != nil && len(s.LogEventMessages) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"LogEventMessages\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\ntype TestMetricFilterOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\tMatches []*MetricFilterMatchRecord `locationName:\"matches\" type:\"list\"`\n}\n\n// String returns the string representation\nfunc (s TestMetricFilterOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s TestMetricFilterOutput) GoString() string {\n\treturn s.String()\n}\n\nconst (\n\t// @enum ExportTaskStatusCode\n\tExportTaskStatusCodeCancelled = \"CANCELLED\"\n\t// @enum ExportTaskStatusCode\n\tExportTaskStatusCodeCompleted = \"COMPLETED\"\n\t// @enum ExportTaskStatusCode\n\tExportTaskStatusCodeFailed = \"FAILED\"\n\t// @enum ExportTaskStatusCode\n\tExportTaskStatusCodePending = \"PENDING\"\n\t// @enum ExportTaskStatusCode\n\tExportTaskStatusCodePendingCancel = \"PENDING_CANCEL\"\n\t// @enum ExportTaskStatusCode\n\tExportTaskStatusCodeRunning = \"RUNNING\"\n)\n\nconst (\n\t// @enum OrderBy\n\tOrderByLogStreamName = \"LogStreamName\"\n\t// @enum OrderBy\n\tOrderByLastEventTime = \"LastEventTime\"\n)\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/service.go",
    "content": "// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n\npackage cloudwatchlogs\n\nimport (\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/client\"\n\t\"github.com/aws/aws-sdk-go/aws/client/metadata\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n\t\"github.com/aws/aws-sdk-go/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go/private/protocol/jsonrpc\"\n)\n\n// You can use Amazon CloudWatch Logs to monitor, store, and access your log\n// files from Amazon Elastic Compute Cloud (Amazon EC2) instances, Amazon CloudTrail,\n// or other sources. You can then retrieve the associated log data from CloudWatch\n// Logs using the Amazon CloudWatch console, the CloudWatch Logs commands in\n// the AWS CLI, the CloudWatch Logs API, or the CloudWatch Logs SDK.\n//\n// You can use CloudWatch Logs to:\n//\n//    Monitor Logs from Amazon EC2 Instances in Real-time: You can use CloudWatch\n// Logs to monitor applications and systems using log data. For example, CloudWatch\n// Logs can track the number of errors that occur in your application logs and\n// send you a notification whenever the rate of errors exceeds a threshold you\n// specify. CloudWatch Logs uses your log data for monitoring; so, no code changes\n// are required. For example, you can monitor application logs for specific\n// literal terms (such as \"NullReferenceException\") or count the number of occurrences\n// of a literal term at a particular position in log data (such as \"404\" status\n// codes in an Apache access log). When the term you are searching for is found,\n// CloudWatch Logs reports the data to a Amazon CloudWatch metric that you specify.\n//\n//    Monitor Amazon CloudTrail Logged Events: You can create alarms in Amazon\n// CloudWatch and receive notifications of particular API activity as captured\n// by CloudTrail and use the notification to perform troubleshooting.\n//\n//    Archive Log Data: You can use CloudWatch Logs to store your log data\n// in highly durable storage. You can change the log retention setting so that\n// any log events older than this setting are automatically deleted. The CloudWatch\n// Logs agent makes it easy to quickly send both rotated and non-rotated log\n// data off of a host and into the log service. You can then access the raw\n// log data when you need it.\n//The service client's operations are safe to be used concurrently.\n// It is not safe to mutate any of the client's properties though.\ntype CloudWatchLogs struct {\n\t*client.Client\n}\n\n// Used for custom client initialization logic\nvar initClient func(*client.Client)\n\n// Used for custom request initialization logic\nvar initRequest func(*request.Request)\n\n// A ServiceName is the name of the service the client will make API calls to.\nconst ServiceName = \"logs\"\n\n// New creates a new instance of the CloudWatchLogs client with a session.\n// If additional configuration is needed for the client instance use the optional\n// aws.Config parameter to add your extra config.\n//\n// Example:\n//     // Create a CloudWatchLogs client from just a session.\n//     svc := cloudwatchlogs.New(mySession)\n//\n//     // Create a CloudWatchLogs client with additional configuration\n//     svc := cloudwatchlogs.New(mySession, aws.NewConfig().WithRegion(\"us-west-2\"))\nfunc New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudWatchLogs {\n\tc := p.ClientConfig(ServiceName, cfgs...)\n\treturn newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)\n}\n\n// newClient creates, initializes and returns a new service client instance.\nfunc newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *CloudWatchLogs {\n\tsvc := &CloudWatchLogs{\n\t\tClient: client.New(\n\t\t\tcfg,\n\t\t\tmetadata.ClientInfo{\n\t\t\t\tServiceName:   ServiceName,\n\t\t\t\tSigningRegion: signingRegion,\n\t\t\t\tEndpoint:      endpoint,\n\t\t\t\tAPIVersion:    \"2014-03-28\",\n\t\t\t\tJSONVersion:   \"1.1\",\n\t\t\t\tTargetPrefix:  \"Logs_20140328\",\n\t\t\t},\n\t\t\thandlers,\n\t\t),\n\t}\n\n\t// Handlers\n\tsvc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)\n\tsvc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)\n\tsvc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)\n\tsvc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)\n\tsvc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)\n\n\t// Run custom client initialization if present\n\tif initClient != nil {\n\t\tinitClient(svc.Client)\n\t}\n\n\treturn svc\n}\n\n// newRequest creates a new request for a CloudWatchLogs operation and runs any\n// custom request initialization.\nfunc (c *CloudWatchLogs) newRequest(op *request.Operation, params, data interface{}) *request.Request {\n\treq := c.NewRequest(op, params, data)\n\n\t// Run custom request initialization if present\n\tif initRequest != nil {\n\t\tinitRequest(req)\n\t}\n\n\treturn req\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/service/sts/api.go",
    "content": "// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n\n// Package sts provides a client for AWS Security Token Service.\npackage sts\n\nimport (\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws/awsutil\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n)\n\nconst opAssumeRole = \"AssumeRole\"\n\n// AssumeRoleRequest generates a \"aws/request.Request\" representing the\n// client's request for the AssumeRole operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the AssumeRole method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the AssumeRoleRequest method.\n//    req, resp := client.AssumeRoleRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, output *AssumeRoleOutput) {\n\top := &request.Operation{\n\t\tName:       opAssumeRole,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &AssumeRoleInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &AssumeRoleOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Returns a set of temporary security credentials (consisting of an access\n// key ID, a secret access key, and a security token) that you can use to access\n// AWS resources that you might not normally have access to. Typically, you\n// use AssumeRole for cross-account access or federation. For a comparison of\n// AssumeRole with the other APIs that produce temporary credentials, see Requesting\n// Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)\n// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)\n// in the IAM User Guide.\n//\n//  Important: You cannot call AssumeRole by using AWS root account credentials;\n// access is denied. You must use credentials for an IAM user or an IAM role\n// to call AssumeRole.\n//\n// For cross-account access, imagine that you own multiple accounts and need\n// to access resources in each account. You could create long-term credentials\n// in each account to access those resources. However, managing all those credentials\n// and remembering which one can access which account can be time consuming.\n// Instead, you can create one set of long-term credentials in one account and\n// then use temporary security credentials to access all the other accounts\n// by assuming roles in those accounts. For more information about roles, see\n// IAM Roles (Delegation and Federation) (http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html)\n// in the IAM User Guide.\n//\n// For federation, you can, for example, grant single sign-on access to the\n// AWS Management Console. If you already have an identity and authentication\n// system in your corporate network, you don't have to recreate user identities\n// in AWS in order to grant those user identities access to AWS. Instead, after\n// a user has been authenticated, you call AssumeRole (and specify the role\n// with the appropriate permissions) to get temporary security credentials for\n// that user. With those temporary security credentials, you construct a sign-in\n// URL that users can use to access the console. For more information, see Common\n// Scenarios for Temporary Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html#sts-introduction)\n// in the IAM User Guide.\n//\n// The temporary security credentials are valid for the duration that you specified\n// when calling AssumeRole, which can be from 900 seconds (15 minutes) to a\n// maximum of 3600 seconds (1 hour). The default is 1 hour.\n//\n// The temporary security credentials created by AssumeRole can be used to\n// make API calls to any AWS service with the following exception: you cannot\n// call the STS service's GetFederationToken or GetSessionToken APIs.\n//\n// Optionally, you can pass an IAM access policy to this operation. If you\n// choose not to pass a policy, the temporary security credentials that are\n// returned by the operation have the permissions that are defined in the access\n// policy of the role that is being assumed. If you pass a policy to this operation,\n// the temporary security credentials that are returned by the operation have\n// the permissions that are allowed by both the access policy of the role that\n// is being assumed,  and  the policy that you pass. This gives you a way to\n// further restrict the permissions for the resulting temporary security credentials.\n// You cannot use the passed policy to grant permissions that are in excess\n// of those allowed by the access policy of the role that is being assumed.\n// For more information, see Permissions for AssumeRole, AssumeRoleWithSAML,\n// and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html)\n// in the IAM User Guide.\n//\n// To assume a role, your AWS account must be trusted by the role. The trust\n// relationship is defined in the role's trust policy when the role is created.\n// That trust policy states which accounts are allowed to delegate access to\n// this account's role.\n//\n// The user who wants to access the role must also have permissions delegated\n// from the role's administrator. If the user is in a different account than\n// the role, then the user's administrator must attach a policy that allows\n// the user to call AssumeRole on the ARN of the role in the other account.\n// If the user is in the same account as the role, then you can either attach\n// a policy to the user (identical to the previous different account user),\n// or you can add the user as a principal directly in the role's trust policy\n//\n//  Using MFA with AssumeRole\n//\n// You can optionally include multi-factor authentication (MFA) information\n// when you call AssumeRole. This is useful for cross-account scenarios in which\n// you want to make sure that the user who is assuming the role has been authenticated\n// using an AWS MFA device. In that scenario, the trust policy of the role being\n// assumed includes a condition that tests for MFA authentication; if the caller\n// does not include valid MFA information, the request to assume the role is\n// denied. The condition in a trust policy that tests for MFA authentication\n// might look like the following example.\n//\n//  \"Condition\": {\"Bool\": {\"aws:MultiFactorAuthPresent\": true}}\n//\n// For more information, see Configuring MFA-Protected API Access (http://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html)\n// in the IAM User Guide guide.\n//\n// To use MFA with AssumeRole, you pass values for the SerialNumber and TokenCode\n// parameters. The SerialNumber value identifies the user's hardware or virtual\n// MFA device. The TokenCode is the time-based one-time password (TOTP) that\n// the MFA devices produces.\nfunc (c *STS) AssumeRole(input *AssumeRoleInput) (*AssumeRoleOutput, error) {\n\treq, out := c.AssumeRoleRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opAssumeRoleWithSAML = \"AssumeRoleWithSAML\"\n\n// AssumeRoleWithSAMLRequest generates a \"aws/request.Request\" representing the\n// client's request for the AssumeRoleWithSAML operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the AssumeRoleWithSAML method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the AssumeRoleWithSAMLRequest method.\n//    req, resp := client.AssumeRoleWithSAMLRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *request.Request, output *AssumeRoleWithSAMLOutput) {\n\top := &request.Operation{\n\t\tName:       opAssumeRoleWithSAML,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &AssumeRoleWithSAMLInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &AssumeRoleWithSAMLOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Returns a set of temporary security credentials for users who have been authenticated\n// via a SAML authentication response. This operation provides a mechanism for\n// tying an enterprise identity store or directory to role-based AWS access\n// without user-specific credentials or configuration. For a comparison of AssumeRoleWithSAML\n// with the other APIs that produce temporary credentials, see Requesting Temporary\n// Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)\n// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)\n// in the IAM User Guide.\n//\n// The temporary security credentials returned by this operation consist of\n// an access key ID, a secret access key, and a security token. Applications\n// can use these temporary security credentials to sign calls to AWS services.\n//\n// The temporary security credentials are valid for the duration that you specified\n// when calling AssumeRole, or until the time specified in the SAML authentication\n// response's SessionNotOnOrAfter value, whichever is shorter. The duration\n// can be from 900 seconds (15 minutes) to a maximum of 3600 seconds (1 hour).\n// The default is 1 hour.\n//\n// The temporary security credentials created by AssumeRoleWithSAML can be\n// used to make API calls to any AWS service with the following exception: you\n// cannot call the STS service's GetFederationToken or GetSessionToken APIs.\n//\n// Optionally, you can pass an IAM access policy to this operation. If you\n// choose not to pass a policy, the temporary security credentials that are\n// returned by the operation have the permissions that are defined in the access\n// policy of the role that is being assumed. If you pass a policy to this operation,\n// the temporary security credentials that are returned by the operation have\n// the permissions that are allowed by the intersection of both the access policy\n// of the role that is being assumed,  and  the policy that you pass. This means\n// that both policies must grant the permission for the action to be allowed.\n// This gives you a way to further restrict the permissions for the resulting\n// temporary security credentials. You cannot use the passed policy to grant\n// permissions that are in excess of those allowed by the access policy of the\n// role that is being assumed. For more information, see Permissions for AssumeRole,\n// AssumeRoleWithSAML, and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html)\n// in the IAM User Guide.\n//\n// Before your application can call AssumeRoleWithSAML, you must configure\n// your SAML identity provider (IdP) to issue the claims required by AWS. Additionally,\n// you must use AWS Identity and Access Management (IAM) to create a SAML provider\n// entity in your AWS account that represents your identity provider, and create\n// an IAM role that specifies this SAML provider in its trust policy.\n//\n// Calling AssumeRoleWithSAML does not require the use of AWS security credentials.\n// The identity of the caller is validated by using keys in the metadata document\n// that is uploaded for the SAML provider entity for your identity provider.\n//\n//  Calling AssumeRoleWithSAML can result in an entry in your AWS CloudTrail\n// logs. The entry includes the value in the NameID element of the SAML assertion.\n// We recommend that you use a NameIDType that is not associated with any personally\n// identifiable information (PII). For example, you could instead use the Persistent\n// Identifier (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent).\n//\n//  For more information, see the following resources:\n//\n//    About SAML 2.0-based Federation (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html)\n// in the IAM User Guide.\n//\n//    Creating SAML Identity Providers (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html)\n// in the IAM User Guide.\n//\n//    Configuring a Relying Party and Claims (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html)\n// in the IAM User Guide.\n//\n//    Creating a Role for SAML 2.0 Federation (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html)\n// in the IAM User Guide.\nfunc (c *STS) AssumeRoleWithSAML(input *AssumeRoleWithSAMLInput) (*AssumeRoleWithSAMLOutput, error) {\n\treq, out := c.AssumeRoleWithSAMLRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opAssumeRoleWithWebIdentity = \"AssumeRoleWithWebIdentity\"\n\n// AssumeRoleWithWebIdentityRequest generates a \"aws/request.Request\" representing the\n// client's request for the AssumeRoleWithWebIdentity operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the AssumeRoleWithWebIdentity method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the AssumeRoleWithWebIdentityRequest method.\n//    req, resp := client.AssumeRoleWithWebIdentityRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityInput) (req *request.Request, output *AssumeRoleWithWebIdentityOutput) {\n\top := &request.Operation{\n\t\tName:       opAssumeRoleWithWebIdentity,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &AssumeRoleWithWebIdentityInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &AssumeRoleWithWebIdentityOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Returns a set of temporary security credentials for users who have been authenticated\n// in a mobile or web application with a web identity provider, such as Amazon\n// Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible\n// identity provider.\n//\n//  For mobile applications, we recommend that you use Amazon Cognito. You\n// can use Amazon Cognito with the AWS SDK for iOS (http://aws.amazon.com/sdkforios/)\n// and the AWS SDK for Android (http://aws.amazon.com/sdkforandroid/) to uniquely\n// identify a user and supply the user with a consistent identity throughout\n// the lifetime of an application.\n//\n// To learn more about Amazon Cognito, see Amazon Cognito Overview (http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-auth.html#d0e840)\n// in the AWS SDK for Android Developer Guide guide and Amazon Cognito Overview\n// (http://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html#d0e664)\n// in the AWS SDK for iOS Developer Guide.\n//\n//  Calling AssumeRoleWithWebIdentity does not require the use of AWS security\n// credentials. Therefore, you can distribute an application (for example, on\n// mobile devices) that requests temporary security credentials without including\n// long-term AWS credentials in the application, and without deploying server-based\n// proxy services that use long-term AWS credentials. Instead, the identity\n// of the caller is validated by using a token from the web identity provider.\n// For a comparison of AssumeRoleWithWebIdentity with the other APIs that produce\n// temporary credentials, see Requesting Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)\n// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)\n// in the IAM User Guide.\n//\n// The temporary security credentials returned by this API consist of an access\n// key ID, a secret access key, and a security token. Applications can use these\n// temporary security credentials to sign calls to AWS service APIs.\n//\n// The credentials are valid for the duration that you specified when calling\n// AssumeRoleWithWebIdentity, which can be from 900 seconds (15 minutes) to\n// a maximum of 3600 seconds (1 hour). The default is 1 hour.\n//\n// The temporary security credentials created by AssumeRoleWithWebIdentity\n// can be used to make API calls to any AWS service with the following exception:\n// you cannot call the STS service's GetFederationToken or GetSessionToken APIs.\n//\n// Optionally, you can pass an IAM access policy to this operation. If you\n// choose not to pass a policy, the temporary security credentials that are\n// returned by the operation have the permissions that are defined in the access\n// policy of the role that is being assumed. If you pass a policy to this operation,\n// the temporary security credentials that are returned by the operation have\n// the permissions that are allowed by both the access policy of the role that\n// is being assumed,  and  the policy that you pass. This gives you a way to\n// further restrict the permissions for the resulting temporary security credentials.\n// You cannot use the passed policy to grant permissions that are in excess\n// of those allowed by the access policy of the role that is being assumed.\n// For more information, see Permissions for AssumeRole, AssumeRoleWithSAML,\n// and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html)\n// in the IAM User Guide.\n//\n// Before your application can call AssumeRoleWithWebIdentity, you must have\n// an identity token from a supported identity provider and create a role that\n// the application can assume. The role that your application assumes must trust\n// the identity provider that is associated with the identity token. In other\n// words, the identity provider must be specified in the role's trust policy.\n//\n//  Calling AssumeRoleWithWebIdentity can result in an entry in your AWS CloudTrail\n// logs. The entry includes the Subject (http://openid.net/specs/openid-connect-core-1_0.html#Claims)\n// of the provided Web Identity Token. We recommend that you avoid using any\n// personally identifiable information (PII) in this field. For example, you\n// could instead use a GUID or a pairwise identifier, as suggested in the OIDC\n// specification (http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes).\n//\n//  For more information about how to use web identity federation and the AssumeRoleWithWebIdentity\n// API, see the following resources:\n//\n//    Using Web Identity Federation APIs for Mobile Apps (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual)\n// and Federation Through a Web-based Identity Provider (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity).\n//\n//     Web Identity Federation Playground (https://web-identity-federation-playground.s3.amazonaws.com/index.html).\n// This interactive website lets you walk through the process of authenticating\n// via Login with Amazon, Facebook, or Google, getting temporary security credentials,\n// and then using those credentials to make a request to AWS.\n//\n//    AWS SDK for iOS (http://aws.amazon.com/sdkforios/) and AWS SDK for Android\n// (http://aws.amazon.com/sdkforandroid/). These toolkits contain sample apps\n// that show how to invoke the identity providers, and then how to use the information\n// from these providers to get and use temporary security credentials.\n//\n//    Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/4617974389850313).\n// This article discusses web identity federation and shows an example of how\n// to use web identity federation to get access to content in Amazon S3.\nfunc (c *STS) AssumeRoleWithWebIdentity(input *AssumeRoleWithWebIdentityInput) (*AssumeRoleWithWebIdentityOutput, error) {\n\treq, out := c.AssumeRoleWithWebIdentityRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opDecodeAuthorizationMessage = \"DecodeAuthorizationMessage\"\n\n// DecodeAuthorizationMessageRequest generates a \"aws/request.Request\" representing the\n// client's request for the DecodeAuthorizationMessage operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DecodeAuthorizationMessage method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the DecodeAuthorizationMessageRequest method.\n//    req, resp := client.DecodeAuthorizationMessageRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessageInput) (req *request.Request, output *DecodeAuthorizationMessageOutput) {\n\top := &request.Operation{\n\t\tName:       opDecodeAuthorizationMessage,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &DecodeAuthorizationMessageInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &DecodeAuthorizationMessageOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Decodes additional information about the authorization status of a request\n// from an encoded message returned in response to an AWS request.\n//\n// For example, if a user is not authorized to perform an action that he or\n// she has requested, the request returns a Client.UnauthorizedOperation response\n// (an HTTP 403 response). Some AWS actions additionally return an encoded message\n// that can provide details about this authorization failure.\n//\n//  Only certain AWS actions return an encoded authorization message. The documentation\n// for an individual action indicates whether that action returns an encoded\n// message in addition to returning an HTTP code.\n//\n//  The message is encoded because the details of the authorization status\n// can constitute privileged information that the user who requested the action\n// should not see. To decode an authorization status message, a user must be\n// granted permissions via an IAM policy to request the DecodeAuthorizationMessage\n// (sts:DecodeAuthorizationMessage) action.\n//\n// The decoded message includes the following type of information:\n//\n//   Whether the request was denied due to an explicit deny or due to the absence\n// of an explicit allow. For more information, see Determining Whether a Request\n// is Allowed or Denied (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow)\n// in the IAM User Guide.\n//\n//   The principal who made the request.\n//\n//   The requested action.\n//\n//   The requested resource.\n//\n//   The values of condition keys in the context of the user's request.\nfunc (c *STS) DecodeAuthorizationMessage(input *DecodeAuthorizationMessageInput) (*DecodeAuthorizationMessageOutput, error) {\n\treq, out := c.DecodeAuthorizationMessageRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opGetCallerIdentity = \"GetCallerIdentity\"\n\n// GetCallerIdentityRequest generates a \"aws/request.Request\" representing the\n// client's request for the GetCallerIdentity operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the GetCallerIdentity method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the GetCallerIdentityRequest method.\n//    req, resp := client.GetCallerIdentityRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *request.Request, output *GetCallerIdentityOutput) {\n\top := &request.Operation{\n\t\tName:       opGetCallerIdentity,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &GetCallerIdentityInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &GetCallerIdentityOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Returns details about the IAM identity whose credentials are used to call\n// the API.\nfunc (c *STS) GetCallerIdentity(input *GetCallerIdentityInput) (*GetCallerIdentityOutput, error) {\n\treq, out := c.GetCallerIdentityRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opGetFederationToken = \"GetFederationToken\"\n\n// GetFederationTokenRequest generates a \"aws/request.Request\" representing the\n// client's request for the GetFederationToken operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the GetFederationToken method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the GetFederationTokenRequest method.\n//    req, resp := client.GetFederationTokenRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *request.Request, output *GetFederationTokenOutput) {\n\top := &request.Operation{\n\t\tName:       opGetFederationToken,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &GetFederationTokenInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &GetFederationTokenOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Returns a set of temporary security credentials (consisting of an access\n// key ID, a secret access key, and a security token) for a federated user.\n// A typical use is in a proxy application that gets temporary security credentials\n// on behalf of distributed applications inside a corporate network. Because\n// you must call the GetFederationToken action using the long-term security\n// credentials of an IAM user, this call is appropriate in contexts where those\n// credentials can be safely stored, usually in a server-based application.\n// For a comparison of GetFederationToken with the other APIs that produce temporary\n// credentials, see Requesting Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)\n// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)\n// in the IAM User Guide.\n//\n//   If you are creating a mobile-based or browser-based app that can authenticate\n// users using a web identity provider like Login with Amazon, Facebook, Google,\n// or an OpenID Connect-compatible identity provider, we recommend that you\n// use Amazon Cognito (http://aws.amazon.com/cognito/) or AssumeRoleWithWebIdentity.\n// For more information, see Federation Through a Web-based Identity Provider\n// (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity).\n//\n//  The GetFederationToken action must be called by using the long-term AWS\n// security credentials of an IAM user. You can also call GetFederationToken\n// using the security credentials of an AWS root account, but we do not recommended\n// it. Instead, we recommend that you create an IAM user for the purpose of\n// the proxy application and then attach a policy to the IAM user that limits\n// federated users to only the actions and resources that they need access to.\n// For more information, see IAM Best Practices (http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)\n// in the IAM User Guide.\n//\n// The temporary security credentials that are obtained by using the long-term\n// credentials of an IAM user are valid for the specified duration, from 900\n// seconds (15 minutes) up to a maximium of 129600 seconds (36 hours). The default\n// is 43200 seconds (12 hours). Temporary credentials that are obtained by using\n// AWS root account credentials have a maximum duration of 3600 seconds (1 hour).\n//\n// The temporary security credentials created by GetFederationToken can be\n// used to make API calls to any AWS service with the following exceptions:\n//\n//   You cannot use these credentials to call any IAM APIs.\n//\n//   You cannot call any STS APIs.\n//\n//    Permissions\n//\n// The permissions for the temporary security credentials returned by GetFederationToken\n// are determined by a combination of the following:\n//\n//   The policy or policies that are attached to the IAM user whose credentials\n// are used to call GetFederationToken.\n//\n//   The policy that is passed as a parameter in the call.\n//\n//   The passed policy is attached to the temporary security credentials that\n// result from the GetFederationToken API call--that is, to the federated user.\n// When the federated user makes an AWS request, AWS evaluates the policy attached\n// to the federated user in combination with the policy or policies attached\n// to the IAM user whose credentials were used to call GetFederationToken. AWS\n// allows the federated user's request only when both the federated user  and\n//  the IAM user are explicitly allowed to perform the requested action. The\n// passed policy cannot grant more permissions than those that are defined in\n// the IAM user policy.\n//\n// A typical use case is that the permissions of the IAM user whose credentials\n// are used to call GetFederationToken are designed to allow access to all the\n// actions and resources that any federated user will need. Then, for individual\n// users, you pass a policy to the operation that scopes down the permissions\n// to a level that's appropriate to that individual user, using a policy that\n// allows only a subset of permissions that are granted to the IAM user.\n//\n// If you do not pass a policy, the resulting temporary security credentials\n// have no effective permissions. The only exception is when the temporary security\n// credentials are used to access a resource that has a resource-based policy\n// that specifically allows the federated user to access the resource.\n//\n// For more information about how permissions work, see Permissions for GetFederationToken\n// (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html).\n// For information about using GetFederationToken to create temporary security\n// credentials, see GetFederationToken—Federation Through a Custom Identity\n// Broker (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken).\nfunc (c *STS) GetFederationToken(input *GetFederationTokenInput) (*GetFederationTokenOutput, error) {\n\treq, out := c.GetFederationTokenRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\nconst opGetSessionToken = \"GetSessionToken\"\n\n// GetSessionTokenRequest generates a \"aws/request.Request\" representing the\n// client's request for the GetSessionToken operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the GetSessionToken method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n//    // Example sending a request using the GetSessionTokenRequest method.\n//    req, resp := client.GetSessionTokenRequest(params)\n//\n//    err := req.Send()\n//    if err == nil { // resp is now filled\n//        fmt.Println(resp)\n//    }\n//\nfunc (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.Request, output *GetSessionTokenOutput) {\n\top := &request.Operation{\n\t\tName:       opGetSessionToken,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath:   \"/\",\n\t}\n\n\tif input == nil {\n\t\tinput = &GetSessionTokenInput{}\n\t}\n\n\treq = c.newRequest(op, input, output)\n\toutput = &GetSessionTokenOutput{}\n\treq.Data = output\n\treturn\n}\n\n// Returns a set of temporary credentials for an AWS account or IAM user. The\n// credentials consist of an access key ID, a secret access key, and a security\n// token. Typically, you use GetSessionToken if you want to use MFA to protect\n// programmatic calls to specific AWS APIs like Amazon EC2 StopInstances. MFA-enabled\n// IAM users would need to call GetSessionToken and submit an MFA code that\n// is associated with their MFA device. Using the temporary security credentials\n// that are returned from the call, IAM users can then make programmatic calls\n// to APIs that require MFA authentication. If you do not supply a correct MFA\n// code, then the API returns an access denied error. For a comparison of GetSessionToken\n// with the other APIs that produce temporary credentials, see Requesting Temporary\n// Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)\n// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)\n// in the IAM User Guide.\n//\n// The GetSessionToken action must be called by using the long-term AWS security\n// credentials of the AWS account or an IAM user. Credentials that are created\n// by IAM users are valid for the duration that you specify, from 900 seconds\n// (15 minutes) up to a maximum of 129600 seconds (36 hours), with a default\n// of 43200 seconds (12 hours); credentials that are created by using account\n// credentials can range from 900 seconds (15 minutes) up to a maximum of 3600\n// seconds (1 hour), with a default of 1 hour.\n//\n// The temporary security credentials created by GetSessionToken can be used\n// to make API calls to any AWS service with the following exceptions:\n//\n//   You cannot call any IAM APIs unless MFA authentication information is\n// included in the request.\n//\n//   You cannot call any STS API except AssumeRole.\n//\n//    We recommend that you do not call GetSessionToken with root account credentials.\n// Instead, follow our best practices (http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users)\n// by creating one or more IAM users, giving them the necessary permissions,\n// and using IAM users for everyday interaction with AWS.\n//\n//  The permissions associated with the temporary security credentials returned\n// by GetSessionToken are based on the permissions associated with account or\n// IAM user whose credentials are used to call the action. If GetSessionToken\n// is called using root account credentials, the temporary credentials have\n// root account permissions. Similarly, if GetSessionToken is called using the\n// credentials of an IAM user, the temporary credentials have the same permissions\n// as the IAM user.\n//\n// For more information about using GetSessionToken to create temporary credentials,\n// go to Temporary Credentials for Users in Untrusted Environments (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken)\n// in the IAM User Guide.\nfunc (c *STS) GetSessionToken(input *GetSessionTokenInput) (*GetSessionTokenOutput, error) {\n\treq, out := c.GetSessionTokenRequest(input)\n\terr := req.Send()\n\treturn out, err\n}\n\ntype AssumeRoleInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The duration, in seconds, of the role session. The value can range from 900\n\t// seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set\n\t// to 3600 seconds.\n\t//\n\t//  This is separate from the duration of a console session that you might\n\t// request using the returned credentials. The request to the federation endpoint\n\t// for a console sign-in token takes a SessionDuration parameter that specifies\n\t// the maximum length of the console session, separately from the DurationSeconds\n\t// parameter on this API. For more information, see Creating a URL that Enables\n\t// Federated Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)\n\t// in the IAM User Guide.\n\tDurationSeconds *int64 `min:\"900\" type:\"integer\"`\n\n\t// A unique identifier that is used by third parties when assuming roles in\n\t// their customers' accounts. For each role that the third party can assume,\n\t// they should instruct their customers to ensure the role's trust policy checks\n\t// for the external ID that the third party generated. Each time the third party\n\t// assumes the role, they should pass the customer's external ID. The external\n\t// ID is useful in order to help third parties bind a role to the customer who\n\t// created it. For more information about the external ID, see How to Use an\n\t// External ID When Granting Access to Your AWS Resources to a Third Party (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html)\n\t// in the IAM User Guide.\n\t//\n\t// The format for this parameter, as described by its regex pattern, is a string\n\t// of characters consisting of upper- and lower-case alphanumeric characters\n\t// with no spaces. You can also include underscores or any of the following\n\t// characters: =,.@:\\/-\n\tExternalId *string `min:\"2\" type:\"string\"`\n\n\t// An IAM policy in JSON format.\n\t//\n\t// This parameter is optional. If you pass a policy, the temporary security\n\t// credentials that are returned by the operation have the permissions that\n\t// are allowed by both (the intersection of) the access policy of the role that\n\t// is being assumed, and the policy that you pass. This gives you a way to further\n\t// restrict the permissions for the resulting temporary security credentials.\n\t// You cannot use the passed policy to grant permissions that are in excess\n\t// of those allowed by the access policy of the role that is being assumed.\n\t// For more information, see Permissions for AssumeRole, AssumeRoleWithSAML,\n\t// and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html)\n\t// in the IAM User Guide.\n\t//\n\t// The format for this parameter, as described by its regex pattern, is a string\n\t// of characters up to 2048 characters in length. The characters can be any\n\t// ASCII character from the space character to the end of the valid character\n\t// list (\\u0020-\\u00FF). It can also include the tab (\\u0009), linefeed (\\u000A),\n\t// and carriage return (\\u000D) characters.\n\t//\n\t//  The policy plain text must be 2048 bytes or shorter. However, an internal\n\t// conversion compresses it into a packed binary format with a separate limit.\n\t// The PackedPolicySize response element indicates by percentage how close to\n\t// the upper size limit the policy is, with 100% equaling the maximum allowed\n\t// size.\n\tPolicy *string `min:\"1\" type:\"string\"`\n\n\t// The Amazon Resource Name (ARN) of the role to assume.\n\tRoleArn *string `min:\"20\" type:\"string\" required:\"true\"`\n\n\t// An identifier for the assumed role session.\n\t//\n\t// Use the role session name to uniquely identify a session when the same role\n\t// is assumed by different principals or for different reasons. In cross-account\n\t// scenarios, the role session name is visible to, and can be logged by the\n\t// account that owns the role. The role session name is also used in the ARN\n\t// of the assumed role principal. This means that subsequent cross-account API\n\t// requests using the temporary security credentials will expose the role session\n\t// name to the external account in their CloudTrail logs.\n\t//\n\t// The format for this parameter, as described by its regex pattern, is a string\n\t// of characters consisting of upper- and lower-case alphanumeric characters\n\t// with no spaces. You can also include underscores or any of the following\n\t// characters: =,.@-\n\tRoleSessionName *string `min:\"2\" type:\"string\" required:\"true\"`\n\n\t// The identification number of the MFA device that is associated with the user\n\t// who is making the AssumeRole call. Specify this value if the trust policy\n\t// of the role being assumed includes a condition that requires MFA authentication.\n\t// The value is either the serial number for a hardware device (such as GAHT12345678)\n\t// or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user).\n\t//\n\t// The format for this parameter, as described by its regex pattern, is a string\n\t// of characters consisting of upper- and lower-case alphanumeric characters\n\t// with no spaces. You can also include underscores or any of the following\n\t// characters: =,.@-\n\tSerialNumber *string `min:\"9\" type:\"string\"`\n\n\t// The value provided by the MFA device, if the trust policy of the role being\n\t// assumed requires MFA (that is, if the policy includes a condition that tests\n\t// for MFA). If the role being assumed requires MFA and if the TokenCode value\n\t// is missing or expired, the AssumeRole call returns an \"access denied\" error.\n\t//\n\t// The format for this parameter, as described by its regex pattern, is a sequence\n\t// of six numeric digits.\n\tTokenCode *string `min:\"6\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s AssumeRoleInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s AssumeRoleInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *AssumeRoleInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"AssumeRoleInput\"}\n\tif s.DurationSeconds != nil && *s.DurationSeconds < 900 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"DurationSeconds\", 900))\n\t}\n\tif s.ExternalId != nil && len(*s.ExternalId) < 2 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ExternalId\", 2))\n\t}\n\tif s.Policy != nil && len(*s.Policy) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Policy\", 1))\n\t}\n\tif s.RoleArn == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"RoleArn\"))\n\t}\n\tif s.RoleArn != nil && len(*s.RoleArn) < 20 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"RoleArn\", 20))\n\t}\n\tif s.RoleSessionName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"RoleSessionName\"))\n\t}\n\tif s.RoleSessionName != nil && len(*s.RoleSessionName) < 2 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"RoleSessionName\", 2))\n\t}\n\tif s.SerialNumber != nil && len(*s.SerialNumber) < 9 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"SerialNumber\", 9))\n\t}\n\tif s.TokenCode != nil && len(*s.TokenCode) < 6 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"TokenCode\", 6))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\n// Contains the response to a successful AssumeRole request, including temporary\n// AWS credentials that can be used to make AWS requests.\ntype AssumeRoleOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers\n\t// that you can use to refer to the resulting temporary security credentials.\n\t// For example, you can reference these credentials as a principal in a resource-based\n\t// policy by using the ARN or assumed role ID. The ARN and ID include the RoleSessionName\n\t// that you specified when you called AssumeRole.\n\tAssumedRoleUser *AssumedRoleUser `type:\"structure\"`\n\n\t// The temporary security credentials, which include an access key ID, a secret\n\t// access key, and a security (or session) token.\n\t//\n\t//  Note: The size of the security token that STS APIs return is not fixed.\n\t// We strongly recommend that you make no assumptions about the maximum size.\n\t// As of this writing, the typical size is less than 4096 bytes, but that can\n\t// vary. Also, future updates to AWS might require larger sizes.\n\tCredentials *Credentials `type:\"structure\"`\n\n\t// A percentage value that indicates the size of the policy in packed form.\n\t// The service rejects any policy with a packed size greater than 100 percent,\n\t// which means the policy exceeded the allowed space.\n\tPackedPolicySize *int64 `type:\"integer\"`\n}\n\n// String returns the string representation\nfunc (s AssumeRoleOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s AssumeRoleOutput) GoString() string {\n\treturn s.String()\n}\n\ntype AssumeRoleWithSAMLInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The duration, in seconds, of the role session. The value can range from 900\n\t// seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set\n\t// to 3600 seconds. An expiration can also be specified in the SAML authentication\n\t// response's SessionNotOnOrAfter value. The actual expiration time is whichever\n\t// value is shorter.\n\t//\n\t//  This is separate from the duration of a console session that you might\n\t// request using the returned credentials. The request to the federation endpoint\n\t// for a console sign-in token takes a SessionDuration parameter that specifies\n\t// the maximum length of the console session, separately from the DurationSeconds\n\t// parameter on this API. For more information, see Enabling SAML 2.0 Federated\n\t// Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-saml.html)\n\t// in the IAM User Guide.\n\tDurationSeconds *int64 `min:\"900\" type:\"integer\"`\n\n\t// An IAM policy in JSON format.\n\t//\n\t// The policy parameter is optional. If you pass a policy, the temporary security\n\t// credentials that are returned by the operation have the permissions that\n\t// are allowed by both the access policy of the role that is being assumed,\n\t//  and  the policy that you pass. This gives you a way to further restrict\n\t// the permissions for the resulting temporary security credentials. You cannot\n\t// use the passed policy to grant permissions that are in excess of those allowed\n\t// by the access policy of the role that is being assumed. For more information,\n\t// Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity\n\t// (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html)\n\t// in the IAM User Guide.\n\t//\n\t// The format for this parameter, as described by its regex pattern, is a string\n\t// of characters up to 2048 characters in length. The characters can be any\n\t// ASCII character from the space character to the end of the valid character\n\t// list (\\u0020-\\u00FF). It can also include the tab (\\u0009), linefeed (\\u000A),\n\t// and carriage return (\\u000D) characters.\n\t//\n\t//  The policy plain text must be 2048 bytes or shorter. However, an internal\n\t// conversion compresses it into a packed binary format with a separate limit.\n\t// The PackedPolicySize response element indicates by percentage how close to\n\t// the upper size limit the policy is, with 100% equaling the maximum allowed\n\t// size.\n\tPolicy *string `min:\"1\" type:\"string\"`\n\n\t// The Amazon Resource Name (ARN) of the SAML provider in IAM that describes\n\t// the IdP.\n\tPrincipalArn *string `min:\"20\" type:\"string\" required:\"true\"`\n\n\t// The Amazon Resource Name (ARN) of the role that the caller is assuming.\n\tRoleArn *string `min:\"20\" type:\"string\" required:\"true\"`\n\n\t// The base-64 encoded SAML authentication response provided by the IdP.\n\t//\n\t// For more information, see Configuring a Relying Party and Adding Claims\n\t// (http://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html)\n\t// in the Using IAM guide.\n\tSAMLAssertion *string `min:\"4\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s AssumeRoleWithSAMLInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s AssumeRoleWithSAMLInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *AssumeRoleWithSAMLInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"AssumeRoleWithSAMLInput\"}\n\tif s.DurationSeconds != nil && *s.DurationSeconds < 900 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"DurationSeconds\", 900))\n\t}\n\tif s.Policy != nil && len(*s.Policy) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Policy\", 1))\n\t}\n\tif s.PrincipalArn == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"PrincipalArn\"))\n\t}\n\tif s.PrincipalArn != nil && len(*s.PrincipalArn) < 20 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"PrincipalArn\", 20))\n\t}\n\tif s.RoleArn == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"RoleArn\"))\n\t}\n\tif s.RoleArn != nil && len(*s.RoleArn) < 20 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"RoleArn\", 20))\n\t}\n\tif s.SAMLAssertion == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"SAMLAssertion\"))\n\t}\n\tif s.SAMLAssertion != nil && len(*s.SAMLAssertion) < 4 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"SAMLAssertion\", 4))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\n// Contains the response to a successful AssumeRoleWithSAML request, including\n// temporary AWS credentials that can be used to make AWS requests.\ntype AssumeRoleWithSAMLOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The identifiers for the temporary security credentials that the operation\n\t// returns.\n\tAssumedRoleUser *AssumedRoleUser `type:\"structure\"`\n\n\t// The value of the Recipient attribute of the SubjectConfirmationData element\n\t// of the SAML assertion.\n\tAudience *string `type:\"string\"`\n\n\t// The temporary security credentials, which include an access key ID, a secret\n\t// access key, and a security (or session) token.\n\t//\n\t//  Note: The size of the security token that STS APIs return is not fixed.\n\t// We strongly recommend that you make no assumptions about the maximum size.\n\t// As of this writing, the typical size is less than 4096 bytes, but that can\n\t// vary. Also, future updates to AWS might require larger sizes.\n\tCredentials *Credentials `type:\"structure\"`\n\n\t// The value of the Issuer element of the SAML assertion.\n\tIssuer *string `type:\"string\"`\n\n\t// A hash value based on the concatenation of the Issuer response value, the\n\t// AWS account ID, and the friendly name (the last part of the ARN) of the SAML\n\t// provider in IAM. The combination of NameQualifier and Subject can be used\n\t// to uniquely identify a federated user.\n\t//\n\t// The following pseudocode shows how the hash value is calculated:\n\t//\n\t//  BASE64 ( SHA1 ( \"https://example.com/saml\" + \"123456789012\" + \"/MySAMLIdP\"\n\t// ) )\n\tNameQualifier *string `type:\"string\"`\n\n\t// A percentage value that indicates the size of the policy in packed form.\n\t// The service rejects any policy with a packed size greater than 100 percent,\n\t// which means the policy exceeded the allowed space.\n\tPackedPolicySize *int64 `type:\"integer\"`\n\n\t// The value of the NameID element in the Subject element of the SAML assertion.\n\tSubject *string `type:\"string\"`\n\n\t// The format of the name ID, as defined by the Format attribute in the NameID\n\t// element of the SAML assertion. Typical examples of the format are transient\n\t// or persistent.\n\t//\n\t//  If the format includes the prefix urn:oasis:names:tc:SAML:2.0:nameid-format,\n\t// that prefix is removed. For example, urn:oasis:names:tc:SAML:2.0:nameid-format:transient\n\t// is returned as transient. If the format includes any other prefix, the format\n\t// is returned with no modifications.\n\tSubjectType *string `type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s AssumeRoleWithSAMLOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s AssumeRoleWithSAMLOutput) GoString() string {\n\treturn s.String()\n}\n\ntype AssumeRoleWithWebIdentityInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The duration, in seconds, of the role session. The value can range from 900\n\t// seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set\n\t// to 3600 seconds.\n\t//\n\t//  This is separate from the duration of a console session that you might\n\t// request using the returned credentials. The request to the federation endpoint\n\t// for a console sign-in token takes a SessionDuration parameter that specifies\n\t// the maximum length of the console session, separately from the DurationSeconds\n\t// parameter on this API. For more information, see Creating a URL that Enables\n\t// Federated Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)\n\t// in the IAM User Guide.\n\tDurationSeconds *int64 `min:\"900\" type:\"integer\"`\n\n\t// An IAM policy in JSON format.\n\t//\n\t// The policy parameter is optional. If you pass a policy, the temporary security\n\t// credentials that are returned by the operation have the permissions that\n\t// are allowed by both the access policy of the role that is being assumed,\n\t//  and  the policy that you pass. This gives you a way to further restrict\n\t// the permissions for the resulting temporary security credentials. You cannot\n\t// use the passed policy to grant permissions that are in excess of those allowed\n\t// by the access policy of the role that is being assumed. For more information,\n\t// see Permissions for AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html)\n\t// in the IAM User Guide.\n\t//\n\t// The format for this parameter, as described by its regex pattern, is a string\n\t// of characters up to 2048 characters in length. The characters can be any\n\t// ASCII character from the space character to the end of the valid character\n\t// list (\\u0020-\\u00FF). It can also include the tab (\\u0009), linefeed (\\u000A),\n\t// and carriage return (\\u000D) characters.\n\t//\n\t//  The policy plain text must be 2048 bytes or shorter. However, an internal\n\t// conversion compresses it into a packed binary format with a separate limit.\n\t// The PackedPolicySize response element indicates by percentage how close to\n\t// the upper size limit the policy is, with 100% equaling the maximum allowed\n\t// size.\n\tPolicy *string `min:\"1\" type:\"string\"`\n\n\t// The fully qualified host component of the domain name of the identity provider.\n\t//\n\t// Specify this value only for OAuth 2.0 access tokens. Currently www.amazon.com\n\t// and graph.facebook.com are the only supported identity providers for OAuth\n\t// 2.0 access tokens. Do not include URL schemes and port numbers.\n\t//\n\t// Do not specify this value for OpenID Connect ID tokens.\n\tProviderId *string `min:\"4\" type:\"string\"`\n\n\t// The Amazon Resource Name (ARN) of the role that the caller is assuming.\n\tRoleArn *string `min:\"20\" type:\"string\" required:\"true\"`\n\n\t// An identifier for the assumed role session. Typically, you pass the name\n\t// or identifier that is associated with the user who is using your application.\n\t// That way, the temporary security credentials that your application will use\n\t// are associated with that user. This session name is included as part of the\n\t// ARN and assumed role ID in the AssumedRoleUser response element.\n\t//\n\t// The format for this parameter, as described by its regex pattern, is a string\n\t// of characters consisting of upper- and lower-case alphanumeric characters\n\t// with no spaces. You can also include underscores or any of the following\n\t// characters: =,.@-\n\tRoleSessionName *string `min:\"2\" type:\"string\" required:\"true\"`\n\n\t// The OAuth 2.0 access token or OpenID Connect ID token that is provided by\n\t// the identity provider. Your application must get this token by authenticating\n\t// the user who is using your application with a web identity provider before\n\t// the application makes an AssumeRoleWithWebIdentity call.\n\tWebIdentityToken *string `min:\"4\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s AssumeRoleWithWebIdentityInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s AssumeRoleWithWebIdentityInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *AssumeRoleWithWebIdentityInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"AssumeRoleWithWebIdentityInput\"}\n\tif s.DurationSeconds != nil && *s.DurationSeconds < 900 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"DurationSeconds\", 900))\n\t}\n\tif s.Policy != nil && len(*s.Policy) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Policy\", 1))\n\t}\n\tif s.ProviderId != nil && len(*s.ProviderId) < 4 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ProviderId\", 4))\n\t}\n\tif s.RoleArn == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"RoleArn\"))\n\t}\n\tif s.RoleArn != nil && len(*s.RoleArn) < 20 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"RoleArn\", 20))\n\t}\n\tif s.RoleSessionName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"RoleSessionName\"))\n\t}\n\tif s.RoleSessionName != nil && len(*s.RoleSessionName) < 2 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"RoleSessionName\", 2))\n\t}\n\tif s.WebIdentityToken == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"WebIdentityToken\"))\n\t}\n\tif s.WebIdentityToken != nil && len(*s.WebIdentityToken) < 4 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"WebIdentityToken\", 4))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\n// Contains the response to a successful AssumeRoleWithWebIdentity request,\n// including temporary AWS credentials that can be used to make AWS requests.\ntype AssumeRoleWithWebIdentityOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers\n\t// that you can use to refer to the resulting temporary security credentials.\n\t// For example, you can reference these credentials as a principal in a resource-based\n\t// policy by using the ARN or assumed role ID. The ARN and ID include the RoleSessionName\n\t// that you specified when you called AssumeRole.\n\tAssumedRoleUser *AssumedRoleUser `type:\"structure\"`\n\n\t// The intended audience (also known as client ID) of the web identity token.\n\t// This is traditionally the client identifier issued to the application that\n\t// requested the web identity token.\n\tAudience *string `type:\"string\"`\n\n\t// The temporary security credentials, which include an access key ID, a secret\n\t// access key, and a security token.\n\t//\n\t//  Note: The size of the security token that STS APIs return is not fixed.\n\t// We strongly recommend that you make no assumptions about the maximum size.\n\t// As of this writing, the typical size is less than 4096 bytes, but that can\n\t// vary. Also, future updates to AWS might require larger sizes.\n\tCredentials *Credentials `type:\"structure\"`\n\n\t// A percentage value that indicates the size of the policy in packed form.\n\t// The service rejects any policy with a packed size greater than 100 percent,\n\t// which means the policy exceeded the allowed space.\n\tPackedPolicySize *int64 `type:\"integer\"`\n\n\t// The issuing authority of the web identity token presented. For OpenID Connect\n\t// ID Tokens this contains the value of the iss field. For OAuth 2.0 access\n\t// tokens, this contains the value of the ProviderId parameter that was passed\n\t// in the AssumeRoleWithWebIdentity request.\n\tProvider *string `type:\"string\"`\n\n\t// The unique user identifier that is returned by the identity provider. This\n\t// identifier is associated with the WebIdentityToken that was submitted with\n\t// the AssumeRoleWithWebIdentity call. The identifier is typically unique to\n\t// the user and the application that acquired the WebIdentityToken (pairwise\n\t// identifier). For OpenID Connect ID tokens, this field contains the value\n\t// returned by the identity provider as the token's sub (Subject) claim.\n\tSubjectFromWebIdentityToken *string `min:\"6\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s AssumeRoleWithWebIdentityOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s AssumeRoleWithWebIdentityOutput) GoString() string {\n\treturn s.String()\n}\n\n// The identifiers for the temporary security credentials that the operation\n// returns.\ntype AssumedRoleUser struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The ARN of the temporary security credentials that are returned from the\n\t// AssumeRole action. For more information about ARNs and how to use them in\n\t// policies, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)\n\t// in Using IAM.\n\tArn *string `min:\"20\" type:\"string\" required:\"true\"`\n\n\t// A unique identifier that contains the role ID and the role session name of\n\t// the role that is being assumed. The role ID is generated by AWS when the\n\t// role is created.\n\tAssumedRoleId *string `min:\"2\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s AssumedRoleUser) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s AssumedRoleUser) GoString() string {\n\treturn s.String()\n}\n\n// AWS credentials for API authentication.\ntype Credentials struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The access key ID that identifies the temporary security credentials.\n\tAccessKeyId *string `min:\"16\" type:\"string\" required:\"true\"`\n\n\t// The date on which the current credentials expire.\n\tExpiration *time.Time `type:\"timestamp\" timestampFormat:\"iso8601\" required:\"true\"`\n\n\t// The secret access key that can be used to sign requests.\n\tSecretAccessKey *string `type:\"string\" required:\"true\"`\n\n\t// The token that users must pass to the service API to use the temporary credentials.\n\tSessionToken *string `type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s Credentials) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s Credentials) GoString() string {\n\treturn s.String()\n}\n\ntype DecodeAuthorizationMessageInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The encoded message that was returned with the response.\n\tEncodedMessage *string `min:\"1\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s DecodeAuthorizationMessageInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DecodeAuthorizationMessageInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *DecodeAuthorizationMessageInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DecodeAuthorizationMessageInput\"}\n\tif s.EncodedMessage == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"EncodedMessage\"))\n\t}\n\tif s.EncodedMessage != nil && len(*s.EncodedMessage) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"EncodedMessage\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\n// A document that contains additional information about the authorization status\n// of a request from an encoded message that is returned in response to an AWS\n// request.\ntype DecodeAuthorizationMessageOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// An XML document that contains the decoded message.\n\tDecodedMessage *string `type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s DecodeAuthorizationMessageOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DecodeAuthorizationMessageOutput) GoString() string {\n\treturn s.String()\n}\n\n// Identifiers for the federated user that is associated with the credentials.\ntype FederatedUser struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The ARN that specifies the federated user that is associated with the credentials.\n\t// For more information about ARNs and how to use them in policies, see IAM\n\t// Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)\n\t// in Using IAM.\n\tArn *string `min:\"20\" type:\"string\" required:\"true\"`\n\n\t// The string that identifies the federated user associated with the credentials,\n\t// similar to the unique ID of an IAM user.\n\tFederatedUserId *string `min:\"2\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s FederatedUser) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s FederatedUser) GoString() string {\n\treturn s.String()\n}\n\ntype GetCallerIdentityInput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s GetCallerIdentityInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s GetCallerIdentityInput) GoString() string {\n\treturn s.String()\n}\n\n// Contains the response to a successful GetCallerIdentity request, including\n// information about the entity making the request.\ntype GetCallerIdentityOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The AWS account ID number of the account that owns or contains the calling\n\t// entity.\n\tAccount *string `type:\"string\"`\n\n\t// The AWS ARN associated with the calling entity.\n\tArn *string `min:\"20\" type:\"string\"`\n\n\t// The unique identifier of the calling entity. The exact value depends on the\n\t// type of entity making the call. The values returned are those listed in the\n\t// aws:userid column in the Principal table (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable)\n\t// found on the Policy Variables reference page in the IAM User Guide.\n\tUserId *string `type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s GetCallerIdentityOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s GetCallerIdentityOutput) GoString() string {\n\treturn s.String()\n}\n\ntype GetFederationTokenInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The duration, in seconds, that the session should last. Acceptable durations\n\t// for federation sessions range from 900 seconds (15 minutes) to 129600 seconds\n\t// (36 hours), with 43200 seconds (12 hours) as the default. Sessions obtained\n\t// using AWS account (root) credentials are restricted to a maximum of 3600\n\t// seconds (one hour). If the specified duration is longer than one hour, the\n\t// session obtained by using AWS account (root) credentials defaults to one\n\t// hour.\n\tDurationSeconds *int64 `min:\"900\" type:\"integer\"`\n\n\t// The name of the federated user. The name is used as an identifier for the\n\t// temporary security credentials (such as Bob). For example, you can reference\n\t// the federated user name in a resource-based policy, such as in an Amazon\n\t// S3 bucket policy.\n\t//\n\t// The format for this parameter, as described by its regex pattern, is a string\n\t// of characters consisting of upper- and lower-case alphanumeric characters\n\t// with no spaces. You can also include underscores or any of the following\n\t// characters: =,.@-\n\tName *string `min:\"2\" type:\"string\" required:\"true\"`\n\n\t// An IAM policy in JSON format that is passed with the GetFederationToken call\n\t// and evaluated along with the policy or policies that are attached to the\n\t// IAM user whose credentials are used to call GetFederationToken. The passed\n\t// policy is used to scope down the permissions that are available to the IAM\n\t// user, by allowing only a subset of the permissions that are granted to the\n\t// IAM user. The passed policy cannot grant more permissions than those granted\n\t// to the IAM user. The final permissions for the federated user are the most\n\t// restrictive set based on the intersection of the passed policy and the IAM\n\t// user policy.\n\t//\n\t// If you do not pass a policy, the resulting temporary security credentials\n\t// have no effective permissions. The only exception is when the temporary security\n\t// credentials are used to access a resource that has a resource-based policy\n\t// that specifically allows the federated user to access the resource.\n\t//\n\t// The format for this parameter, as described by its regex pattern, is a string\n\t// of characters up to 2048 characters in length. The characters can be any\n\t// ASCII character from the space character to the end of the valid character\n\t// list (\\u0020-\\u00FF). It can also include the tab (\\u0009), linefeed (\\u000A),\n\t// and carriage return (\\u000D) characters.\n\t//\n\t//  The policy plain text must be 2048 bytes or shorter. However, an internal\n\t// conversion compresses it into a packed binary format with a separate limit.\n\t// The PackedPolicySize response element indicates by percentage how close to\n\t// the upper size limit the policy is, with 100% equaling the maximum allowed\n\t// size.\n\t//\n\t//  For more information about how permissions work, see Permissions for GetFederationToken\n\t// (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html).\n\tPolicy *string `min:\"1\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s GetFederationTokenInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s GetFederationTokenInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *GetFederationTokenInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"GetFederationTokenInput\"}\n\tif s.DurationSeconds != nil && *s.DurationSeconds < 900 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"DurationSeconds\", 900))\n\t}\n\tif s.Name == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Name\"))\n\t}\n\tif s.Name != nil && len(*s.Name) < 2 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Name\", 2))\n\t}\n\tif s.Policy != nil && len(*s.Policy) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Policy\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\n// Contains the response to a successful GetFederationToken request, including\n// temporary AWS credentials that can be used to make AWS requests.\ntype GetFederationTokenOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The temporary security credentials, which include an access key ID, a secret\n\t// access key, and a security (or session) token.\n\t//\n\t//  Note: The size of the security token that STS APIs return is not fixed.\n\t// We strongly recommend that you make no assumptions about the maximum size.\n\t// As of this writing, the typical size is less than 4096 bytes, but that can\n\t// vary. Also, future updates to AWS might require larger sizes.\n\tCredentials *Credentials `type:\"structure\"`\n\n\t// Identifiers for the federated user associated with the credentials (such\n\t// as arn:aws:sts::123456789012:federated-user/Bob or 123456789012:Bob). You\n\t// can use the federated user's ARN in your resource-based policies, such as\n\t// an Amazon S3 bucket policy.\n\tFederatedUser *FederatedUser `type:\"structure\"`\n\n\t// A percentage value indicating the size of the policy in packed form. The\n\t// service rejects policies for which the packed size is greater than 100 percent\n\t// of the allowed value.\n\tPackedPolicySize *int64 `type:\"integer\"`\n}\n\n// String returns the string representation\nfunc (s GetFederationTokenOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s GetFederationTokenOutput) GoString() string {\n\treturn s.String()\n}\n\ntype GetSessionTokenInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The duration, in seconds, that the credentials should remain valid. Acceptable\n\t// durations for IAM user sessions range from 900 seconds (15 minutes) to 129600\n\t// seconds (36 hours), with 43200 seconds (12 hours) as the default. Sessions\n\t// for AWS account owners are restricted to a maximum of 3600 seconds (one hour).\n\t// If the duration is longer than one hour, the session for AWS account owners\n\t// defaults to one hour.\n\tDurationSeconds *int64 `min:\"900\" type:\"integer\"`\n\n\t// The identification number of the MFA device that is associated with the IAM\n\t// user who is making the GetSessionToken call. Specify this value if the IAM\n\t// user has a policy that requires MFA authentication. The value is either the\n\t// serial number for a hardware device (such as GAHT12345678) or an Amazon Resource\n\t// Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user).\n\t// You can find the device for an IAM user by going to the AWS Management Console\n\t// and viewing the user's security credentials.\n\t//\n\t// The format for this parameter, as described by its regex pattern, is a string\n\t// of characters consisting of upper- and lower-case alphanumeric characters\n\t// with no spaces. You can also include underscores or any of the following\n\t// characters: =,.@-\n\tSerialNumber *string `min:\"9\" type:\"string\"`\n\n\t// The value provided by the MFA device, if MFA is required. If any policy requires\n\t// the IAM user to submit an MFA code, specify this value. If MFA authentication\n\t// is required, and the user does not provide a code when requesting a set of\n\t// temporary security credentials, the user will receive an \"access denied\"\n\t// response when requesting resources that require MFA authentication.\n\t//\n\t// The format for this parameter, as described by its regex pattern, is a sequence\n\t// of six numeric digits.\n\tTokenCode *string `min:\"6\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s GetSessionTokenInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s GetSessionTokenInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *GetSessionTokenInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"GetSessionTokenInput\"}\n\tif s.DurationSeconds != nil && *s.DurationSeconds < 900 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"DurationSeconds\", 900))\n\t}\n\tif s.SerialNumber != nil && len(*s.SerialNumber) < 9 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"SerialNumber\", 9))\n\t}\n\tif s.TokenCode != nil && len(*s.TokenCode) < 6 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"TokenCode\", 6))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\n// Contains the response to a successful GetSessionToken request, including\n// temporary AWS credentials that can be used to make AWS requests.\ntype GetSessionTokenOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The temporary security credentials, which include an access key ID, a secret\n\t// access key, and a security (or session) token.\n\t//\n\t//  Note: The size of the security token that STS APIs return is not fixed.\n\t// We strongly recommend that you make no assumptions about the maximum size.\n\t// As of this writing, the typical size is less than 4096 bytes, but that can\n\t// vary. Also, future updates to AWS might require larger sizes.\n\tCredentials *Credentials `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s GetSessionTokenOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s GetSessionTokenOutput) GoString() string {\n\treturn s.String()\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go",
    "content": "package sts\n\nimport \"github.com/aws/aws-sdk-go/aws/request\"\n\nfunc init() {\n\tinitRequest = func(r *request.Request) {\n\t\tswitch r.Operation.Name {\n\t\tcase opAssumeRoleWithSAML, opAssumeRoleWithWebIdentity:\n\t\t\tr.Handlers.Sign.Clear() // these operations are unsigned\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/aws/aws-sdk-go/service/sts/service.go",
    "content": "// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n\npackage sts\n\nimport (\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/client\"\n\t\"github.com/aws/aws-sdk-go/aws/client/metadata\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n\t\"github.com/aws/aws-sdk-go/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go/private/protocol/query\"\n)\n\n// The AWS Security Token Service (STS) is a web service that enables you to\n// request temporary, limited-privilege credentials for AWS Identity and Access\n// Management (IAM) users or for users that you authenticate (federated users).\n// This guide provides descriptions of the STS API. For more detailed information\n// about using this service, go to Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html).\n//\n//   As an alternative to using the API, you can use one of the AWS SDKs, which\n// consist of libraries and sample code for various programming languages and\n// platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient\n// way to create programmatic access to STS. For example, the SDKs take care\n// of cryptographically signing requests, managing errors, and retrying requests\n// automatically. For information about the AWS SDKs, including how to download\n// and install them, see the Tools for Amazon Web Services page (http://aws.amazon.com/tools/).\n//\n//  For information about setting up signatures and authorization through the\n// API, go to Signing AWS API Requests (http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html)\n// in the AWS General Reference. For general information about the Query API,\n// go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html)\n// in Using IAM. For information about using security tokens with other AWS\n// products, go to AWS Services That Work with IAM (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html)\n// in the IAM User Guide.\n//\n// If you're new to AWS and need additional technical information about a specific\n// AWS product, you can find the product's technical documentation at http://aws.amazon.com/documentation/\n// (http://aws.amazon.com/documentation/).\n//\n//  Endpoints\n//\n// The AWS Security Token Service (STS) has a default endpoint of https://sts.amazonaws.com\n// that maps to the US East (N. Virginia) region. Additional regions are available\n// and are activated by default. For more information, see Activating and Deactivating\n// AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)\n// in the IAM User Guide.\n//\n// For information about STS endpoints, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#sts_region)\n// in the AWS General Reference.\n//\n//  Recording API requests\n//\n// STS supports AWS CloudTrail, which is a service that records AWS calls for\n// your AWS account and delivers log files to an Amazon S3 bucket. By using\n// information collected by CloudTrail, you can determine what requests were\n// successfully made to STS, who made the request, when it was made, and so\n// on. To learn more about CloudTrail, including how to turn it on and find\n// your log files, see the AWS CloudTrail User Guide (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html).\n//The service client's operations are safe to be used concurrently.\n// It is not safe to mutate any of the client's properties though.\ntype STS struct {\n\t*client.Client\n}\n\n// Used for custom client initialization logic\nvar initClient func(*client.Client)\n\n// Used for custom request initialization logic\nvar initRequest func(*request.Request)\n\n// A ServiceName is the name of the service the client will make API calls to.\nconst ServiceName = \"sts\"\n\n// New creates a new instance of the STS client with a session.\n// If additional configuration is needed for the client instance use the optional\n// aws.Config parameter to add your extra config.\n//\n// Example:\n//     // Create a STS client from just a session.\n//     svc := sts.New(mySession)\n//\n//     // Create a STS client with additional configuration\n//     svc := sts.New(mySession, aws.NewConfig().WithRegion(\"us-west-2\"))\nfunc New(p client.ConfigProvider, cfgs ...*aws.Config) *STS {\n\tc := p.ClientConfig(ServiceName, cfgs...)\n\treturn newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)\n}\n\n// newClient creates, initializes and returns a new service client instance.\nfunc newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *STS {\n\tsvc := &STS{\n\t\tClient: client.New(\n\t\t\tcfg,\n\t\t\tmetadata.ClientInfo{\n\t\t\t\tServiceName:   ServiceName,\n\t\t\t\tSigningRegion: signingRegion,\n\t\t\t\tEndpoint:      endpoint,\n\t\t\t\tAPIVersion:    \"2011-06-15\",\n\t\t\t},\n\t\t\thandlers,\n\t\t),\n\t}\n\n\t// Handlers\n\tsvc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)\n\tsvc.Handlers.Build.PushBackNamed(query.BuildHandler)\n\tsvc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler)\n\tsvc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler)\n\tsvc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler)\n\n\t// Run custom client initialization if present\n\tif initClient != nil {\n\t\tinitClient(svc.Client)\n\t}\n\n\treturn svc\n}\n\n// newRequest creates a new request for a STS operation and runs any\n// custom request initialization.\nfunc (c *STS) newRequest(op *request.Operation, params, data interface{}) *request.Request {\n\treq := c.NewRequest(op, params, data)\n\n\t// Run custom request initialization if present\n\tif initRequest != nil {\n\t\tinitRequest(req)\n\t}\n\n\treturn req\n}\n"
  },
  {
    "path": "vendor/github.com/coreos/go-systemd/LICENSE",
    "content": "Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and\ndistribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright\nowner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities\nthat control, are controlled by, or are under common control with that entity.\nFor the purposes of this definition, \"control\" means (i) the power, direct or\nindirect, to cause the direction or management of such entity, whether by\ncontract or otherwise, or (ii) ownership of fifty percent (50%) or more of the\noutstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising\npermissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including\nbut not limited to software source code, documentation source, and configuration\nfiles.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or\ntranslation of a Source form, including but not limited to compiled object code,\ngenerated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made\navailable under the License, as indicated by a copyright notice that is included\nin or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that\nis based on (or derived from) the Work and for which the editorial revisions,\nannotations, elaborations, or other modifications represent, as a whole, an\noriginal work of authorship. For the purposes of this License, Derivative Works\nshall not include works that remain separable from, or merely link (or bind by\nname) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version\nof the Work and any modifications or additions to that Work or Derivative Works\nthereof, that is intentionally submitted to Licensor for inclusion in the Work\nby the copyright owner or by an individual or Legal Entity authorized to submit\non behalf of the copyright owner. For the purposes of this definition,\n\"submitted\" means any form of electronic, verbal, or written communication sent\nto the Licensor or its representatives, including but not limited to\ncommunication on electronic mailing lists, source code control systems, and\nissue tracking systems that are managed by, or on behalf of, the Licensor for\nthe purpose of discussing and improving the Work, but excluding communication\nthat is conspicuously marked or otherwise designated in writing by the copyright\nowner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf\nof whom a Contribution has been received by Licensor and subsequently\nincorporated within the Work.\n\n2. Grant of Copyright License.\n\nSubject to the terms and conditions of this License, each Contributor hereby\ngrants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,\nirrevocable copyright license to reproduce, prepare Derivative Works of,\npublicly display, publicly perform, sublicense, and distribute the Work and such\nDerivative Works in Source or Object form.\n\n3. Grant of Patent License.\n\nSubject to the terms and conditions of this License, each Contributor hereby\ngrants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,\nirrevocable (except as stated in this section) patent license to make, have\nmade, use, offer to sell, sell, import, and otherwise transfer the Work, where\nsuch license applies only to those patent claims licensable by such Contributor\nthat are necessarily infringed by their Contribution(s) alone or by combination\nof their Contribution(s) with the Work to which such Contribution(s) was\nsubmitted. If You institute patent litigation against any entity (including a\ncross-claim or counterclaim in a lawsuit) alleging that the Work or a\nContribution incorporated within the Work constitutes direct or contributory\npatent infringement, then any patent licenses granted to You under this License\nfor that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution.\n\nYou may reproduce and distribute copies of the Work or Derivative Works thereof\nin any medium, with or without modifications, and in Source or Object form,\nprovided that You meet the following conditions:\n\nYou must give any other recipients of the Work or Derivative Works a copy of\nthis License; and\nYou must cause any modified files to carry prominent notices stating that You\nchanged the files; and\nYou must retain, in the Source form of any Derivative Works that You distribute,\nall copyright, patent, trademark, and attribution notices from the Source form\nof the Work, excluding those notices that do not pertain to any part of the\nDerivative Works; and\nIf the Work includes a \"NOTICE\" text file as part of its distribution, then any\nDerivative Works that You distribute must include a readable copy of the\nattribution notices contained within such NOTICE file, excluding those notices\nthat do not pertain to any part of the Derivative Works, in at least one of the\nfollowing places: within a NOTICE text file distributed as part of the\nDerivative Works; within the Source form or documentation, if provided along\nwith the Derivative Works; or, within a display generated by the Derivative\nWorks, if and wherever such third-party notices normally appear. The contents of\nthe NOTICE file are for informational purposes only and do not modify the\nLicense. You may add Your own attribution notices within Derivative Works that\nYou distribute, alongside or as an addendum to the NOTICE text from the Work,\nprovided that such additional attribution notices cannot be construed as\nmodifying the License.\nYou may add Your own copyright statement to Your modifications and may provide\nadditional or different license terms and conditions for use, reproduction, or\ndistribution of Your modifications, or for any such Derivative Works as a whole,\nprovided Your use, reproduction, and distribution of the Work otherwise complies\nwith the conditions stated in this License.\n\n5. Submission of Contributions.\n\nUnless You explicitly state otherwise, any Contribution intentionally submitted\nfor inclusion in the Work by You to the Licensor shall be under the terms and\nconditions of this License, without any additional terms or conditions.\nNotwithstanding the above, nothing herein shall supersede or modify the terms of\nany separate license agreement you may have executed with Licensor regarding\nsuch Contributions.\n\n6. Trademarks.\n\nThis License does not grant permission to use the trade names, trademarks,\nservice marks, or product names of the Licensor, except as required for\nreasonable and customary use in describing the origin of the Work and\nreproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty.\n\nUnless required by applicable law or agreed to in writing, Licensor provides the\nWork (and each Contributor provides its Contributions) on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,\nincluding, without limitation, any warranties or conditions of TITLE,\nNON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are\nsolely responsible for determining the appropriateness of using or\nredistributing the Work and assume any risks associated with Your exercise of\npermissions under this License.\n\n8. Limitation of Liability.\n\nIn no event and under no legal theory, whether in tort (including negligence),\ncontract, or otherwise, unless required by applicable law (such as deliberate\nand grossly negligent acts) or agreed to in writing, shall any Contributor be\nliable to You for damages, including any direct, indirect, special, incidental,\nor consequential damages of any character arising as a result of this License or\nout of the use or inability to use the Work (including but not limited to\ndamages for loss of goodwill, work stoppage, computer failure or malfunction, or\nany and all other commercial damages or losses), even if such Contributor has\nbeen advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability.\n\nWhile redistributing the Work or Derivative Works thereof, You may choose to\noffer, and charge a fee for, acceptance of support, warranty, indemnity, or\nother liability obligations and/or rights consistent with this License. However,\nin accepting such obligations, You may act only on Your own behalf and on Your\nsole responsibility, not on behalf of any other Contributor, and only if You\nagree to indemnify, defend, and hold each Contributor harmless for any liability\nincurred by, or claims asserted against, such Contributor by reason of your\naccepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work\n\nTo apply the Apache License to your work, attach the following boilerplate\nnotice, with the fields enclosed by brackets \"[]\" replaced with your own\nidentifying information. (Don't include the brackets!) The text should be\nenclosed in the appropriate comment syntax for the file format. We also\nrecommend that a file or class name and description of purpose be included on\nthe same \"printed page\" as the copyright notice for easier identification within\nthird-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/coreos/go-systemd/sdjournal/functions.go",
    "content": "// Copyright 2015 RedHat, Inc.\n// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage sdjournal\n\nimport (\n\t\"github.com/coreos/pkg/dlopen\"\n\t\"sync\"\n\t\"unsafe\"\n)\n\nvar (\n\t// lazy initialized\n\tlibsystemdHandle *dlopen.LibHandle\n\n\tlibsystemdMutex     = &sync.Mutex{}\n\tlibsystemdFunctions = map[string]unsafe.Pointer{}\n\tlibsystemdNames     = []string{\n\t\t// systemd < 209\n\t\t\"libsystemd-journal.so.0\",\n\t\t\"libsystemd-journal.so\",\n\n\t\t// systemd >= 209 merged libsystemd-journal into libsystemd proper\n\t\t\"libsystemd.so.0\",\n\t\t\"libsystemd.so\",\n\t}\n)\n\nfunc getFunction(name string) (unsafe.Pointer, error) {\n\tlibsystemdMutex.Lock()\n\tdefer libsystemdMutex.Unlock()\n\n\tif libsystemdHandle == nil {\n\t\th, err := dlopen.GetHandle(libsystemdNames)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tlibsystemdHandle = h\n\t}\n\n\tf, ok := libsystemdFunctions[name]\n\tif !ok {\n\t\tvar err error\n\t\tf, err = libsystemdHandle.GetSymbolPointer(name)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tlibsystemdFunctions[name] = f\n\t}\n\n\treturn f, nil\n}\n"
  },
  {
    "path": "vendor/github.com/coreos/go-systemd/sdjournal/journal.go",
    "content": "// Copyright 2015 RedHat, Inc.\n// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Package sdjournal provides a low-level Go interface to the\n// systemd journal wrapped around the sd-journal C API.\n//\n// All public read methods map closely to the sd-journal API functions. See the\n// sd-journal.h documentation[1] for information about each function.\n//\n// To write to the journal, see the pure-Go \"journal\" package\n//\n// [1] http://www.freedesktop.org/software/systemd/man/sd-journal.html\npackage sdjournal\n\n// #include <systemd/sd-journal.h>\n// #include <systemd/sd-id128.h>\n// #include <stdlib.h>\n// #include <syslog.h>\n//\n// int\n// my_sd_journal_open(void *f, sd_journal **ret, int flags)\n// {\n//   int (*sd_journal_open)(sd_journal **, int);\n//\n//   sd_journal_open = f;\n//   return sd_journal_open(ret, flags);\n// }\n//\n// int\n// my_sd_journal_open_directory(void *f, sd_journal **ret, const char *path, int flags)\n// {\n//   int (*sd_journal_open_directory)(sd_journal **, const char *, int);\n//\n//   sd_journal_open_directory = f;\n//   return sd_journal_open_directory(ret, path, flags);\n// }\n//\n// void\n// my_sd_journal_close(void *f, sd_journal *j)\n// {\n//   int (*sd_journal_close)(sd_journal *);\n//\n//   sd_journal_close = f;\n//   sd_journal_close(j);\n// }\n//\n// int\n// my_sd_journal_get_usage(void *f, sd_journal *j, uint64_t *bytes)\n// {\n//   int (*sd_journal_get_usage)(sd_journal *, uint64_t *);\n//\n//   sd_journal_get_usage = f;\n//   return sd_journal_get_usage(j, bytes);\n// }\n//\n// int\n// my_sd_journal_add_match(void *f, sd_journal *j, const void *data, size_t size)\n// {\n//   int (*sd_journal_add_match)(sd_journal *, const void *, size_t);\n//\n//   sd_journal_add_match = f;\n//   return sd_journal_add_match(j, data, size);\n// }\n//\n// int\n// my_sd_journal_add_disjunction(void *f, sd_journal *j)\n// {\n//   int (*sd_journal_add_disjunction)(sd_journal *);\n//\n//   sd_journal_add_disjunction = f;\n//   return sd_journal_add_disjunction(j);\n// }\n//\n// int\n// my_sd_journal_add_conjunction(void *f, sd_journal *j)\n// {\n//   int (*sd_journal_add_conjunction)(sd_journal *);\n//\n//   sd_journal_add_conjunction = f;\n//   return sd_journal_add_conjunction(j);\n// }\n//\n// void\n// my_sd_journal_flush_matches(void *f, sd_journal *j)\n// {\n//   int (*sd_journal_flush_matches)(sd_journal *);\n//\n//   sd_journal_flush_matches = f;\n//   sd_journal_flush_matches(j);\n// }\n//\n// int\n// my_sd_journal_next(void *f, sd_journal *j)\n// {\n//   int (*sd_journal_next)(sd_journal *);\n//\n//   sd_journal_next = f;\n//   return sd_journal_next(j);\n// }\n//\n// int\n// my_sd_journal_next_skip(void *f, sd_journal *j, uint64_t skip)\n// {\n//   int (*sd_journal_next_skip)(sd_journal *, uint64_t);\n//\n//   sd_journal_next_skip = f;\n//   return sd_journal_next_skip(j, skip);\n// }\n//\n// int\n// my_sd_journal_previous(void *f, sd_journal *j)\n// {\n//   int (*sd_journal_previous)(sd_journal *);\n//\n//   sd_journal_previous = f;\n//   return sd_journal_previous(j);\n// }\n//\n// int\n// my_sd_journal_previous_skip(void *f, sd_journal *j, uint64_t skip)\n// {\n//   int (*sd_journal_previous_skip)(sd_journal *, uint64_t);\n//\n//   sd_journal_previous_skip = f;\n//   return sd_journal_previous_skip(j, skip);\n// }\n//\n// int\n// my_sd_journal_get_data(void *f, sd_journal *j, const char *field, const void **data, size_t *length)\n// {\n//   int (*sd_journal_get_data)(sd_journal *, const char *, const void **, size_t *);\n//\n//   sd_journal_get_data = f;\n//   return sd_journal_get_data(j, field, data, length);\n// }\n//\n// int\n// my_sd_journal_set_data_threshold(void *f, sd_journal *j, size_t sz)\n// {\n//   int (*sd_journal_set_data_threshold)(sd_journal *, size_t);\n//\n//   sd_journal_set_data_threshold = f;\n//   return sd_journal_set_data_threshold(j, sz);\n// }\n//\n// int\n// my_sd_journal_get_cursor(void *f, sd_journal *j, char **cursor)\n// {\n//   int (*sd_journal_get_cursor)(sd_journal *, char **);\n//\n//   sd_journal_get_cursor = f;\n//   return sd_journal_get_cursor(j, cursor);\n// }\n//\n// int\n// my_sd_journal_test_cursor(void *f, sd_journal *j, const char *cursor)\n// {\n//   int (*sd_journal_test_cursor)(sd_journal *, const char *);\n//\n//   sd_journal_test_cursor = f;\n//   return sd_journal_test_cursor(j, cursor);\n// }\n//\n// int\n// my_sd_journal_get_realtime_usec(void *f, sd_journal *j, uint64_t *usec)\n// {\n//   int (*sd_journal_get_realtime_usec)(sd_journal *, uint64_t *);\n//\n//   sd_journal_get_realtime_usec = f;\n//   return sd_journal_get_realtime_usec(j, usec);\n// }\n//\n// int\n// my_sd_journal_get_monotonic_usec(void *f, sd_journal *j, uint64_t *usec, sd_id128_t *boot_id)\n// {\n//   int (*sd_journal_get_monotonic_usec)(sd_journal *, uint64_t *, sd_id128_t *);\n//\n//   sd_journal_get_monotonic_usec = f;\n//   return sd_journal_get_monotonic_usec(j, usec, boot_id);\n// }\n//\n// int\n// my_sd_journal_seek_head(void *f, sd_journal *j)\n// {\n//   int (*sd_journal_seek_head)(sd_journal *);\n//\n//   sd_journal_seek_head = f;\n//   return sd_journal_seek_head(j);\n// }\n//\n// int\n// my_sd_journal_seek_tail(void *f, sd_journal *j)\n// {\n//   int (*sd_journal_seek_tail)(sd_journal *);\n//\n//   sd_journal_seek_tail = f;\n//   return sd_journal_seek_tail(j);\n// }\n//\n//\n// int\n// my_sd_journal_seek_cursor(void *f, sd_journal *j, const char *cursor)\n// {\n//   int (*sd_journal_seek_cursor)(sd_journal *, const char *);\n//\n//   sd_journal_seek_cursor = f;\n//   return sd_journal_seek_cursor(j, cursor);\n// }\n//\n// int\n// my_sd_journal_seek_realtime_usec(void *f, sd_journal *j, uint64_t usec)\n// {\n//   int (*sd_journal_seek_realtime_usec)(sd_journal *, uint64_t);\n//\n//   sd_journal_seek_realtime_usec = f;\n//   return sd_journal_seek_realtime_usec(j, usec);\n// }\n//\n// int\n// my_sd_journal_wait(void *f, sd_journal *j, uint64_t timeout_usec)\n// {\n//   int (*sd_journal_wait)(sd_journal *, uint64_t);\n//\n//   sd_journal_wait = f;\n//   return sd_journal_wait(j, timeout_usec);\n// }\n//\n// void\n// my_sd_journal_restart_data(void *f, sd_journal *j)\n// {\n//   void (*sd_journal_restart_data)(sd_journal *);\n//\n//   sd_journal_restart_data = f;\n//   sd_journal_restart_data(j);\n// }\n//\n// int\n// my_sd_journal_enumerate_data(void *f, sd_journal *j, const void **data, size_t *length)\n// {\n//   int (*sd_journal_enumerate_data)(sd_journal *, const void **, size_t *);\n//\n//   sd_journal_enumerate_data = f;\n//   return sd_journal_enumerate_data(j, data, length);\n// }\n//\nimport \"C\"\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"strings\"\n\t\"sync\"\n\t\"syscall\"\n\t\"time\"\n\t\"unsafe\"\n)\n\n// Journal entry field strings which correspond to:\n// http://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html\nconst (\n\t// User Journal Fields\n\tSD_JOURNAL_FIELD_MESSAGE           = \"MESSAGE\"\n\tSD_JOURNAL_FIELD_MESSAGE_ID        = \"MESSAGE_ID\"\n\tSD_JOURNAL_FIELD_PRIORITY          = \"PRIORITY\"\n\tSD_JOURNAL_FIELD_CODE_FILE         = \"CODE_FILE\"\n\tSD_JOURNAL_FIELD_CODE_LINE         = \"CODE_LINE\"\n\tSD_JOURNAL_FIELD_CODE_FUNC         = \"CODE_FUNC\"\n\tSD_JOURNAL_FIELD_ERRNO             = \"ERRNO\"\n\tSD_JOURNAL_FIELD_SYSLOG_FACILITY   = \"SYSLOG_FACILITY\"\n\tSD_JOURNAL_FIELD_SYSLOG_IDENTIFIER = \"SYSLOG_IDENTIFIER\"\n\tSD_JOURNAL_FIELD_SYSLOG_PID        = \"SYSLOG_PID\"\n\n\t// Trusted Journal Fields\n\tSD_JOURNAL_FIELD_PID                       = \"_PID\"\n\tSD_JOURNAL_FIELD_UID                       = \"_UID\"\n\tSD_JOURNAL_FIELD_GID                       = \"_GID\"\n\tSD_JOURNAL_FIELD_COMM                      = \"_COMM\"\n\tSD_JOURNAL_FIELD_EXE                       = \"_EXE\"\n\tSD_JOURNAL_FIELD_CMDLINE                   = \"_CMDLINE\"\n\tSD_JOURNAL_FIELD_CAP_EFFECTIVE             = \"_CAP_EFFECTIVE\"\n\tSD_JOURNAL_FIELD_AUDIT_SESSION             = \"_AUDIT_SESSION\"\n\tSD_JOURNAL_FIELD_AUDIT_LOGINUID            = \"_AUDIT_LOGINUID\"\n\tSD_JOURNAL_FIELD_SYSTEMD_CGROUP            = \"_SYSTEMD_CGROUP\"\n\tSD_JOURNAL_FIELD_SYSTEMD_SESSION           = \"_SYSTEMD_SESSION\"\n\tSD_JOURNAL_FIELD_SYSTEMD_UNIT              = \"_SYSTEMD_UNIT\"\n\tSD_JOURNAL_FIELD_SYSTEMD_USER_UNIT         = \"_SYSTEMD_USER_UNIT\"\n\tSD_JOURNAL_FIELD_SYSTEMD_OWNER_UID         = \"_SYSTEMD_OWNER_UID\"\n\tSD_JOURNAL_FIELD_SYSTEMD_SLICE             = \"_SYSTEMD_SLICE\"\n\tSD_JOURNAL_FIELD_SELINUX_CONTEXT           = \"_SELINUX_CONTEXT\"\n\tSD_JOURNAL_FIELD_SOURCE_REALTIME_TIMESTAMP = \"_SOURCE_REALTIME_TIMESTAMP\"\n\tSD_JOURNAL_FIELD_BOOT_ID                   = \"_BOOT_ID\"\n\tSD_JOURNAL_FIELD_MACHINE_ID                = \"_MACHINE_ID\"\n\tSD_JOURNAL_FIELD_HOSTNAME                  = \"_HOSTNAME\"\n\tSD_JOURNAL_FIELD_TRANSPORT                 = \"_TRANSPORT\"\n\n\t// Address Fields\n\tSD_JOURNAL_FIELD_CURSOR              = \"__CURSOR\"\n\tSD_JOURNAL_FIELD_REALTIME_TIMESTAMP  = \"__REALTIME_TIMESTAMP\"\n\tSD_JOURNAL_FIELD_MONOTONIC_TIMESTAMP = \"__MONOTONIC_TIMESTAMP\"\n)\n\n// Journal event constants\nconst (\n\tSD_JOURNAL_NOP        = int(C.SD_JOURNAL_NOP)\n\tSD_JOURNAL_APPEND     = int(C.SD_JOURNAL_APPEND)\n\tSD_JOURNAL_INVALIDATE = int(C.SD_JOURNAL_INVALIDATE)\n)\n\nconst (\n\t// IndefiniteWait is a sentinel value that can be passed to\n\t// sdjournal.Wait() to signal an indefinite wait for new journal\n\t// events. It is implemented as the maximum value for a time.Duration:\n\t// https://github.com/golang/go/blob/e4dcf5c8c22d98ac9eac7b9b226596229624cb1d/src/time/time.go#L434\n\tIndefiniteWait time.Duration = 1<<63 - 1\n)\n\n// Journal is a Go wrapper of an sd_journal structure.\ntype Journal struct {\n\tcjournal *C.sd_journal\n\tmu       sync.Mutex\n}\n\n// JournalEntry represents all fields of a journal entry plus address fields.\ntype JournalEntry struct {\n\tFields             map[string]string\n\tCursor             string\n\tRealtimeTimestamp  uint64\n\tMonotonicTimestamp uint64\n}\n\n// Match is a convenience wrapper to describe filters supplied to AddMatch.\ntype Match struct {\n\tField string\n\tValue string\n}\n\n// String returns a string representation of a Match suitable for use with AddMatch.\nfunc (m *Match) String() string {\n\treturn m.Field + \"=\" + m.Value\n}\n\n// NewJournal returns a new Journal instance pointing to the local journal\nfunc NewJournal() (j *Journal, err error) {\n\tj = &Journal{}\n\n\tsd_journal_open, err := getFunction(\"sd_journal_open\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tr := C.my_sd_journal_open(sd_journal_open, &j.cjournal, C.SD_JOURNAL_LOCAL_ONLY)\n\n\tif r < 0 {\n\t\treturn nil, fmt.Errorf(\"failed to open journal: %d\", syscall.Errno(-r))\n\t}\n\n\treturn j, nil\n}\n\n// NewJournalFromDir returns a new Journal instance pointing to a journal residing\n// in a given directory. The supplied path may be relative or absolute; if\n// relative, it will be converted to an absolute path before being opened.\nfunc NewJournalFromDir(path string) (j *Journal, err error) {\n\tj = &Journal{}\n\n\tsd_journal_open_directory, err := getFunction(\"sd_journal_open_directory\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tp := C.CString(path)\n\tdefer C.free(unsafe.Pointer(p))\n\n\tr := C.my_sd_journal_open_directory(sd_journal_open_directory, &j.cjournal, p, 0)\n\tif r < 0 {\n\t\treturn nil, fmt.Errorf(\"failed to open journal in directory %q: %d\", path, syscall.Errno(-r))\n\t}\n\n\treturn j, nil\n}\n\n// Close closes a journal opened with NewJournal.\nfunc (j *Journal) Close() error {\n\tsd_journal_close, err := getFunction(\"sd_journal_close\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tj.mu.Lock()\n\tC.my_sd_journal_close(sd_journal_close, j.cjournal)\n\tj.mu.Unlock()\n\n\treturn nil\n}\n\n// AddMatch adds a match by which to filter the entries of the journal.\nfunc (j *Journal) AddMatch(match string) error {\n\tsd_journal_add_match, err := getFunction(\"sd_journal_add_match\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tm := C.CString(match)\n\tdefer C.free(unsafe.Pointer(m))\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_add_match(sd_journal_add_match, j.cjournal, unsafe.Pointer(m), C.size_t(len(match)))\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn fmt.Errorf(\"failed to add match: %d\", syscall.Errno(-r))\n\t}\n\n\treturn nil\n}\n\n// AddDisjunction inserts a logical OR in the match list.\nfunc (j *Journal) AddDisjunction() error {\n\tsd_journal_add_disjunction, err := getFunction(\"sd_journal_add_disjunction\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_add_disjunction(sd_journal_add_disjunction, j.cjournal)\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn fmt.Errorf(\"failed to add a disjunction in the match list: %d\", syscall.Errno(-r))\n\t}\n\n\treturn nil\n}\n\n// AddConjunction inserts a logical AND in the match list.\nfunc (j *Journal) AddConjunction() error {\n\tsd_journal_add_conjunction, err := getFunction(\"sd_journal_add_conjunction\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_add_conjunction(sd_journal_add_conjunction, j.cjournal)\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn fmt.Errorf(\"failed to add a conjunction in the match list: %d\", syscall.Errno(-r))\n\t}\n\n\treturn nil\n}\n\n// FlushMatches flushes all matches, disjunctions and conjunctions.\nfunc (j *Journal) FlushMatches() {\n\tsd_journal_flush_matches, err := getFunction(\"sd_journal_flush_matches\")\n\tif err != nil {\n\t\treturn\n\t}\n\n\tj.mu.Lock()\n\tC.my_sd_journal_flush_matches(sd_journal_flush_matches, j.cjournal)\n\tj.mu.Unlock()\n}\n\n// Next advances the read pointer into the journal by one entry.\nfunc (j *Journal) Next() (int, error) {\n\tsd_journal_next, err := getFunction(\"sd_journal_next\")\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_next(sd_journal_next, j.cjournal)\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn int(r), fmt.Errorf(\"failed to iterate journal: %d\", syscall.Errno(-r))\n\t}\n\n\treturn int(r), nil\n}\n\n// NextSkip advances the read pointer by multiple entries at once,\n// as specified by the skip parameter.\nfunc (j *Journal) NextSkip(skip uint64) (uint64, error) {\n\tsd_journal_next_skip, err := getFunction(\"sd_journal_next_skip\")\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_next_skip(sd_journal_next_skip, j.cjournal, C.uint64_t(skip))\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn uint64(r), fmt.Errorf(\"failed to iterate journal: %d\", syscall.Errno(-r))\n\t}\n\n\treturn uint64(r), nil\n}\n\n// Previous sets the read pointer into the journal back by one entry.\nfunc (j *Journal) Previous() (uint64, error) {\n\tsd_journal_previous, err := getFunction(\"sd_journal_previous\")\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_previous(sd_journal_previous, j.cjournal)\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn uint64(r), fmt.Errorf(\"failed to iterate journal: %d\", syscall.Errno(-r))\n\t}\n\n\treturn uint64(r), nil\n}\n\n// PreviousSkip sets back the read pointer by multiple entries at once,\n// as specified by the skip parameter.\nfunc (j *Journal) PreviousSkip(skip uint64) (uint64, error) {\n\tsd_journal_previous_skip, err := getFunction(\"sd_journal_previous_skip\")\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_previous_skip(sd_journal_previous_skip, j.cjournal, C.uint64_t(skip))\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn uint64(r), fmt.Errorf(\"failed to iterate journal: %d\", syscall.Errno(-r))\n\t}\n\n\treturn uint64(r), nil\n}\n\nfunc (j *Journal) getData(field string) (unsafe.Pointer, C.int, error) {\n\tsd_journal_get_data, err := getFunction(\"sd_journal_get_data\")\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\n\tf := C.CString(field)\n\tdefer C.free(unsafe.Pointer(f))\n\n\tvar d unsafe.Pointer\n\tvar l C.size_t\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_get_data(sd_journal_get_data, j.cjournal, f, &d, &l)\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn nil, 0, fmt.Errorf(\"failed to read message: %d\", syscall.Errno(-r))\n\t}\n\n\treturn d, C.int(l), nil\n}\n\n// GetData gets the data object associated with a specific field from the\n// current journal entry.\nfunc (j *Journal) GetData(field string) (string, error) {\n\td, l, err := j.getData(field)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn C.GoStringN((*C.char)(d), l), nil\n}\n\n// GetDataValue gets the data object associated with a specific field from the\n// current journal entry, returning only the value of the object.\nfunc (j *Journal) GetDataValue(field string) (string, error) {\n\tval, err := j.GetData(field)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn strings.SplitN(val, \"=\", 2)[1], nil\n}\n\n// GetDataBytes gets the data object associated with a specific field from the\n// current journal entry.\nfunc (j *Journal) GetDataBytes(field string) ([]byte, error) {\n\td, l, err := j.getData(field)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn C.GoBytes(d, l), nil\n}\n\n// GetDataValueBytes gets the data object associated with a specific field from the\n// current journal entry, returning only the value of the object.\nfunc (j *Journal) GetDataValueBytes(field string) ([]byte, error) {\n\tval, err := j.GetDataBytes(field)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn bytes.SplitN(val, []byte(\"=\"), 2)[1], nil\n}\n\n// GetEntry returns a full representation of a journal entry with\n// all key-value pairs of data as well as address fields (cursor, realtime\n// timestamp and monotonic timestamp)\nfunc (j *Journal) GetEntry() (*JournalEntry, error) {\n\tsd_journal_get_realtime_usec, err := getFunction(\"sd_journal_get_realtime_usec\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsd_journal_get_monotonic_usec, err := getFunction(\"sd_journal_get_monotonic_usec\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsd_journal_get_cursor, err := getFunction(\"sd_journal_get_cursor\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsd_journal_restart_data, err := getFunction(\"sd_journal_restart_data\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsd_journal_enumerate_data, err := getFunction(\"sd_journal_enumerate_data\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tj.mu.Lock()\n\tdefer j.mu.Unlock()\n\n\tvar r C.int\n\tentry := &JournalEntry{Fields: make(map[string]string)}\n\n\tvar realtimeUsec C.uint64_t\n\tr = C.my_sd_journal_get_realtime_usec(sd_journal_get_realtime_usec, j.cjournal, &realtimeUsec)\n\tif r < 0 {\n\t\treturn nil, fmt.Errorf(\"failed to get realtime timestamp: %d\", syscall.Errno(-r))\n\t}\n\n\tentry.RealtimeTimestamp = uint64(realtimeUsec)\n\n\tvar monotonicUsec C.uint64_t\n\tvar boot_id C.sd_id128_t\n\n\tr = C.my_sd_journal_get_monotonic_usec(sd_journal_get_monotonic_usec, j.cjournal, &monotonicUsec, &boot_id)\n\tif r < 0 {\n\t\treturn nil, fmt.Errorf(\"failed to get monotonic timestamp: %d\", syscall.Errno(-r))\n\t}\n\n\tentry.MonotonicTimestamp = uint64(monotonicUsec)\n\n\tvar c *C.char\n\t// since the pointer is mutated by sd_journal_get_cursor, need to wait\n\t// until after the call to free the memory\n\tr = C.my_sd_journal_get_cursor(sd_journal_get_cursor, j.cjournal, &c)\n\tdefer C.free(unsafe.Pointer(c))\n\tif r < 0 {\n\t\treturn nil, fmt.Errorf(\"failed to get cursor: %d\", syscall.Errno(-r))\n\t}\n\n\tentry.Cursor = C.GoString(c)\n\n\t// Implements the JOURNAL_FOREACH_DATA_RETVAL macro from journal-internal.h\n\tvar d unsafe.Pointer\n\tvar l C.size_t\n\tC.my_sd_journal_restart_data(sd_journal_restart_data, j.cjournal)\n\tfor {\n\t\tr = C.my_sd_journal_enumerate_data(sd_journal_enumerate_data, j.cjournal, &d, &l)\n\t\tif r == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tif r < 0 {\n\t\t\treturn nil, fmt.Errorf(\"failed to read message field: %d\", syscall.Errno(-r))\n\t\t}\n\n\t\tmsg := C.GoStringN((*C.char)(d), C.int(l))\n\t\tkv := strings.SplitN(msg, \"=\", 2)\n\t\tif len(kv) < 2 {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse field\")\n\t\t}\n\n\t\tentry.Fields[kv[0]] = kv[1]\n\t}\n\n\treturn entry, nil\n}\n\n// SetDataThresold sets the data field size threshold for data returned by\n// GetData. To retrieve the complete data fields this threshold should be\n// turned off by setting it to 0, so that the library always returns the\n// complete data objects.\nfunc (j *Journal) SetDataThreshold(threshold uint64) error {\n\tsd_journal_set_data_threshold, err := getFunction(\"sd_journal_set_data_threshold\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_set_data_threshold(sd_journal_set_data_threshold, j.cjournal, C.size_t(threshold))\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn fmt.Errorf(\"failed to set data threshold: %d\", syscall.Errno(-r))\n\t}\n\n\treturn nil\n}\n\n// GetRealtimeUsec gets the realtime (wallclock) timestamp of the current\n// journal entry.\nfunc (j *Journal) GetRealtimeUsec() (uint64, error) {\n\tvar usec C.uint64_t\n\n\tsd_journal_get_realtime_usec, err := getFunction(\"sd_journal_get_realtime_usec\")\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_get_realtime_usec(sd_journal_get_realtime_usec, j.cjournal, &usec)\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn 0, fmt.Errorf(\"failed to get realtime timestamp: %d\", syscall.Errno(-r))\n\t}\n\n\treturn uint64(usec), nil\n}\n\n// GetMonotonicUsec gets the monotonic timestamp of the current journal entry.\nfunc (j *Journal) GetMonotonicUsec() (uint64, error) {\n\tvar usec C.uint64_t\n\tvar boot_id C.sd_id128_t\n\n\tsd_journal_get_monotonic_usec, err := getFunction(\"sd_journal_get_monotonic_usec\")\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_get_monotonic_usec(sd_journal_get_monotonic_usec, j.cjournal, &usec, &boot_id)\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn 0, fmt.Errorf(\"failed to get monotonic timestamp: %d\", syscall.Errno(-r))\n\t}\n\n\treturn uint64(usec), nil\n}\n\n// GetCursor gets the cursor of the current journal entry.\nfunc (j *Journal) GetCursor() (string, error) {\n\tsd_journal_get_cursor, err := getFunction(\"sd_journal_get_cursor\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar d *C.char\n\t// since the pointer is mutated by sd_journal_get_cursor, need to wait\n\t// until after the call to free the memory\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_get_cursor(sd_journal_get_cursor, j.cjournal, &d)\n\tj.mu.Unlock()\n\tdefer C.free(unsafe.Pointer(d))\n\n\tif r < 0 {\n\t\treturn \"\", fmt.Errorf(\"failed to get cursor: %d\", syscall.Errno(-r))\n\t}\n\n\tcursor := C.GoString(d)\n\n\treturn cursor, nil\n}\n\n// TestCursor checks whether the current position in the journal matches the\n// specified cursor\nfunc (j *Journal) TestCursor(cursor string) error {\n\tsd_journal_test_cursor, err := getFunction(\"sd_journal_test_cursor\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tc := C.CString(cursor)\n\tdefer C.free(unsafe.Pointer(c))\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_test_cursor(sd_journal_test_cursor, j.cjournal, c)\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn fmt.Errorf(\"failed to test to cursor %q: %d\", cursor, syscall.Errno(-r))\n\t}\n\n\treturn nil\n}\n\n// SeekHead seeks to the beginning of the journal, i.e. the oldest available\n// entry.\nfunc (j *Journal) SeekHead() error {\n\tsd_journal_seek_head, err := getFunction(\"sd_journal_seek_head\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_seek_head(sd_journal_seek_head, j.cjournal)\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn fmt.Errorf(\"failed to seek to head of journal: %d\", syscall.Errno(-r))\n\t}\n\n\treturn nil\n}\n\n// SeekTail may be used to seek to the end of the journal, i.e. the most recent\n// available entry.\nfunc (j *Journal) SeekTail() error {\n\tsd_journal_seek_tail, err := getFunction(\"sd_journal_seek_tail\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_seek_tail(sd_journal_seek_tail, j.cjournal)\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn fmt.Errorf(\"failed to seek to tail of journal: %d\", syscall.Errno(-r))\n\t}\n\n\treturn nil\n}\n\n// SeekRealtimeUsec seeks to the entry with the specified realtime (wallclock)\n// timestamp, i.e. CLOCK_REALTIME.\nfunc (j *Journal) SeekRealtimeUsec(usec uint64) error {\n\tsd_journal_seek_realtime_usec, err := getFunction(\"sd_journal_seek_realtime_usec\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_seek_realtime_usec(sd_journal_seek_realtime_usec, j.cjournal, C.uint64_t(usec))\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn fmt.Errorf(\"failed to seek to %d: %d\", usec, syscall.Errno(-r))\n\t}\n\n\treturn nil\n}\n\n// SeekCursor seeks to a concrete journal cursor.\nfunc (j *Journal) SeekCursor(cursor string) error {\n\tsd_journal_seek_cursor, err := getFunction(\"sd_journal_seek_cursor\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tc := C.CString(cursor)\n\tdefer C.free(unsafe.Pointer(c))\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_seek_cursor(sd_journal_seek_cursor, j.cjournal, c)\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn fmt.Errorf(\"failed to seek to cursor %q: %d\", cursor, syscall.Errno(-r))\n\t}\n\n\treturn nil\n}\n\n// Wait will synchronously wait until the journal gets changed. The maximum time\n// this call sleeps may be controlled with the timeout parameter.  If\n// sdjournal.IndefiniteWait is passed as the timeout parameter, Wait will\n// wait indefinitely for a journal change.\nfunc (j *Journal) Wait(timeout time.Duration) int {\n\tvar to uint64\n\n\tsd_journal_wait, err := getFunction(\"sd_journal_wait\")\n\tif err != nil {\n\t\treturn -1\n\t}\n\n\tif timeout == IndefiniteWait {\n\t\t// sd_journal_wait(3) calls for a (uint64_t) -1 to be passed to signify\n\t\t// indefinite wait, but using a -1 overflows our C.uint64_t, so we use an\n\t\t// equivalent hex value.\n\t\tto = 0xffffffffffffffff\n\t} else {\n\t\tto = uint64(time.Now().Add(timeout).Unix() / 1000)\n\t}\n\tj.mu.Lock()\n\tr := C.my_sd_journal_wait(sd_journal_wait, j.cjournal, C.uint64_t(to))\n\tj.mu.Unlock()\n\n\treturn int(r)\n}\n\n// GetUsage returns the journal disk space usage, in bytes.\nfunc (j *Journal) GetUsage() (uint64, error) {\n\tvar out C.uint64_t\n\n\tsd_journal_get_usage, err := getFunction(\"sd_journal_get_usage\")\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tj.mu.Lock()\n\tr := C.my_sd_journal_get_usage(sd_journal_get_usage, j.cjournal, &out)\n\tj.mu.Unlock()\n\n\tif r < 0 {\n\t\treturn 0, fmt.Errorf(\"failed to get journal disk space usage: %d\", syscall.Errno(-r))\n\t}\n\n\treturn uint64(out), nil\n}\n"
  },
  {
    "path": "vendor/github.com/coreos/go-systemd/sdjournal/read.go",
    "content": "// Copyright 2015 RedHat, Inc.\n// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage sdjournal\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"strings\"\n\t\"time\"\n)\n\nvar (\n\tErrExpired = errors.New(\"Timeout expired\")\n)\n\n// JournalReaderConfig represents options to drive the behavior of a JournalReader.\ntype JournalReaderConfig struct {\n\t// The Since, NumFromTail and Cursor options are mutually exclusive and\n\t// determine where the reading begins within the journal. The order in which\n\t// options are written is exactly the order of precedence.\n\tSince       time.Duration // start relative to a Duration from now\n\tNumFromTail uint64        // start relative to the tail\n\tCursor      string        // start relative to the cursor\n\n\t// Show only journal entries whose fields match the supplied values. If\n\t// the array is empty, entries will not be filtered.\n\tMatches []Match\n\n\t// If not empty, the journal instance will point to a journal residing\n\t// in this directory. The supplied path may be relative or absolute.\n\tPath string\n}\n\n// JournalReader is an io.ReadCloser which provides a simple interface for iterating through the\n// systemd journal. A JournalReader is not safe for concurrent use by multiple goroutines.\ntype JournalReader struct {\n\tjournal   *Journal\n\tmsgReader *strings.Reader\n}\n\n// NewJournalReader creates a new JournalReader with configuration options that are similar to the\n// systemd journalctl tool's iteration and filtering features.\nfunc NewJournalReader(config JournalReaderConfig) (*JournalReader, error) {\n\tr := &JournalReader{}\n\n\t// Open the journal\n\tvar err error\n\tif config.Path != \"\" {\n\t\tr.journal, err = NewJournalFromDir(config.Path)\n\t} else {\n\t\tr.journal, err = NewJournal()\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Add any supplied matches\n\tfor _, m := range config.Matches {\n\t\tr.journal.AddMatch(m.String())\n\t}\n\n\t// Set the start position based on options\n\tif config.Since != 0 {\n\t\t// Start based on a relative time\n\t\tstart := time.Now().Add(config.Since)\n\t\tif err := r.journal.SeekRealtimeUsec(uint64(start.UnixNano() / 1000)); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else if config.NumFromTail != 0 {\n\t\t// Start based on a number of lines before the tail\n\t\tif err := r.journal.SeekTail(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Move the read pointer into position near the tail. Go one further than\n\t\t// the option so that the initial cursor advancement positions us at the\n\t\t// correct starting point.\n\t\tskip, err := r.journal.PreviousSkip(config.NumFromTail + 1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// If we skipped fewer lines than expected, we have reached journal start.\n\t\t// Thus, we seek to head so that next invocation can read the first line.\n\t\tif skip != config.NumFromTail+1 {\n\t\t\tif err := r.journal.SeekHead(); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t} else if config.Cursor != \"\" {\n\t\t// Start based on a custom cursor\n\t\tif err := r.journal.SeekCursor(config.Cursor); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn r, nil\n}\n\n// Read reads entries from the journal. Read follows the Reader interface so\n// it must be able to read a specific amount of bytes. Journald on the other\n// hand only allows us to read full entries of arbitrary size (without byte\n// granularity). JournalReader is therefore internally buffering entries that\n// don't fit in the read buffer. Callers should keep calling until 0 and/or an\n// error is returned.\nfunc (r *JournalReader) Read(b []byte) (int, error) {\n\tvar err error\n\n\tif r.msgReader == nil {\n\t\tvar c int\n\n\t\t// Advance the journal cursor. It has to be called at least one time\n\t\t// before reading\n\t\tc, err = r.journal.Next()\n\n\t\t// An unexpected error\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\t// EOF detection\n\t\tif c == 0 {\n\t\t\treturn 0, io.EOF\n\t\t}\n\n\t\t// Build a message\n\t\tvar msg string\n\t\tmsg, err = r.buildMessage()\n\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tr.msgReader = strings.NewReader(msg)\n\t}\n\n\t// Copy and return the message\n\tvar sz int\n\tsz, err = r.msgReader.Read(b)\n\tif err == io.EOF {\n\t\t// The current entry has been fully read. Don't propagate this\n\t\t// EOF, so the next entry can be read at the next Read()\n\t\t// iteration.\n\t\tr.msgReader = nil\n\t\treturn sz, nil\n\t}\n\tif err != nil {\n\t\treturn sz, err\n\t}\n\tif r.msgReader.Len() == 0 {\n\t\tr.msgReader = nil\n\t}\n\n\treturn sz, nil\n}\n\n// Close closes the JournalReader's handle to the journal.\nfunc (r *JournalReader) Close() error {\n\treturn r.journal.Close()\n}\n\n// Rewind attempts to rewind the JournalReader to the first entry.\nfunc (r *JournalReader) Rewind() error {\n\tr.msgReader = nil\n\treturn r.journal.SeekHead()\n}\n\n// Follow synchronously follows the JournalReader, writing each new journal entry to writer. The\n// follow will continue until a single time.Time is received on the until channel.\nfunc (r *JournalReader) Follow(until <-chan time.Time, writer io.Writer) (err error) {\n\n\t// Process journal entries and events. Entries are flushed until the tail or\n\t// timeout is reached, and then we wait for new events or the timeout.\n\tvar msg = make([]byte, 64*1<<(10))\nprocess:\n\tfor {\n\t\tc, err := r.Read(msg)\n\t\tif err != nil && err != io.EOF {\n\t\t\tbreak process\n\t\t}\n\n\t\tselect {\n\t\tcase <-until:\n\t\t\treturn ErrExpired\n\t\tdefault:\n\t\t\tif c > 0 {\n\t\t\t\tif _, err = writer.Write(msg[:c]); err != nil {\n\t\t\t\t\tbreak process\n\t\t\t\t}\n\t\t\t\tcontinue process\n\t\t\t}\n\t\t}\n\n\t\t// We're at the tail, so wait for new events or time out.\n\t\t// Holds journal events to process. Tightly bounded for now unless there's a\n\t\t// reason to unblock the journal watch routine more quickly.\n\t\tevents := make(chan int, 1)\n\t\tpollDone := make(chan bool, 1)\n\t\tgo func() {\n\t\t\tfor {\n\t\t\t\tselect {\n\t\t\t\tcase <-pollDone:\n\t\t\t\t\treturn\n\t\t\t\tdefault:\n\t\t\t\t\tevents <- r.journal.Wait(time.Duration(1) * time.Second)\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\n\t\tselect {\n\t\tcase <-until:\n\t\t\tpollDone <- true\n\t\t\treturn ErrExpired\n\t\tcase e := <-events:\n\t\t\tpollDone <- true\n\t\t\tswitch e {\n\t\t\tcase SD_JOURNAL_NOP, SD_JOURNAL_APPEND, SD_JOURNAL_INVALIDATE:\n\t\t\t\t// TODO: need to account for any of these?\n\t\t\tdefault:\n\t\t\t\tlog.Printf(\"Received unknown event: %d\\n\", e)\n\t\t\t}\n\t\t\tcontinue process\n\t\t}\n\t}\n\n\treturn\n}\n\n// buildMessage returns a string representing the current journal entry in a simple format which\n// includes the entry timestamp and MESSAGE field.\nfunc (r *JournalReader) buildMessage() (string, error) {\n\tvar msg string\n\tvar usec uint64\n\tvar err error\n\n\tif msg, err = r.journal.GetData(\"MESSAGE\"); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif usec, err = r.journal.GetRealtimeUsec(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\ttimestamp := time.Unix(0, int64(usec)*int64(time.Microsecond))\n\n\treturn fmt.Sprintf(\"%s %s\\n\", timestamp, msg), nil\n}\n"
  },
  {
    "path": "vendor/github.com/coreos/pkg/LICENSE",
    "content": "Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n"
  },
  {
    "path": "vendor/github.com/coreos/pkg/NOTICE",
    "content": "CoreOS Project\nCopyright 2014 CoreOS, Inc\n\nThis product includes software developed at CoreOS, Inc.\n(http://www.coreos.com/).\n"
  },
  {
    "path": "vendor/github.com/coreos/pkg/dlopen/dlopen.go",
    "content": "// Copyright 2016 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Package dlopen provides some convenience functions to dlopen a library and\n// get its symbols.\npackage dlopen\n\n// #cgo LDFLAGS: -ldl\n// #include <stdlib.h>\n// #include <dlfcn.h>\nimport \"C\"\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"unsafe\"\n)\n\nvar ErrSoNotFound = errors.New(\"unable to open a handle to the library\")\n\n// LibHandle represents an open handle to a library (.so)\ntype LibHandle struct {\n\tHandle  unsafe.Pointer\n\tLibname string\n}\n\n// GetHandle tries to get a handle to a library (.so), attempting to access it\n// by the names specified in libs and returning the first that is successfully\n// opened. Callers are responsible for closing the handler. If no library can\n// be successfully opened, an error is returned.\nfunc GetHandle(libs []string) (*LibHandle, error) {\n\tfor _, name := range libs {\n\t\tlibname := C.CString(name)\n\t\tdefer C.free(unsafe.Pointer(libname))\n\t\thandle := C.dlopen(libname, C.RTLD_LAZY)\n\t\tif handle != nil {\n\t\t\th := &LibHandle{\n\t\t\t\tHandle:  handle,\n\t\t\t\tLibname: name,\n\t\t\t}\n\t\t\treturn h, nil\n\t\t}\n\t}\n\treturn nil, ErrSoNotFound\n}\n\n// GetSymbolPointer takes a symbol name and returns a pointer to the symbol.\nfunc (l *LibHandle) GetSymbolPointer(symbol string) (unsafe.Pointer, error) {\n\tsym := C.CString(symbol)\n\tdefer C.free(unsafe.Pointer(sym))\n\n\tC.dlerror()\n\tp := C.dlsym(l.Handle, sym)\n\te := C.dlerror()\n\tif e != nil {\n\t\treturn nil, fmt.Errorf(\"error resolving symbol %q: %v\", symbol, errors.New(C.GoString(e)))\n\t}\n\n\treturn p, nil\n}\n\n// Close closes a LibHandle.\nfunc (l *LibHandle) Close() error {\n\tC.dlerror()\n\tC.dlclose(l.Handle)\n\te := C.dlerror()\n\tif e != nil {\n\t\treturn fmt.Errorf(\"error closing %v: %v\", l.Libname, errors.New(C.GoString(e)))\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/coreos/pkg/dlopen/dlopen_example.go",
    "content": "// Copyright 2015 CoreOS, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// +build linux\n\npackage dlopen\n\n// #include <string.h>\n// #include <stdlib.h>\n//\n// int\n// my_strlen(void *f, const char *s)\n// {\n//   size_t (*strlen)(const char *);\n//\n//   strlen = (size_t (*)(const char *))f;\n//   return strlen(s);\n// }\nimport \"C\"\n\nimport (\n\t\"fmt\"\n\t\"unsafe\"\n)\n\nfunc strlen(libs []string, s string) (int, error) {\n\th, err := GetHandle(libs)\n\tif err != nil {\n\t\treturn -1, fmt.Errorf(`couldn't get a handle to the library: %v`, err)\n\t}\n\tdefer h.Close()\n\n\tf := \"strlen\"\n\tcs := C.CString(s)\n\tdefer C.free(unsafe.Pointer(cs))\n\n\tstrlen, err := h.GetSymbolPointer(f)\n\tif err != nil {\n\t\treturn -1, fmt.Errorf(`couldn't get symbol %q: %v`, f, err)\n\t}\n\n\tlen := C.my_strlen(strlen, cs)\n\n\treturn int(len), nil\n}\n"
  },
  {
    "path": "vendor/github.com/go-ini/ini/LICENSE",
    "content": "Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and\ndistribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright\nowner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities\nthat control, are controlled by, or are under common control with that entity.\nFor the purposes of this definition, \"control\" means (i) the power, direct or\nindirect, to cause the direction or management of such entity, whether by\ncontract or otherwise, or (ii) ownership of fifty percent (50%) or more of the\noutstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising\npermissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including\nbut not limited to software source code, documentation source, and configuration\nfiles.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or\ntranslation of a Source form, including but not limited to compiled object code,\ngenerated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made\navailable under the License, as indicated by a copyright notice that is included\nin or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that\nis based on (or derived from) the Work and for which the editorial revisions,\nannotations, elaborations, or other modifications represent, as a whole, an\noriginal work of authorship. For the purposes of this License, Derivative Works\nshall not include works that remain separable from, or merely link (or bind by\nname) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version\nof the Work and any modifications or additions to that Work or Derivative Works\nthereof, that is intentionally submitted to Licensor for inclusion in the Work\nby the copyright owner or by an individual or Legal Entity authorized to submit\non behalf of the copyright owner. For the purposes of this definition,\n\"submitted\" means any form of electronic, verbal, or written communication sent\nto the Licensor or its representatives, including but not limited to\ncommunication on electronic mailing lists, source code control systems, and\nissue tracking systems that are managed by, or on behalf of, the Licensor for\nthe purpose of discussing and improving the Work, but excluding communication\nthat is conspicuously marked or otherwise designated in writing by the copyright\nowner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf\nof whom a Contribution has been received by Licensor and subsequently\nincorporated within the Work.\n\n2. Grant of Copyright License.\n\nSubject to the terms and conditions of this License, each Contributor hereby\ngrants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,\nirrevocable copyright license to reproduce, prepare Derivative Works of,\npublicly display, publicly perform, sublicense, and distribute the Work and such\nDerivative Works in Source or Object form.\n\n3. Grant of Patent License.\n\nSubject to the terms and conditions of this License, each Contributor hereby\ngrants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,\nirrevocable (except as stated in this section) patent license to make, have\nmade, use, offer to sell, sell, import, and otherwise transfer the Work, where\nsuch license applies only to those patent claims licensable by such Contributor\nthat are necessarily infringed by their Contribution(s) alone or by combination\nof their Contribution(s) with the Work to which such Contribution(s) was\nsubmitted. If You institute patent litigation against any entity (including a\ncross-claim or counterclaim in a lawsuit) alleging that the Work or a\nContribution incorporated within the Work constitutes direct or contributory\npatent infringement, then any patent licenses granted to You under this License\nfor that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution.\n\nYou may reproduce and distribute copies of the Work or Derivative Works thereof\nin any medium, with or without modifications, and in Source or Object form,\nprovided that You meet the following conditions:\n\nYou must give any other recipients of the Work or Derivative Works a copy of\nthis License; and\nYou must cause any modified files to carry prominent notices stating that You\nchanged the files; and\nYou must retain, in the Source form of any Derivative Works that You distribute,\nall copyright, patent, trademark, and attribution notices from the Source form\nof the Work, excluding those notices that do not pertain to any part of the\nDerivative Works; and\nIf the Work includes a \"NOTICE\" text file as part of its distribution, then any\nDerivative Works that You distribute must include a readable copy of the\nattribution notices contained within such NOTICE file, excluding those notices\nthat do not pertain to any part of the Derivative Works, in at least one of the\nfollowing places: within a NOTICE text file distributed as part of the\nDerivative Works; within the Source form or documentation, if provided along\nwith the Derivative Works; or, within a display generated by the Derivative\nWorks, if and wherever such third-party notices normally appear. The contents of\nthe NOTICE file are for informational purposes only and do not modify the\nLicense. You may add Your own attribution notices within Derivative Works that\nYou distribute, alongside or as an addendum to the NOTICE text from the Work,\nprovided that such additional attribution notices cannot be construed as\nmodifying the License.\nYou may add Your own copyright statement to Your modifications and may provide\nadditional or different license terms and conditions for use, reproduction, or\ndistribution of Your modifications, or for any such Derivative Works as a whole,\nprovided Your use, reproduction, and distribution of the Work otherwise complies\nwith the conditions stated in this License.\n\n5. Submission of Contributions.\n\nUnless You explicitly state otherwise, any Contribution intentionally submitted\nfor inclusion in the Work by You to the Licensor shall be under the terms and\nconditions of this License, without any additional terms or conditions.\nNotwithstanding the above, nothing herein shall supersede or modify the terms of\nany separate license agreement you may have executed with Licensor regarding\nsuch Contributions.\n\n6. Trademarks.\n\nThis License does not grant permission to use the trade names, trademarks,\nservice marks, or product names of the Licensor, except as required for\nreasonable and customary use in describing the origin of the Work and\nreproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty.\n\nUnless required by applicable law or agreed to in writing, Licensor provides the\nWork (and each Contributor provides its Contributions) on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,\nincluding, without limitation, any warranties or conditions of TITLE,\nNON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are\nsolely responsible for determining the appropriateness of using or\nredistributing the Work and assume any risks associated with Your exercise of\npermissions under this License.\n\n8. Limitation of Liability.\n\nIn no event and under no legal theory, whether in tort (including negligence),\ncontract, or otherwise, unless required by applicable law (such as deliberate\nand grossly negligent acts) or agreed to in writing, shall any Contributor be\nliable to You for damages, including any direct, indirect, special, incidental,\nor consequential damages of any character arising as a result of this License or\nout of the use or inability to use the Work (including but not limited to\ndamages for loss of goodwill, work stoppage, computer failure or malfunction, or\nany and all other commercial damages or losses), even if such Contributor has\nbeen advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability.\n\nWhile redistributing the Work or Derivative Works thereof, You may choose to\noffer, and charge a fee for, acceptance of support, warranty, indemnity, or\nother liability obligations and/or rights consistent with this License. However,\nin accepting such obligations, You may act only on Your own behalf and on Your\nsole responsibility, not on behalf of any other Contributor, and only if You\nagree to indemnify, defend, and hold each Contributor harmless for any liability\nincurred by, or claims asserted against, such Contributor by reason of your\naccepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work\n\nTo apply the Apache License to your work, attach the following boilerplate\nnotice, with the fields enclosed by brackets \"[]\" replaced with your own\nidentifying information. (Don't include the brackets!) The text should be\nenclosed in the appropriate comment syntax for the file format. We also\nrecommend that a file or class name and description of purpose be included on\nthe same \"printed page\" as the copyright notice for easier identification within\nthird-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/github.com/go-ini/ini/Makefile",
    "content": ".PHONY: build test bench vet\n\nbuild: vet bench\n\ntest:\n\tgo test -v -cover -race\n\nbench:\n\tgo test -v -cover -race -test.bench=. -test.benchmem\n\nvet:\n\tgo vet\n"
  },
  {
    "path": "vendor/github.com/go-ini/ini/README.md",
    "content": "INI [![Build Status](https://travis-ci.org/go-ini/ini.svg?branch=master)](https://travis-ci.org/go-ini/ini)\n===\n\n![](https://avatars0.githubusercontent.com/u/10216035?v=3&s=200)\n\nPackage ini provides INI file read and write functionality in Go.\n\n[简体中文](README_ZH.md)\n\n## Feature\n\n- Load multiple data sources(`[]byte` or file) with overwrites.\n- Read with recursion values.\n- Read with parent-child sections.\n- Read with auto-increment key names.\n- Read with multiple-line values.\n- Read with tons of helper methods.\n- Read and convert values to Go types.\n- Read and **WRITE** comments of sections and keys.\n- Manipulate sections, keys and comments with ease.\n- Keep sections and keys in order as you parse and save.\n\n## Installation\n\nTo use a tagged revision:\n\n\tgo get gopkg.in/ini.v1\n\nTo use with latest changes:\n\n\tgo get github.com/go-ini/ini\n\nPlease add `-u` flag to update in the future.\n\n### Testing\n\nIf you want to test on your machine, please apply `-t` flag:\n\n\tgo get -t gopkg.in/ini.v1\n\nPlease add `-u` flag to update in the future.\n\n## Getting Started\n\n### Loading from data sources\n\nA **Data Source** is either raw data in type `[]byte` or a file name with type `string` and you can load **as many data sources as you want**. Passing other types will simply return an error.\n\n```go\ncfg, err := ini.Load([]byte(\"raw data\"), \"filename\")\n```\n\nOr start with an empty object:\n\n```go\ncfg := ini.Empty()\n```\n\nWhen you cannot decide how many data sources to load at the beginning, you will still be able to **Append()** them later.\n\n```go\nerr := cfg.Append(\"other file\", []byte(\"other raw data\"))\n```\n\nIf you have a list of files with possibilities that some of them may not available at the time, and you don't know exactly which ones, you can use `LooseLoad` to ignore nonexistent files without returning error.\n\n```go\ncfg, err := ini.LooseLoad(\"filename\", \"filename_404\")\n```\n\nThe cool thing is, whenever the file is available to load while you're calling `Reload` method, it will be counted as usual.\n\n#### Ignore cases of key name\n\nWhen you do not care about cases of section and key names, you can use `InsensitiveLoad` to force all names to be lowercased while parsing.\n\n```go\ncfg, err := ini.InsensitiveLoad(\"filename\")\n//...\n\n// sec1 and sec2 are the exactly same section object\nsec1, err := cfg.GetSection(\"Section\")\nsec2, err := cfg.GetSection(\"SecTIOn\")\n\n// key1 and key2 are the exactly same key object\nkey1, err := cfg.GetKey(\"Key\")\nkey2, err := cfg.GetKey(\"KeY\")\n```\n\n#### MySQL-like boolean key \n\nMySQL's configuration allows a key without value as follows:\n\n```ini\n[mysqld]\n...\nskip-host-cache\nskip-name-resolve\n```\n\nBy default, this is considered as missing value. But if you know you're going to deal with those cases, you can assign advanced load options:\n\n```go\ncfg, err := LoadSources(LoadOptions{AllowBooleanKeys: true}, \"my.cnf\"))\n```\n\nThe value of those keys are always `true`, and when you save to a file, it will keep in the same foramt as you read.\n\n### Working with sections\n\nTo get a section, you would need to:\n\n```go\nsection, err := cfg.GetSection(\"section name\")\n```\n\nFor a shortcut for default section, just give an empty string as name:\n\n```go\nsection, err := cfg.GetSection(\"\")\n```\n\nWhen you're pretty sure the section exists, following code could make your life easier:\n\n```go\nsection := cfg.Section(\"\")\n```\n\nWhat happens when the section somehow does not exist? Don't panic, it automatically creates and returns a new section to you.\n\nTo create a new section:\n\n```go\nerr := cfg.NewSection(\"new section\")\n```\n\nTo get a list of sections or section names:\n\n```go\nsections := cfg.Sections()\nnames := cfg.SectionStrings()\n```\n\n### Working with keys\n\nTo get a key under a section:\n\n```go\nkey, err := cfg.Section(\"\").GetKey(\"key name\")\n```\n\nSame rule applies to key operations:\n\n```go\nkey := cfg.Section(\"\").Key(\"key name\")\n```\n\nTo check if a key exists:\n\n```go\nyes := cfg.Section(\"\").HasKey(\"key name\")\n```\n\nTo create a new key:\n\n```go\nerr := cfg.Section(\"\").NewKey(\"name\", \"value\")\n```\n\nTo get a list of keys or key names:\n\n```go\nkeys := cfg.Section(\"\").Keys()\nnames := cfg.Section(\"\").KeyStrings()\n```\n\nTo get a clone hash of keys and corresponding values:\n\n```go\nhash := cfg.Section(\"\").KeysHash()\n```\n\n### Working with values\n\nTo get a string value:\n\n```go\nval := cfg.Section(\"\").Key(\"key name\").String()\n```\n\nTo validate key value on the fly:\n\n```go\nval := cfg.Section(\"\").Key(\"key name\").Validate(func(in string) string {\n\tif len(in) == 0 {\n\t\treturn \"default\"\n\t}\n\treturn in\n})\n```\n\nIf you do not want any auto-transformation (such as recursive read) for the values, you can get raw value directly (this way you get much better performance):\n\n```go\nval := cfg.Section(\"\").Key(\"key name\").Value()\n```\n\nTo check if raw value exists:\n\n```go\nyes := cfg.Section(\"\").HasValue(\"test value\")\n```\n\nTo get value with types:\n\n```go\n// For boolean values:\n// true when value is: 1, t, T, TRUE, true, True, YES, yes, Yes, y, ON, on, On\n// false when value is: 0, f, F, FALSE, false, False, NO, no, No, n, OFF, off, Off\nv, err = cfg.Section(\"\").Key(\"BOOL\").Bool()\nv, err = cfg.Section(\"\").Key(\"FLOAT64\").Float64()\nv, err = cfg.Section(\"\").Key(\"INT\").Int()\nv, err = cfg.Section(\"\").Key(\"INT64\").Int64()\nv, err = cfg.Section(\"\").Key(\"UINT\").Uint()\nv, err = cfg.Section(\"\").Key(\"UINT64\").Uint64()\nv, err = cfg.Section(\"\").Key(\"TIME\").TimeFormat(time.RFC3339)\nv, err = cfg.Section(\"\").Key(\"TIME\").Time() // RFC3339\n\nv = cfg.Section(\"\").Key(\"BOOL\").MustBool()\nv = cfg.Section(\"\").Key(\"FLOAT64\").MustFloat64()\nv = cfg.Section(\"\").Key(\"INT\").MustInt()\nv = cfg.Section(\"\").Key(\"INT64\").MustInt64()\nv = cfg.Section(\"\").Key(\"UINT\").MustUint()\nv = cfg.Section(\"\").Key(\"UINT64\").MustUint64()\nv = cfg.Section(\"\").Key(\"TIME\").MustTimeFormat(time.RFC3339)\nv = cfg.Section(\"\").Key(\"TIME\").MustTime() // RFC3339\n\n// Methods start with Must also accept one argument for default value\n// when key not found or fail to parse value to given type.\n// Except method MustString, which you have to pass a default value.\n\nv = cfg.Section(\"\").Key(\"String\").MustString(\"default\")\nv = cfg.Section(\"\").Key(\"BOOL\").MustBool(true)\nv = cfg.Section(\"\").Key(\"FLOAT64\").MustFloat64(1.25)\nv = cfg.Section(\"\").Key(\"INT\").MustInt(10)\nv = cfg.Section(\"\").Key(\"INT64\").MustInt64(99)\nv = cfg.Section(\"\").Key(\"UINT\").MustUint(3)\nv = cfg.Section(\"\").Key(\"UINT64\").MustUint64(6)\nv = cfg.Section(\"\").Key(\"TIME\").MustTimeFormat(time.RFC3339, time.Now())\nv = cfg.Section(\"\").Key(\"TIME\").MustTime(time.Now()) // RFC3339\n```\n\nWhat if my value is three-line long?\n\n```ini\n[advance]\nADDRESS = \"\"\"404 road,\nNotFound, State, 5000\nEarth\"\"\"\n```\n\nNot a problem!\n\n```go\ncfg.Section(\"advance\").Key(\"ADDRESS\").String()\n\n/* --- start ---\n404 road,\nNotFound, State, 5000\nEarth\n------  end  --- */\n```\n\nThat's cool, how about continuation lines?\n\n```ini\n[advance]\ntwo_lines = how about \\\n\tcontinuation lines?\nlots_of_lines = 1 \\\n\t2 \\\n\t3 \\\n\t4\n```\n\nPiece of cake!\n\n```go\ncfg.Section(\"advance\").Key(\"two_lines\").String() // how about continuation lines?\ncfg.Section(\"advance\").Key(\"lots_of_lines\").String() // 1 2 3 4\n```\n\nWell, I hate continuation lines, how do I disable that?\n\n```go\ncfg, err := ini.LoadSources(ini.LoadOptions{\n\tIgnoreContinuation: true,\n}, \"filename\")\n```\n\nHoly crap! \n\nNote that single quotes around values will be stripped:\n\n```ini\nfoo = \"some value\" // foo: some value\nbar = 'some value' // bar: some value\n```\n\nThat's all? Hmm, no.\n\n#### Helper methods of working with values\n\nTo get value with given candidates:\n\n```go\nv = cfg.Section(\"\").Key(\"STRING\").In(\"default\", []string{\"str\", \"arr\", \"types\"})\nv = cfg.Section(\"\").Key(\"FLOAT64\").InFloat64(1.1, []float64{1.25, 2.5, 3.75})\nv = cfg.Section(\"\").Key(\"INT\").InInt(5, []int{10, 20, 30})\nv = cfg.Section(\"\").Key(\"INT64\").InInt64(10, []int64{10, 20, 30})\nv = cfg.Section(\"\").Key(\"UINT\").InUint(4, []int{3, 6, 9})\nv = cfg.Section(\"\").Key(\"UINT64\").InUint64(8, []int64{3, 6, 9})\nv = cfg.Section(\"\").Key(\"TIME\").InTimeFormat(time.RFC3339, time.Now(), []time.Time{time1, time2, time3})\nv = cfg.Section(\"\").Key(\"TIME\").InTime(time.Now(), []time.Time{time1, time2, time3}) // RFC3339\n```\n\nDefault value will be presented if value of key is not in candidates you given, and default value does not need be one of candidates.\n\nTo validate value in a given range:\n\n```go\nvals = cfg.Section(\"\").Key(\"FLOAT64\").RangeFloat64(0.0, 1.1, 2.2)\nvals = cfg.Section(\"\").Key(\"INT\").RangeInt(0, 10, 20)\nvals = cfg.Section(\"\").Key(\"INT64\").RangeInt64(0, 10, 20)\nvals = cfg.Section(\"\").Key(\"UINT\").RangeUint(0, 3, 9)\nvals = cfg.Section(\"\").Key(\"UINT64\").RangeUint64(0, 3, 9)\nvals = cfg.Section(\"\").Key(\"TIME\").RangeTimeFormat(time.RFC3339, time.Now(), minTime, maxTime)\nvals = cfg.Section(\"\").Key(\"TIME\").RangeTime(time.Now(), minTime, maxTime) // RFC3339\n```\n\n##### Auto-split values into a slice\n\nTo use zero value of type for invalid inputs:\n\n```go\n// Input: 1.1, 2.2, 3.3, 4.4 -> [1.1 2.2 3.3 4.4]\n// Input: how, 2.2, are, you -> [0.0 2.2 0.0 0.0]\nvals = cfg.Section(\"\").Key(\"STRINGS\").Strings(\",\")\nvals = cfg.Section(\"\").Key(\"FLOAT64S\").Float64s(\",\")\nvals = cfg.Section(\"\").Key(\"INTS\").Ints(\",\")\nvals = cfg.Section(\"\").Key(\"INT64S\").Int64s(\",\")\nvals = cfg.Section(\"\").Key(\"UINTS\").Uints(\",\")\nvals = cfg.Section(\"\").Key(\"UINT64S\").Uint64s(\",\")\nvals = cfg.Section(\"\").Key(\"TIMES\").Times(\",\")\n```\n\nTo exclude invalid values out of result slice:\n\n```go\n// Input: 1.1, 2.2, 3.3, 4.4 -> [1.1 2.2 3.3 4.4]\n// Input: how, 2.2, are, you -> [2.2]\nvals = cfg.Section(\"\").Key(\"FLOAT64S\").ValidFloat64s(\",\")\nvals = cfg.Section(\"\").Key(\"INTS\").ValidInts(\",\")\nvals = cfg.Section(\"\").Key(\"INT64S\").ValidInt64s(\",\")\nvals = cfg.Section(\"\").Key(\"UINTS\").ValidUints(\",\")\nvals = cfg.Section(\"\").Key(\"UINT64S\").ValidUint64s(\",\")\nvals = cfg.Section(\"\").Key(\"TIMES\").ValidTimes(\",\")\n```\n\nOr to return nothing but error when have invalid inputs:\n\n```go\n// Input: 1.1, 2.2, 3.3, 4.4 -> [1.1 2.2 3.3 4.4]\n// Input: how, 2.2, are, you -> error\nvals = cfg.Section(\"\").Key(\"FLOAT64S\").StrictFloat64s(\",\")\nvals = cfg.Section(\"\").Key(\"INTS\").StrictInts(\",\")\nvals = cfg.Section(\"\").Key(\"INT64S\").StrictInt64s(\",\")\nvals = cfg.Section(\"\").Key(\"UINTS\").StrictUints(\",\")\nvals = cfg.Section(\"\").Key(\"UINT64S\").StrictUint64s(\",\")\nvals = cfg.Section(\"\").Key(\"TIMES\").StrictTimes(\",\")\n```\n\n### Save your configuration\n\nFinally, it's time to save your configuration to somewhere.\n\nA typical way to save configuration is writing it to a file:\n\n```go\n// ...\nerr = cfg.SaveTo(\"my.ini\")\nerr = cfg.SaveToIndent(\"my.ini\", \"\\t\")\n```\n\nAnother way to save is writing to a `io.Writer` interface:\n\n```go\n// ...\ncfg.WriteTo(writer)\ncfg.WriteToIndent(writer, \"\\t\")\n```\n\n## Advanced Usage\n\n### Recursive Values\n\nFor all value of keys, there is a special syntax `%(<name>)s`, where `<name>` is the key name in same section or default section, and `%(<name>)s` will be replaced by corresponding value(empty string if key not found). You can use this syntax at most 99 level of recursions.\n\n```ini\nNAME = ini\n\n[author]\nNAME = Unknwon\nGITHUB = https://github.com/%(NAME)s\n\n[package]\nFULL_NAME = github.com/go-ini/%(NAME)s\n```\n\n```go\ncfg.Section(\"author\").Key(\"GITHUB\").String()\t\t// https://github.com/Unknwon\ncfg.Section(\"package\").Key(\"FULL_NAME\").String()\t// github.com/go-ini/ini\n```\n\n### Parent-child Sections\n\nYou can use `.` in section name to indicate parent-child relationship between two or more sections. If the key not found in the child section, library will try again on its parent section until there is no parent section.\n\n```ini\nNAME = ini\nVERSION = v1\nIMPORT_PATH = gopkg.in/%(NAME)s.%(VERSION)s\n\n[package]\nCLONE_URL = https://%(IMPORT_PATH)s\n\n[package.sub]\n```\n\n```go\ncfg.Section(\"package.sub\").Key(\"CLONE_URL\").String()\t// https://gopkg.in/ini.v1\n```\n\n#### Retrieve parent keys available to a child section\n\n```go\ncfg.Section(\"package.sub\").ParentKeys() // [\"CLONE_URL\"]\n```\n\n### Auto-increment Key Names\n\nIf key name is `-` in data source, then it would be seen as special syntax for auto-increment key name start from 1, and every section is independent on counter.\n\n```ini\n[features]\n-: Support read/write comments of keys and sections\n-: Support auto-increment of key names\n-: Support load multiple files to overwrite key values\n```\n\n```go\ncfg.Section(\"features\").KeyStrings()\t// []{\"#1\", \"#2\", \"#3\"}\n```\n\n### Map To Struct\n\nWant more objective way to play with INI? Cool.\n\n```ini\nName = Unknwon\nage = 21\nMale = true\nBorn = 1993-01-01T20:17:05Z\n\n[Note]\nContent = Hi is a good man!\nCities = HangZhou, Boston\n```\n\n```go\ntype Note struct {\n\tContent string\n\tCities  []string\n}\n\ntype Person struct {\n\tName string\n\tAge  int `ini:\"age\"`\n\tMale bool\n\tBorn time.Time\n\tNote\n\tCreated time.Time `ini:\"-\"`\n}\n\nfunc main() {\n\tcfg, err := ini.Load(\"path/to/ini\")\n\t// ...\n\tp := new(Person)\n\terr = cfg.MapTo(p)\n\t// ...\n\n\t// Things can be simpler.\n\terr = ini.MapTo(p, \"path/to/ini\")\n\t// ...\n\n\t// Just map a section? Fine.\n\tn := new(Note)\n\terr = cfg.Section(\"Note\").MapTo(n)\n\t// ...\n}\n```\n\nCan I have default value for field? Absolutely.\n\nAssign it before you map to struct. It will keep the value as it is if the key is not presented or got wrong type.\n\n```go\n// ...\np := &Person{\n\tName: \"Joe\",\n}\n// ...\n```\n\nIt's really cool, but what's the point if you can't give me my file back from struct?\n\n### Reflect From Struct\n\nWhy not?\n\n```go\ntype Embeded struct {\n\tDates  []time.Time `delim:\"|\"`\n\tPlaces []string    `ini:\"places,omitempty\"`\n\tNone   []int       `ini:\",omitempty\"`\n}\n\ntype Author struct {\n\tName      string `ini:\"NAME\"`\n\tMale      bool\n\tAge       int\n\tGPA       float64\n\tNeverMind string `ini:\"-\"`\n\t*Embeded\n}\n\nfunc main() {\n\ta := &Author{\"Unknwon\", true, 21, 2.8, \"\",\n\t\t&Embeded{\n\t\t\t[]time.Time{time.Now(), time.Now()},\n\t\t\t[]string{\"HangZhou\", \"Boston\"},\n\t\t\t[]int{},\n\t\t}}\n\tcfg := ini.Empty()\n\terr = ini.ReflectFrom(cfg, a)\n\t// ...\n}\n```\n\nSo, what do I get?\n\n```ini\nNAME = Unknwon\nMale = true\nAge = 21\nGPA = 2.8\n\n[Embeded]\nDates = 2015-08-07T22:14:22+08:00|2015-08-07T22:14:22+08:00\nplaces = HangZhou,Boston\n```\n\n#### Name Mapper\n\nTo save your time and make your code cleaner, this library supports [`NameMapper`](https://gowalker.org/gopkg.in/ini.v1#NameMapper) between struct field and actual section and key name.\n\nThere are 2 built-in name mappers:\n\n- `AllCapsUnderscore`: it converts to format `ALL_CAPS_UNDERSCORE` then match section or key.\n- `TitleUnderscore`: it converts to format `title_underscore` then match section or key.\n\nTo use them:\n\n```go\ntype Info struct {\n\tPackageName string\n}\n\nfunc main() {\n\terr = ini.MapToWithMapper(&Info{}, ini.TitleUnderscore, []byte(\"package_name=ini\"))\n\t// ...\n\n\tcfg, err := ini.Load([]byte(\"PACKAGE_NAME=ini\"))\n\t// ...\n\tinfo := new(Info)\n\tcfg.NameMapper = ini.AllCapsUnderscore\n\terr = cfg.MapTo(info)\n\t// ...\n}\n```\n\nSame rules of name mapper apply to `ini.ReflectFromWithMapper` function.\n\n#### Value Mapper\n\nTo expand values (e.g. from environment variables), you can use the `ValueMapper` to transform values:\n\n```go\ntype Env struct {\n\tFoo string `ini:\"foo\"`\n}\n\nfunc main() {\n\tcfg, err := ini.Load([]byte(\"[env]\\nfoo = ${MY_VAR}\\n\")\n\tcfg.ValueMapper = os.ExpandEnv\n\t// ...\n\tenv := &Env{}\n\terr = cfg.Section(\"env\").MapTo(env)\n}\n```\n\nThis would set the value of `env.Foo` to the value of the environment variable `MY_VAR`.\n\n#### Other Notes On Map/Reflect\n\nAny embedded struct is treated as a section by default, and there is no automatic parent-child relations in map/reflect feature:\n\n```go\ntype Child struct {\n\tAge string\n}\n\ntype Parent struct {\n\tName string\n\tChild\n}\n\ntype Config struct {\n\tCity string\n\tParent\n}\n```\n\nExample configuration:\n\n```ini\nCity = Boston\n\n[Parent]\nName = Unknwon\n\n[Child]\nAge = 21\n```\n\nWhat if, yes, I'm paranoid, I want embedded struct to be in the same section. Well, all roads lead to Rome.\n\n```go\ntype Child struct {\n\tAge string\n}\n\ntype Parent struct {\n\tName string\n\tChild `ini:\"Parent\"`\n}\n\ntype Config struct {\n\tCity string\n\tParent\n}\n```\n\nExample configuration:\n\n```ini\nCity = Boston\n\n[Parent]\nName = Unknwon\nAge = 21\n```\n\n## Getting Help\n\n- [API Documentation](https://gowalker.org/gopkg.in/ini.v1)\n- [File An Issue](https://github.com/go-ini/ini/issues/new)\n\n## FAQs\n\n### What does `BlockMode` field do?\n\nBy default, library lets you read and write values so we need a locker to make sure your data is safe. But in cases that you are very sure about only reading data through the library, you can set `cfg.BlockMode = false` to speed up read operations about **50-70%** faster.\n\n### Why another INI library?\n\nMany people are using my another INI library [goconfig](https://github.com/Unknwon/goconfig), so the reason for this one is I would like to make more Go style code. Also when you set `cfg.BlockMode = false`, this one is about **10-30%** faster.\n\nTo make those changes I have to confirm API broken, so it's safer to keep it in another place and start using `gopkg.in` to version my package at this time.(PS: shorter import path)\n\n## License\n\nThis project is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text.\n"
  },
  {
    "path": "vendor/github.com/go-ini/ini/README_ZH.md",
    "content": "本包提供了 Go 语言中读写 INI 文件的功能。\n\n## 功能特性\n\n- 支持覆盖加载多个数据源（`[]byte` 或文件）\n- 支持递归读取键值\n- 支持读取父子分区\n- 支持读取自增键名\n- 支持读取多行的键值\n- 支持大量辅助方法\n- 支持在读取时直接转换为 Go 语言类型\n- 支持读取和 **写入** 分区和键的注释\n- 轻松操作分区、键值和注释\n- 在保存文件时分区和键值会保持原有的顺序\n\n## 下载安装\n\n使用一个特定版本：\n\n    go get gopkg.in/ini.v1\n\n使用最新版：\n\n\tgo get github.com/go-ini/ini\n\n如需更新请添加 `-u` 选项。\n\n### 测试安装\n\n如果您想要在自己的机器上运行测试，请使用 `-t` 标记：\n\n\tgo get -t gopkg.in/ini.v1\n\n如需更新请添加 `-u` 选项。\n\n## 开始使用\n\n### 从数据源加载\n\n一个 **数据源** 可以是 `[]byte` 类型的原始数据，或 `string` 类型的文件路径。您可以加载 **任意多个** 数据源。如果您传递其它类型的数据源，则会直接返回错误。\n\n```go\ncfg, err := ini.Load([]byte(\"raw data\"), \"filename\")\n```\n\n或者从一个空白的文件开始：\n\n```go\ncfg := ini.Empty()\n```\n\n当您在一开始无法决定需要加载哪些数据源时，仍可以使用 **Append()** 在需要的时候加载它们。\n\n```go\nerr := cfg.Append(\"other file\", []byte(\"other raw data\"))\n```\n\n当您想要加载一系列文件，但是不能够确定其中哪些文件是不存在的，可以通过调用函数 `LooseLoad` 来忽略它们（`Load` 会因为文件不存在而返回错误）：\n\n```go\ncfg, err := ini.LooseLoad(\"filename\", \"filename_404\")\n```\n\n更牛逼的是，当那些之前不存在的文件在重新调用 `Reload` 方法的时候突然出现了，那么它们会被正常加载。\n\n#### 忽略键名的大小写\n\n有时候分区和键的名称大小写混合非常烦人，这个时候就可以通过 `InsensitiveLoad` 将所有分区和键名在读取里强制转换为小写：\n\n```go\ncfg, err := ini.InsensitiveLoad(\"filename\")\n//...\n\n// sec1 和 sec2 指向同一个分区对象\nsec1, err := cfg.GetSection(\"Section\")\nsec2, err := cfg.GetSection(\"SecTIOn\")\n\n// key1 和 key2 指向同一个键对象\nkey1, err := cfg.GetKey(\"Key\")\nkey2, err := cfg.GetKey(\"KeY\")\n```\n\n#### 类似 MySQL 配置中的布尔值键\n\nMySQL 的配置文件中会出现没有具体值的布尔类型的键：\n\n```ini\n[mysqld]\n...\nskip-host-cache\nskip-name-resolve\n```\n\n默认情况下这被认为是缺失值而无法完成解析，但可以通过高级的加载选项对它们进行处理：\n\n```go\ncfg, err := LoadSources(LoadOptions{AllowBooleanKeys: true}, \"my.cnf\"))\n```\n\n这些键的值永远为 `true`，且在保存到文件时也只会输出键名。\n\n### 操作分区（Section）\n\n获取指定分区：\n\n```go\nsection, err := cfg.GetSection(\"section name\")\n```\n\n如果您想要获取默认分区，则可以用空字符串代替分区名：\n\n```go\nsection, err := cfg.GetSection(\"\")\n```\n\n当您非常确定某个分区是存在的，可以使用以下简便方法：\n\n```go\nsection := cfg.Section(\"\")\n```\n\n如果不小心判断错了，要获取的分区其实是不存在的，那会发生什么呢？没事的，它会自动创建并返回一个对应的分区对象给您。\n\n创建一个分区：\n\n```go\nerr := cfg.NewSection(\"new section\")\n```\n\n获取所有分区对象或名称：\n\n```go\nsections := cfg.Sections()\nnames := cfg.SectionStrings()\n```\n\n### 操作键（Key）\n\n获取某个分区下的键：\n\n```go\nkey, err := cfg.Section(\"\").GetKey(\"key name\")\n```\n\n和分区一样，您也可以直接获取键而忽略错误处理：\n\n```go\nkey := cfg.Section(\"\").Key(\"key name\")\n```\n\n判断某个键是否存在：\n\n```go\nyes := cfg.Section(\"\").HasKey(\"key name\")\n```\n\n创建一个新的键：\n\n```go\nerr := cfg.Section(\"\").NewKey(\"name\", \"value\")\n```\n\n获取分区下的所有键或键名：\n\n```go\nkeys := cfg.Section(\"\").Keys()\nnames := cfg.Section(\"\").KeyStrings()\n```\n\n获取分区下的所有键值对的克隆：\n\n```go\nhash := cfg.Section(\"\").KeysHash()\n```\n\n### 操作键值（Value）\n\n获取一个类型为字符串（string）的值：\n\n```go\nval := cfg.Section(\"\").Key(\"key name\").String()\n```\n\n获取值的同时通过自定义函数进行处理验证：\n\n```go\nval := cfg.Section(\"\").Key(\"key name\").Validate(func(in string) string {\n\tif len(in) == 0 {\n\t\treturn \"default\"\n\t}\n\treturn in\n})\n```\n\n如果您不需要任何对值的自动转变功能（例如递归读取），可以直接获取原值（这种方式性能最佳）：\n\n```go\nval := cfg.Section(\"\").Key(\"key name\").Value()\n```\n\n判断某个原值是否存在：\n\n```go\nyes := cfg.Section(\"\").HasValue(\"test value\")\n```\n\n获取其它类型的值：\n\n```go\n// 布尔值的规则：\n// true 当值为：1, t, T, TRUE, true, True, YES, yes, Yes, y, ON, on, On\n// false 当值为：0, f, F, FALSE, false, False, NO, no, No, n, OFF, off, Off\nv, err = cfg.Section(\"\").Key(\"BOOL\").Bool()\nv, err = cfg.Section(\"\").Key(\"FLOAT64\").Float64()\nv, err = cfg.Section(\"\").Key(\"INT\").Int()\nv, err = cfg.Section(\"\").Key(\"INT64\").Int64()\nv, err = cfg.Section(\"\").Key(\"UINT\").Uint()\nv, err = cfg.Section(\"\").Key(\"UINT64\").Uint64()\nv, err = cfg.Section(\"\").Key(\"TIME\").TimeFormat(time.RFC3339)\nv, err = cfg.Section(\"\").Key(\"TIME\").Time() // RFC3339\n\nv = cfg.Section(\"\").Key(\"BOOL\").MustBool()\nv = cfg.Section(\"\").Key(\"FLOAT64\").MustFloat64()\nv = cfg.Section(\"\").Key(\"INT\").MustInt()\nv = cfg.Section(\"\").Key(\"INT64\").MustInt64()\nv = cfg.Section(\"\").Key(\"UINT\").MustUint()\nv = cfg.Section(\"\").Key(\"UINT64\").MustUint64()\nv = cfg.Section(\"\").Key(\"TIME\").MustTimeFormat(time.RFC3339)\nv = cfg.Section(\"\").Key(\"TIME\").MustTime() // RFC3339\n\n// 由 Must 开头的方法名允许接收一个相同类型的参数来作为默认值，\n// 当键不存在或者转换失败时，则会直接返回该默认值。\n// 但是，MustString 方法必须传递一个默认值。\n\nv = cfg.Seciont(\"\").Key(\"String\").MustString(\"default\")\nv = cfg.Section(\"\").Key(\"BOOL\").MustBool(true)\nv = cfg.Section(\"\").Key(\"FLOAT64\").MustFloat64(1.25)\nv = cfg.Section(\"\").Key(\"INT\").MustInt(10)\nv = cfg.Section(\"\").Key(\"INT64\").MustInt64(99)\nv = cfg.Section(\"\").Key(\"UINT\").MustUint(3)\nv = cfg.Section(\"\").Key(\"UINT64\").MustUint64(6)\nv = cfg.Section(\"\").Key(\"TIME\").MustTimeFormat(time.RFC3339, time.Now())\nv = cfg.Section(\"\").Key(\"TIME\").MustTime(time.Now()) // RFC3339\n```\n\n如果我的值有好多行怎么办？\n\n```ini\n[advance]\nADDRESS = \"\"\"404 road,\nNotFound, State, 5000\nEarth\"\"\"\n```\n\n嗯哼？小 case！\n\n```go\ncfg.Section(\"advance\").Key(\"ADDRESS\").String()\n\n/* --- start ---\n404 road,\nNotFound, State, 5000\nEarth\n------  end  --- */\n```\n\n赞爆了！那要是我属于一行的内容写不下想要写到第二行怎么办？\n\n```ini\n[advance]\ntwo_lines = how about \\\n\tcontinuation lines?\nlots_of_lines = 1 \\\n\t2 \\\n\t3 \\\n\t4\n```\n\n简直是小菜一碟！\n\n```go\ncfg.Section(\"advance\").Key(\"two_lines\").String() // how about continuation lines?\ncfg.Section(\"advance\").Key(\"lots_of_lines\").String() // 1 2 3 4\n```\n\n可是我有时候觉得两行连在一起特别没劲，怎么才能不自动连接两行呢？\n\n```go\ncfg, err := ini.LoadSources(ini.LoadOptions{\n\tIgnoreContinuation: true,\n}, \"filename\")\n```\n\n哇靠给力啊！\n\n需要注意的是，值两侧的单引号会被自动剔除：\n\n```ini\nfoo = \"some value\" // foo: some value\nbar = 'some value' // bar: some value\n```\n\n这就是全部了？哈哈，当然不是。\n\n#### 操作键值的辅助方法\n\n获取键值时设定候选值：\n\n```go\nv = cfg.Section(\"\").Key(\"STRING\").In(\"default\", []string{\"str\", \"arr\", \"types\"})\nv = cfg.Section(\"\").Key(\"FLOAT64\").InFloat64(1.1, []float64{1.25, 2.5, 3.75})\nv = cfg.Section(\"\").Key(\"INT\").InInt(5, []int{10, 20, 30})\nv = cfg.Section(\"\").Key(\"INT64\").InInt64(10, []int64{10, 20, 30})\nv = cfg.Section(\"\").Key(\"UINT\").InUint(4, []int{3, 6, 9})\nv = cfg.Section(\"\").Key(\"UINT64\").InUint64(8, []int64{3, 6, 9})\nv = cfg.Section(\"\").Key(\"TIME\").InTimeFormat(time.RFC3339, time.Now(), []time.Time{time1, time2, time3})\nv = cfg.Section(\"\").Key(\"TIME\").InTime(time.Now(), []time.Time{time1, time2, time3}) // RFC3339\n```\n\n如果获取到的值不是候选值的任意一个，则会返回默认值，而默认值不需要是候选值中的一员。\n\n验证获取的值是否在指定范围内：\n\n```go\nvals = cfg.Section(\"\").Key(\"FLOAT64\").RangeFloat64(0.0, 1.1, 2.2)\nvals = cfg.Section(\"\").Key(\"INT\").RangeInt(0, 10, 20)\nvals = cfg.Section(\"\").Key(\"INT64\").RangeInt64(0, 10, 20)\nvals = cfg.Section(\"\").Key(\"UINT\").RangeUint(0, 3, 9)\nvals = cfg.Section(\"\").Key(\"UINT64\").RangeUint64(0, 3, 9)\nvals = cfg.Section(\"\").Key(\"TIME\").RangeTimeFormat(time.RFC3339, time.Now(), minTime, maxTime)\nvals = cfg.Section(\"\").Key(\"TIME\").RangeTime(time.Now(), minTime, maxTime) // RFC3339\n```\n\n##### 自动分割键值到切片（slice）\n\n当存在无效输入时，使用零值代替：\n\n```go\n// Input: 1.1, 2.2, 3.3, 4.4 -> [1.1 2.2 3.3 4.4]\n// Input: how, 2.2, are, you -> [0.0 2.2 0.0 0.0]\nvals = cfg.Section(\"\").Key(\"STRINGS\").Strings(\",\")\nvals = cfg.Section(\"\").Key(\"FLOAT64S\").Float64s(\",\")\nvals = cfg.Section(\"\").Key(\"INTS\").Ints(\",\")\nvals = cfg.Section(\"\").Key(\"INT64S\").Int64s(\",\")\nvals = cfg.Section(\"\").Key(\"UINTS\").Uints(\",\")\nvals = cfg.Section(\"\").Key(\"UINT64S\").Uint64s(\",\")\nvals = cfg.Section(\"\").Key(\"TIMES\").Times(\",\")\n```\n\n从结果切片中剔除无效输入：\n\n```go\n// Input: 1.1, 2.2, 3.3, 4.4 -> [1.1 2.2 3.3 4.4]\n// Input: how, 2.2, are, you -> [2.2]\nvals = cfg.Section(\"\").Key(\"FLOAT64S\").ValidFloat64s(\",\")\nvals = cfg.Section(\"\").Key(\"INTS\").ValidInts(\",\")\nvals = cfg.Section(\"\").Key(\"INT64S\").ValidInt64s(\",\")\nvals = cfg.Section(\"\").Key(\"UINTS\").ValidUints(\",\")\nvals = cfg.Section(\"\").Key(\"UINT64S\").ValidUint64s(\",\")\nvals = cfg.Section(\"\").Key(\"TIMES\").ValidTimes(\",\")\n```\n\n当存在无效输入时，直接返回错误：\n\n```go\n// Input: 1.1, 2.2, 3.3, 4.4 -> [1.1 2.2 3.3 4.4]\n// Input: how, 2.2, are, you -> error\nvals = cfg.Section(\"\").Key(\"FLOAT64S\").StrictFloat64s(\",\")\nvals = cfg.Section(\"\").Key(\"INTS\").StrictInts(\",\")\nvals = cfg.Section(\"\").Key(\"INT64S\").StrictInt64s(\",\")\nvals = cfg.Section(\"\").Key(\"UINTS\").StrictUints(\",\")\nvals = cfg.Section(\"\").Key(\"UINT64S\").StrictUint64s(\",\")\nvals = cfg.Section(\"\").Key(\"TIMES\").StrictTimes(\",\")\n```\n\n### 保存配置\n\n终于到了这个时刻，是时候保存一下配置了。\n\n比较原始的做法是输出配置到某个文件：\n\n```go\n// ...\nerr = cfg.SaveTo(\"my.ini\")\nerr = cfg.SaveToIndent(\"my.ini\", \"\\t\")\n```\n\n另一个比较高级的做法是写入到任何实现 `io.Writer` 接口的对象中：\n\n```go\n// ...\ncfg.WriteTo(writer)\ncfg.WriteToIndent(writer, \"\\t\")\n```\n\n### 高级用法\n\n#### 递归读取键值\n\n在获取所有键值的过程中，特殊语法 `%(<name>)s` 会被应用，其中 `<name>` 可以是相同分区或者默认分区下的键名。字符串 `%(<name>)s` 会被相应的键值所替代，如果指定的键不存在，则会用空字符串替代。您可以最多使用 99 层的递归嵌套。\n\n```ini\nNAME = ini\n\n[author]\nNAME = Unknwon\nGITHUB = https://github.com/%(NAME)s\n\n[package]\nFULL_NAME = github.com/go-ini/%(NAME)s\n```\n\n```go\ncfg.Section(\"author\").Key(\"GITHUB\").String()\t\t// https://github.com/Unknwon\ncfg.Section(\"package\").Key(\"FULL_NAME\").String()\t// github.com/go-ini/ini\n```\n\n#### 读取父子分区\n\n您可以在分区名称中使用 `.` 来表示两个或多个分区之间的父子关系。如果某个键在子分区中不存在，则会去它的父分区中再次寻找，直到没有父分区为止。\n\n```ini\nNAME = ini\nVERSION = v1\nIMPORT_PATH = gopkg.in/%(NAME)s.%(VERSION)s\n\n[package]\nCLONE_URL = https://%(IMPORT_PATH)s\n\n[package.sub]\n```\n\n```go\ncfg.Section(\"package.sub\").Key(\"CLONE_URL\").String()\t// https://gopkg.in/ini.v1\n```\n\n#### 获取上级父分区下的所有键名\n\n```go\ncfg.Section(\"package.sub\").ParentKeys() // [\"CLONE_URL\"]\n```\n\n#### 读取自增键名\n\n如果数据源中的键名为 `-`，则认为该键使用了自增键名的特殊语法。计数器从 1 开始，并且分区之间是相互独立的。\n\n```ini\n[features]\n-: Support read/write comments of keys and sections\n-: Support auto-increment of key names\n-: Support load multiple files to overwrite key values\n```\n\n```go\ncfg.Section(\"features\").KeyStrings()\t// []{\"#1\", \"#2\", \"#3\"}\n```\n\n### 映射到结构\n\n想要使用更加面向对象的方式玩转 INI 吗？好主意。\n\n```ini\nName = Unknwon\nage = 21\nMale = true\nBorn = 1993-01-01T20:17:05Z\n\n[Note]\nContent = Hi is a good man!\nCities = HangZhou, Boston\n```\n\n```go\ntype Note struct {\n\tContent string\n\tCities  []string\n}\n\ntype Person struct {\n\tName string\n\tAge  int `ini:\"age\"`\n\tMale bool\n\tBorn time.Time\n\tNote\n\tCreated time.Time `ini:\"-\"`\n}\n\nfunc main() {\n\tcfg, err := ini.Load(\"path/to/ini\")\n\t// ...\n\tp := new(Person)\n\terr = cfg.MapTo(p)\n\t// ...\n\n\t// 一切竟可以如此的简单。\n\terr = ini.MapTo(p, \"path/to/ini\")\n\t// ...\n\n\t// 嗯哼？只需要映射一个分区吗？\n\tn := new(Note)\n\terr = cfg.Section(\"Note\").MapTo(n)\n\t// ...\n}\n```\n\n结构的字段怎么设置默认值呢？很简单，只要在映射之前对指定字段进行赋值就可以了。如果键未找到或者类型错误，该值不会发生改变。\n\n```go\n// ...\np := &Person{\n\tName: \"Joe\",\n}\n// ...\n```\n\n这样玩 INI 真的好酷啊！然而，如果不能还给我原来的配置文件，有什么卵用？\n\n### 从结构反射\n\n可是，我有说不能吗？\n\n```go\ntype Embeded struct {\n\tDates  []time.Time `delim:\"|\"`\n\tPlaces []string    `ini:\"places,omitempty\"`\n\tNone   []int       `ini:\",omitempty\"`\n}\n\ntype Author struct {\n\tName      string `ini:\"NAME\"`\n\tMale      bool\n\tAge       int\n\tGPA       float64\n\tNeverMind string `ini:\"-\"`\n\t*Embeded\n}\n\nfunc main() {\n\ta := &Author{\"Unknwon\", true, 21, 2.8, \"\",\n\t\t&Embeded{\n\t\t\t[]time.Time{time.Now(), time.Now()},\n\t\t\t[]string{\"HangZhou\", \"Boston\"},\n\t\t\t[]int{},\n\t\t}}\n\tcfg := ini.Empty()\n\terr = ini.ReflectFrom(cfg, a)\n\t// ...\n}\n```\n\n瞧瞧，奇迹发生了。\n\n```ini\nNAME = Unknwon\nMale = true\nAge = 21\nGPA = 2.8\n\n[Embeded]\nDates = 2015-08-07T22:14:22+08:00|2015-08-07T22:14:22+08:00\nplaces = HangZhou,Boston\n```\n\n#### 名称映射器（Name Mapper）\n\n为了节省您的时间并简化代码，本库支持类型为 [`NameMapper`](https://gowalker.org/gopkg.in/ini.v1#NameMapper) 的名称映射器，该映射器负责结构字段名与分区名和键名之间的映射。\n\n目前有 2 款内置的映射器：\n\n- `AllCapsUnderscore`：该映射器将字段名转换至格式 `ALL_CAPS_UNDERSCORE` 后再去匹配分区名和键名。\n- `TitleUnderscore`：该映射器将字段名转换至格式 `title_underscore` 后再去匹配分区名和键名。\n\n使用方法：\n\n```go\ntype Info struct{\n\tPackageName string\n}\n\nfunc main() {\n\terr = ini.MapToWithMapper(&Info{}, ini.TitleUnderscore, []byte(\"package_name=ini\"))\n\t// ...\n\n\tcfg, err := ini.Load([]byte(\"PACKAGE_NAME=ini\"))\n\t// ...\n\tinfo := new(Info)\n\tcfg.NameMapper = ini.AllCapsUnderscore\n\terr = cfg.MapTo(info)\n\t// ...\n}\n```\n\n使用函数 `ini.ReflectFromWithMapper` 时也可应用相同的规则。\n\n#### 值映射器（Value Mapper）\n\n值映射器允许使用一个自定义函数自动展开值的具体内容，例如：运行时获取环境变量：\n\n```go\ntype Env struct {\n\tFoo string `ini:\"foo\"`\n}\n\nfunc main() {\n\tcfg, err := ini.Load([]byte(\"[env]\\nfoo = ${MY_VAR}\\n\")\n\tcfg.ValueMapper = os.ExpandEnv\n\t// ...\n\tenv := &Env{}\n\terr = cfg.Section(\"env\").MapTo(env)\n}\n```\n\n本例中，`env.Foo` 将会是运行时所获取到环境变量 `MY_VAR` 的值。\n\n#### 映射/反射的其它说明\n\n任何嵌入的结构都会被默认认作一个不同的分区，并且不会自动产生所谓的父子分区关联：\n\n```go\ntype Child struct {\n\tAge string\n}\n\ntype Parent struct {\n\tName string\n\tChild\n}\n\ntype Config struct {\n\tCity string\n\tParent\n}\n```\n\n示例配置文件：\n\n```ini\nCity = Boston\n\n[Parent]\nName = Unknwon\n\n[Child]\nAge = 21\n```\n\n很好，但是，我就是要嵌入结构也在同一个分区。好吧，你爹是李刚！\n\n```go\ntype Child struct {\n\tAge string\n}\n\ntype Parent struct {\n\tName string\n\tChild `ini:\"Parent\"`\n}\n\ntype Config struct {\n\tCity string\n\tParent\n}\n```\n\n示例配置文件：\n\n```ini\nCity = Boston\n\n[Parent]\nName = Unknwon\nAge = 21\n```\n\n## 获取帮助\n\n- [API 文档](https://gowalker.org/gopkg.in/ini.v1)\n- [创建工单](https://github.com/go-ini/ini/issues/new)\n\n## 常见问题\n\n### 字段 `BlockMode` 是什么？\n\n默认情况下，本库会在您进行读写操作时采用锁机制来确保数据时间。但在某些情况下，您非常确定只进行读操作。此时，您可以通过设置 `cfg.BlockMode = false` 来将读操作提升大约 **50-70%** 的性能。\n\n### 为什么要写另一个 INI 解析库？\n\n许多人都在使用我的 [goconfig](https://github.com/Unknwon/goconfig) 来完成对 INI 文件的操作，但我希望使用更加 Go 风格的代码。并且当您设置 `cfg.BlockMode = false` 时，会有大约 **10-30%** 的性能提升。\n\n为了做出这些改变，我必须对 API 进行破坏，所以新开一个仓库是最安全的做法。除此之外，本库直接使用 `gopkg.in` 来进行版本化发布。（其实真相是导入路径更短了）\n"
  },
  {
    "path": "vendor/github.com/go-ini/ini/error.go",
    "content": "// Copyright 2016 Unknwon\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use this file except in compliance with the License. You may obtain\n// a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n// License for the specific language governing permissions and limitations\n// under the License.\n\npackage ini\n\nimport (\n\t\"fmt\"\n)\n\ntype ErrDelimiterNotFound struct {\n\tLine string\n}\n\nfunc IsErrDelimiterNotFound(err error) bool {\n\t_, ok := err.(ErrDelimiterNotFound)\n\treturn ok\n}\n\nfunc (err ErrDelimiterNotFound) Error() string {\n\treturn fmt.Sprintf(\"key-value delimiter not found: %s\", err.Line)\n}\n"
  },
  {
    "path": "vendor/github.com/go-ini/ini/ini.go",
    "content": "// Copyright 2014 Unknwon\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use this file except in compliance with the License. You may obtain\n// a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n// License for the specific language governing permissions and limitations\n// under the License.\n\n// Package ini provides INI file read and write functionality in Go.\npackage ini\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"regexp\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n)\n\nconst (\n\t// Name for default section. You can use this constant or the string literal.\n\t// In most of cases, an empty string is all you need to access the section.\n\tDEFAULT_SECTION = \"DEFAULT\"\n\n\t// Maximum allowed depth when recursively substituing variable names.\n\t_DEPTH_VALUES = 99\n\t_VERSION      = \"1.21.1\"\n)\n\n// Version returns current package version literal.\nfunc Version() string {\n\treturn _VERSION\n}\n\nvar (\n\t// Delimiter to determine or compose a new line.\n\t// This variable will be changed to \"\\r\\n\" automatically on Windows\n\t// at package init time.\n\tLineBreak = \"\\n\"\n\n\t// Variable regexp pattern: %(variable)s\n\tvarPattern = regexp.MustCompile(`%\\(([^\\)]+)\\)s`)\n\n\t// Indicate whether to align \"=\" sign with spaces to produce pretty output\n\t// or reduce all possible spaces for compact format.\n\tPrettyFormat = true\n\n\t// Explicitly write DEFAULT section header\n\tDefaultHeader = false\n)\n\nfunc init() {\n\tif runtime.GOOS == \"windows\" {\n\t\tLineBreak = \"\\r\\n\"\n\t}\n}\n\nfunc inSlice(str string, s []string) bool {\n\tfor _, v := range s {\n\t\tif str == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// dataSource is an interface that returns object which can be read and closed.\ntype dataSource interface {\n\tReadCloser() (io.ReadCloser, error)\n}\n\n// sourceFile represents an object that contains content on the local file system.\ntype sourceFile struct {\n\tname string\n}\n\nfunc (s sourceFile) ReadCloser() (_ io.ReadCloser, err error) {\n\treturn os.Open(s.name)\n}\n\ntype bytesReadCloser struct {\n\treader io.Reader\n}\n\nfunc (rc *bytesReadCloser) Read(p []byte) (n int, err error) {\n\treturn rc.reader.Read(p)\n}\n\nfunc (rc *bytesReadCloser) Close() error {\n\treturn nil\n}\n\n// sourceData represents an object that contains content in memory.\ntype sourceData struct {\n\tdata []byte\n}\n\nfunc (s *sourceData) ReadCloser() (io.ReadCloser, error) {\n\treturn &bytesReadCloser{bytes.NewReader(s.data)}, nil\n}\n\n// File represents a combination of a or more INI file(s) in memory.\ntype File struct {\n\t// Should make things safe, but sometimes doesn't matter.\n\tBlockMode bool\n\t// Make sure data is safe in multiple goroutines.\n\tlock sync.RWMutex\n\n\t// Allow combination of multiple data sources.\n\tdataSources []dataSource\n\t// Actual data is stored here.\n\tsections map[string]*Section\n\n\t// To keep data in order.\n\tsectionList []string\n\n\toptions LoadOptions\n\n\tNameMapper\n\tValueMapper\n}\n\n// newFile initializes File object with given data sources.\nfunc newFile(dataSources []dataSource, opts LoadOptions) *File {\n\treturn &File{\n\t\tBlockMode:   true,\n\t\tdataSources: dataSources,\n\t\tsections:    make(map[string]*Section),\n\t\tsectionList: make([]string, 0, 10),\n\t\toptions:     opts,\n\t}\n}\n\nfunc parseDataSource(source interface{}) (dataSource, error) {\n\tswitch s := source.(type) {\n\tcase string:\n\t\treturn sourceFile{s}, nil\n\tcase []byte:\n\t\treturn &sourceData{s}, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"error parsing data source: unknown type '%s'\", s)\n\t}\n}\n\ntype LoadOptions struct {\n\t// Loose indicates whether the parser should ignore nonexistent files or return error.\n\tLoose bool\n\t// Insensitive indicates whether the parser forces all section and key names to lowercase.\n\tInsensitive bool\n\t// IgnoreContinuation indicates whether to ignore continuation lines while parsing.\n\tIgnoreContinuation bool\n\t// AllowBooleanKeys indicates whether to allow boolean type keys or treat as value is missing.\n\t// This type of keys are mostly used in my.cnf.\n\tAllowBooleanKeys bool\n}\n\nfunc LoadSources(opts LoadOptions, source interface{}, others ...interface{}) (_ *File, err error) {\n\tsources := make([]dataSource, len(others)+1)\n\tsources[0], err = parseDataSource(source)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor i := range others {\n\t\tsources[i+1], err = parseDataSource(others[i])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tf := newFile(sources, opts)\n\tif err = f.Reload(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn f, nil\n}\n\n// Load loads and parses from INI data sources.\n// Arguments can be mixed of file name with string type, or raw data in []byte.\n// It will return error if list contains nonexistent files.\nfunc Load(source interface{}, others ...interface{}) (*File, error) {\n\treturn LoadSources(LoadOptions{}, source, others...)\n}\n\n// LooseLoad has exactly same functionality as Load function\n// except it ignores nonexistent files instead of returning error.\nfunc LooseLoad(source interface{}, others ...interface{}) (*File, error) {\n\treturn LoadSources(LoadOptions{Loose: true}, source, others...)\n}\n\n// InsensitiveLoad has exactly same functionality as Load function\n// except it forces all section and key names to be lowercased.\nfunc InsensitiveLoad(source interface{}, others ...interface{}) (*File, error) {\n\treturn LoadSources(LoadOptions{Insensitive: true}, source, others...)\n}\n\n// Empty returns an empty file object.\nfunc Empty() *File {\n\t// Ignore error here, we sure our data is good.\n\tf, _ := Load([]byte(\"\"))\n\treturn f\n}\n\n// NewSection creates a new section.\nfunc (f *File) NewSection(name string) (*Section, error) {\n\tif len(name) == 0 {\n\t\treturn nil, errors.New(\"error creating new section: empty section name\")\n\t} else if f.options.Insensitive && name != DEFAULT_SECTION {\n\t\tname = strings.ToLower(name)\n\t}\n\n\tif f.BlockMode {\n\t\tf.lock.Lock()\n\t\tdefer f.lock.Unlock()\n\t}\n\n\tif inSlice(name, f.sectionList) {\n\t\treturn f.sections[name], nil\n\t}\n\n\tf.sectionList = append(f.sectionList, name)\n\tf.sections[name] = newSection(f, name)\n\treturn f.sections[name], nil\n}\n\n// NewSections creates a list of sections.\nfunc (f *File) NewSections(names ...string) (err error) {\n\tfor _, name := range names {\n\t\tif _, err = f.NewSection(name); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// GetSection returns section by given name.\nfunc (f *File) GetSection(name string) (*Section, error) {\n\tif len(name) == 0 {\n\t\tname = DEFAULT_SECTION\n\t} else if f.options.Insensitive {\n\t\tname = strings.ToLower(name)\n\t}\n\n\tif f.BlockMode {\n\t\tf.lock.RLock()\n\t\tdefer f.lock.RUnlock()\n\t}\n\n\tsec := f.sections[name]\n\tif sec == nil {\n\t\treturn nil, fmt.Errorf(\"section '%s' does not exist\", name)\n\t}\n\treturn sec, nil\n}\n\n// Section assumes named section exists and returns a zero-value when not.\nfunc (f *File) Section(name string) *Section {\n\tsec, err := f.GetSection(name)\n\tif err != nil {\n\t\t// Note: It's OK here because the only possible error is empty section name,\n\t\t// but if it's empty, this piece of code won't be executed.\n\t\tsec, _ = f.NewSection(name)\n\t\treturn sec\n\t}\n\treturn sec\n}\n\n// Section returns list of Section.\nfunc (f *File) Sections() []*Section {\n\tsections := make([]*Section, len(f.sectionList))\n\tfor i := range f.sectionList {\n\t\tsections[i] = f.Section(f.sectionList[i])\n\t}\n\treturn sections\n}\n\n// SectionStrings returns list of section names.\nfunc (f *File) SectionStrings() []string {\n\tlist := make([]string, len(f.sectionList))\n\tcopy(list, f.sectionList)\n\treturn list\n}\n\n// DeleteSection deletes a section.\nfunc (f *File) DeleteSection(name string) {\n\tif f.BlockMode {\n\t\tf.lock.Lock()\n\t\tdefer f.lock.Unlock()\n\t}\n\n\tif len(name) == 0 {\n\t\tname = DEFAULT_SECTION\n\t}\n\n\tfor i, s := range f.sectionList {\n\t\tif s == name {\n\t\t\tf.sectionList = append(f.sectionList[:i], f.sectionList[i+1:]...)\n\t\t\tdelete(f.sections, name)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc (f *File) reload(s dataSource) error {\n\tr, err := s.ReadCloser()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer r.Close()\n\n\treturn f.parse(r)\n}\n\n// Reload reloads and parses all data sources.\nfunc (f *File) Reload() (err error) {\n\tfor _, s := range f.dataSources {\n\t\tif err = f.reload(s); err != nil {\n\t\t\t// In loose mode, we create an empty default section for nonexistent files.\n\t\t\tif os.IsNotExist(err) && f.options.Loose {\n\t\t\t\tf.parse(bytes.NewBuffer(nil))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// Append appends one or more data sources and reloads automatically.\nfunc (f *File) Append(source interface{}, others ...interface{}) error {\n\tds, err := parseDataSource(source)\n\tif err != nil {\n\t\treturn err\n\t}\n\tf.dataSources = append(f.dataSources, ds)\n\tfor _, s := range others {\n\t\tds, err = parseDataSource(s)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tf.dataSources = append(f.dataSources, ds)\n\t}\n\treturn f.Reload()\n}\n\n// WriteToIndent writes content into io.Writer with given indention.\n// If PrettyFormat has been set to be true,\n// it will align \"=\" sign with spaces under each section.\nfunc (f *File) WriteToIndent(w io.Writer, indent string) (n int64, err error) {\n\tequalSign := \"=\"\n\tif PrettyFormat {\n\t\tequalSign = \" = \"\n\t}\n\n\t// Use buffer to make sure target is safe until finish encoding.\n\tbuf := bytes.NewBuffer(nil)\n\tfor i, sname := range f.sectionList {\n\t\tsec := f.Section(sname)\n\t\tif len(sec.Comment) > 0 {\n\t\t\tif sec.Comment[0] != '#' && sec.Comment[0] != ';' {\n\t\t\t\tsec.Comment = \"; \" + sec.Comment\n\t\t\t}\n\t\t\tif _, err = buf.WriteString(sec.Comment + LineBreak); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t}\n\n\t\tif i > 0 || DefaultHeader {\n\t\t\tif _, err = buf.WriteString(\"[\" + sname + \"]\" + LineBreak); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t} else {\n\t\t\t// Write nothing if default section is empty\n\t\t\tif len(sec.keyList) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t// Count and generate alignment length and buffer spaces using the\n\t\t// longest key. Keys may be modifed if they contain certain characters so\n\t\t// we need to take that into account in our calculation.\n\t\talignLength := 0\n\t\tif PrettyFormat {\n\t\t\tfor _, kname := range sec.keyList {\n\t\t\t\tkeyLength := len(kname)\n\t\t\t\t// First case will surround key by ` and second by \"\"\"\n\t\t\t\tif strings.ContainsAny(kname, \"\\\"=:\") {\n\t\t\t\t\tkeyLength += 2\n\t\t\t\t} else if strings.Contains(kname, \"`\") {\n\t\t\t\t\tkeyLength += 6\n\t\t\t\t}\n\n\t\t\t\tif keyLength > alignLength {\n\t\t\t\t\talignLength = keyLength\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\talignSpaces := bytes.Repeat([]byte(\" \"), alignLength)\n\n\t\tfor _, kname := range sec.keyList {\n\t\t\tkey := sec.Key(kname)\n\t\t\tif len(key.Comment) > 0 {\n\t\t\t\tif len(indent) > 0 && sname != DEFAULT_SECTION {\n\t\t\t\t\tbuf.WriteString(indent)\n\t\t\t\t}\n\t\t\t\tif key.Comment[0] != '#' && key.Comment[0] != ';' {\n\t\t\t\t\tkey.Comment = \"; \" + key.Comment\n\t\t\t\t}\n\t\t\t\tif _, err = buf.WriteString(key.Comment + LineBreak); err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif len(indent) > 0 && sname != DEFAULT_SECTION {\n\t\t\t\tbuf.WriteString(indent)\n\t\t\t}\n\n\t\t\tswitch {\n\t\t\tcase key.isAutoIncrement:\n\t\t\t\tkname = \"-\"\n\t\t\tcase strings.ContainsAny(kname, \"\\\"=:\"):\n\t\t\t\tkname = \"`\" + kname + \"`\"\n\t\t\tcase strings.Contains(kname, \"`\"):\n\t\t\t\tkname = `\"\"\"` + kname + `\"\"\"`\n\t\t\t}\n\t\t\tif _, err = buf.WriteString(kname); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\n\t\t\tif key.isBooleanType {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Write out alignment spaces before \"=\" sign\n\t\t\tif PrettyFormat {\n\t\t\t\tbuf.Write(alignSpaces[:alignLength-len(kname)])\n\t\t\t}\n\n\t\t\tval := key.value\n\t\t\t// In case key value contains \"\\n\", \"`\", \"\\\"\", \"#\" or \";\"\n\t\t\tif strings.ContainsAny(val, \"\\n`\") {\n\t\t\t\tval = `\"\"\"` + val + `\"\"\"`\n\t\t\t} else if strings.ContainsAny(val, \"#;\") {\n\t\t\t\tval = \"`\" + val + \"`\"\n\t\t\t}\n\t\t\tif _, err = buf.WriteString(equalSign + val + LineBreak); err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t}\n\n\t\t// Put a line between sections\n\t\tif _, err = buf.WriteString(LineBreak); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\treturn buf.WriteTo(w)\n}\n\n// WriteTo writes file content into io.Writer.\nfunc (f *File) WriteTo(w io.Writer) (int64, error) {\n\treturn f.WriteToIndent(w, \"\")\n}\n\n// SaveToIndent writes content to file system with given value indention.\nfunc (f *File) SaveToIndent(filename, indent string) error {\n\t// Note: Because we are truncating with os.Create,\n\t// \tso it's safer to save to a temporary file location and rename afte done.\n\ttmpPath := filename + \".\" + strconv.Itoa(time.Now().Nanosecond()) + \".tmp\"\n\tdefer os.Remove(tmpPath)\n\n\tfw, err := os.Create(tmpPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, err = f.WriteToIndent(fw, indent); err != nil {\n\t\tfw.Close()\n\t\treturn err\n\t}\n\tfw.Close()\n\n\t// Remove old file and rename the new one.\n\tos.Remove(filename)\n\treturn os.Rename(tmpPath, filename)\n}\n\n// SaveTo writes content to file system.\nfunc (f *File) SaveTo(filename string) error {\n\treturn f.SaveToIndent(filename, \"\")\n}\n"
  },
  {
    "path": "vendor/github.com/go-ini/ini/key.go",
    "content": "// Copyright 2014 Unknwon\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use this file except in compliance with the License. You may obtain\n// a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n// License for the specific language governing permissions and limitations\n// under the License.\n\npackage ini\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\n// Key represents a key under a section.\ntype Key struct {\n\ts               *Section\n\tname            string\n\tvalue           string\n\tisAutoIncrement bool\n\tisBooleanType   bool\n\n\tComment string\n}\n\n// ValueMapper represents a mapping function for values, e.g. os.ExpandEnv\ntype ValueMapper func(string) string\n\n// Name returns name of key.\nfunc (k *Key) Name() string {\n\treturn k.name\n}\n\n// Value returns raw value of key for performance purpose.\nfunc (k *Key) Value() string {\n\treturn k.value\n}\n\n// String returns string representation of value.\nfunc (k *Key) String() string {\n\tval := k.value\n\tif k.s.f.ValueMapper != nil {\n\t\tval = k.s.f.ValueMapper(val)\n\t}\n\tif strings.Index(val, \"%\") == -1 {\n\t\treturn val\n\t}\n\n\tfor i := 0; i < _DEPTH_VALUES; i++ {\n\t\tvr := varPattern.FindString(val)\n\t\tif len(vr) == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\t// Take off leading '%(' and trailing ')s'.\n\t\tnoption := strings.TrimLeft(vr, \"%(\")\n\t\tnoption = strings.TrimRight(noption, \")s\")\n\n\t\t// Search in the same section.\n\t\tnk, err := k.s.GetKey(noption)\n\t\tif err != nil {\n\t\t\t// Search again in default section.\n\t\t\tnk, _ = k.s.f.Section(\"\").GetKey(noption)\n\t\t}\n\n\t\t// Substitute by new value and take off leading '%(' and trailing ')s'.\n\t\tval = strings.Replace(val, vr, nk.value, -1)\n\t}\n\treturn val\n}\n\n// Validate accepts a validate function which can\n// return modifed result as key value.\nfunc (k *Key) Validate(fn func(string) string) string {\n\treturn fn(k.String())\n}\n\n// parseBool returns the boolean value represented by the string.\n//\n// It accepts 1, t, T, TRUE, true, True, YES, yes, Yes, y, ON, on, On,\n// 0, f, F, FALSE, false, False, NO, no, No, n, OFF, off, Off.\n// Any other value returns an error.\nfunc parseBool(str string) (value bool, err error) {\n\tswitch str {\n\tcase \"1\", \"t\", \"T\", \"true\", \"TRUE\", \"True\", \"YES\", \"yes\", \"Yes\", \"y\", \"ON\", \"on\", \"On\":\n\t\treturn true, nil\n\tcase \"0\", \"f\", \"F\", \"false\", \"FALSE\", \"False\", \"NO\", \"no\", \"No\", \"n\", \"OFF\", \"off\", \"Off\":\n\t\treturn false, nil\n\t}\n\treturn false, fmt.Errorf(\"parsing \\\"%s\\\": invalid syntax\", str)\n}\n\n// Bool returns bool type value.\nfunc (k *Key) Bool() (bool, error) {\n\treturn parseBool(k.String())\n}\n\n// Float64 returns float64 type value.\nfunc (k *Key) Float64() (float64, error) {\n\treturn strconv.ParseFloat(k.String(), 64)\n}\n\n// Int returns int type value.\nfunc (k *Key) Int() (int, error) {\n\treturn strconv.Atoi(k.String())\n}\n\n// Int64 returns int64 type value.\nfunc (k *Key) Int64() (int64, error) {\n\treturn strconv.ParseInt(k.String(), 10, 64)\n}\n\n// Uint returns uint type valued.\nfunc (k *Key) Uint() (uint, error) {\n\tu, e := strconv.ParseUint(k.String(), 10, 64)\n\treturn uint(u), e\n}\n\n// Uint64 returns uint64 type value.\nfunc (k *Key) Uint64() (uint64, error) {\n\treturn strconv.ParseUint(k.String(), 10, 64)\n}\n\n// Duration returns time.Duration type value.\nfunc (k *Key) Duration() (time.Duration, error) {\n\treturn time.ParseDuration(k.String())\n}\n\n// TimeFormat parses with given format and returns time.Time type value.\nfunc (k *Key) TimeFormat(format string) (time.Time, error) {\n\treturn time.Parse(format, k.String())\n}\n\n// Time parses with RFC3339 format and returns time.Time type value.\nfunc (k *Key) Time() (time.Time, error) {\n\treturn k.TimeFormat(time.RFC3339)\n}\n\n// MustString returns default value if key value is empty.\nfunc (k *Key) MustString(defaultVal string) string {\n\tval := k.String()\n\tif len(val) == 0 {\n\t\tk.value = defaultVal\n\t\treturn defaultVal\n\t}\n\treturn val\n}\n\n// MustBool always returns value without error,\n// it returns false if error occurs.\nfunc (k *Key) MustBool(defaultVal ...bool) bool {\n\tval, err := k.Bool()\n\tif len(defaultVal) > 0 && err != nil {\n\t\tk.value = strconv.FormatBool(defaultVal[0])\n\t\treturn defaultVal[0]\n\t}\n\treturn val\n}\n\n// MustFloat64 always returns value without error,\n// it returns 0.0 if error occurs.\nfunc (k *Key) MustFloat64(defaultVal ...float64) float64 {\n\tval, err := k.Float64()\n\tif len(defaultVal) > 0 && err != nil {\n\t\tk.value = strconv.FormatFloat(defaultVal[0], 'f', -1, 64)\n\t\treturn defaultVal[0]\n\t}\n\treturn val\n}\n\n// MustInt always returns value without error,\n// it returns 0 if error occurs.\nfunc (k *Key) MustInt(defaultVal ...int) int {\n\tval, err := k.Int()\n\tif len(defaultVal) > 0 && err != nil {\n\t\tk.value = strconv.FormatInt(int64(defaultVal[0]), 10)\n\t\treturn defaultVal[0]\n\t}\n\treturn val\n}\n\n// MustInt64 always returns value without error,\n// it returns 0 if error occurs.\nfunc (k *Key) MustInt64(defaultVal ...int64) int64 {\n\tval, err := k.Int64()\n\tif len(defaultVal) > 0 && err != nil {\n\t\tk.value = strconv.FormatInt(defaultVal[0], 10)\n\t\treturn defaultVal[0]\n\t}\n\treturn val\n}\n\n// MustUint always returns value without error,\n// it returns 0 if error occurs.\nfunc (k *Key) MustUint(defaultVal ...uint) uint {\n\tval, err := k.Uint()\n\tif len(defaultVal) > 0 && err != nil {\n\t\tk.value = strconv.FormatUint(uint64(defaultVal[0]), 10)\n\t\treturn defaultVal[0]\n\t}\n\treturn val\n}\n\n// MustUint64 always returns value without error,\n// it returns 0 if error occurs.\nfunc (k *Key) MustUint64(defaultVal ...uint64) uint64 {\n\tval, err := k.Uint64()\n\tif len(defaultVal) > 0 && err != nil {\n\t\tk.value = strconv.FormatUint(defaultVal[0], 10)\n\t\treturn defaultVal[0]\n\t}\n\treturn val\n}\n\n// MustDuration always returns value without error,\n// it returns zero value if error occurs.\nfunc (k *Key) MustDuration(defaultVal ...time.Duration) time.Duration {\n\tval, err := k.Duration()\n\tif len(defaultVal) > 0 && err != nil {\n\t\tk.value = defaultVal[0].String()\n\t\treturn defaultVal[0]\n\t}\n\treturn val\n}\n\n// MustTimeFormat always parses with given format and returns value without error,\n// it returns zero value if error occurs.\nfunc (k *Key) MustTimeFormat(format string, defaultVal ...time.Time) time.Time {\n\tval, err := k.TimeFormat(format)\n\tif len(defaultVal) > 0 && err != nil {\n\t\tk.value = defaultVal[0].Format(format)\n\t\treturn defaultVal[0]\n\t}\n\treturn val\n}\n\n// MustTime always parses with RFC3339 format and returns value without error,\n// it returns zero value if error occurs.\nfunc (k *Key) MustTime(defaultVal ...time.Time) time.Time {\n\treturn k.MustTimeFormat(time.RFC3339, defaultVal...)\n}\n\n// In always returns value without error,\n// it returns default value if error occurs or doesn't fit into candidates.\nfunc (k *Key) In(defaultVal string, candidates []string) string {\n\tval := k.String()\n\tfor _, cand := range candidates {\n\t\tif val == cand {\n\t\t\treturn val\n\t\t}\n\t}\n\treturn defaultVal\n}\n\n// InFloat64 always returns value without error,\n// it returns default value if error occurs or doesn't fit into candidates.\nfunc (k *Key) InFloat64(defaultVal float64, candidates []float64) float64 {\n\tval := k.MustFloat64()\n\tfor _, cand := range candidates {\n\t\tif val == cand {\n\t\t\treturn val\n\t\t}\n\t}\n\treturn defaultVal\n}\n\n// InInt always returns value without error,\n// it returns default value if error occurs or doesn't fit into candidates.\nfunc (k *Key) InInt(defaultVal int, candidates []int) int {\n\tval := k.MustInt()\n\tfor _, cand := range candidates {\n\t\tif val == cand {\n\t\t\treturn val\n\t\t}\n\t}\n\treturn defaultVal\n}\n\n// InInt64 always returns value without error,\n// it returns default value if error occurs or doesn't fit into candidates.\nfunc (k *Key) InInt64(defaultVal int64, candidates []int64) int64 {\n\tval := k.MustInt64()\n\tfor _, cand := range candidates {\n\t\tif val == cand {\n\t\t\treturn val\n\t\t}\n\t}\n\treturn defaultVal\n}\n\n// InUint always returns value without error,\n// it returns default value if error occurs or doesn't fit into candidates.\nfunc (k *Key) InUint(defaultVal uint, candidates []uint) uint {\n\tval := k.MustUint()\n\tfor _, cand := range candidates {\n\t\tif val == cand {\n\t\t\treturn val\n\t\t}\n\t}\n\treturn defaultVal\n}\n\n// InUint64 always returns value without error,\n// it returns default value if error occurs or doesn't fit into candidates.\nfunc (k *Key) InUint64(defaultVal uint64, candidates []uint64) uint64 {\n\tval := k.MustUint64()\n\tfor _, cand := range candidates {\n\t\tif val == cand {\n\t\t\treturn val\n\t\t}\n\t}\n\treturn defaultVal\n}\n\n// InTimeFormat always parses with given format and returns value without error,\n// it returns default value if error occurs or doesn't fit into candidates.\nfunc (k *Key) InTimeFormat(format string, defaultVal time.Time, candidates []time.Time) time.Time {\n\tval := k.MustTimeFormat(format)\n\tfor _, cand := range candidates {\n\t\tif val == cand {\n\t\t\treturn val\n\t\t}\n\t}\n\treturn defaultVal\n}\n\n// InTime always parses with RFC3339 format and returns value without error,\n// it returns default value if error occurs or doesn't fit into candidates.\nfunc (k *Key) InTime(defaultVal time.Time, candidates []time.Time) time.Time {\n\treturn k.InTimeFormat(time.RFC3339, defaultVal, candidates)\n}\n\n// RangeFloat64 checks if value is in given range inclusively,\n// and returns default value if it's not.\nfunc (k *Key) RangeFloat64(defaultVal, min, max float64) float64 {\n\tval := k.MustFloat64()\n\tif val < min || val > max {\n\t\treturn defaultVal\n\t}\n\treturn val\n}\n\n// RangeInt checks if value is in given range inclusively,\n// and returns default value if it's not.\nfunc (k *Key) RangeInt(defaultVal, min, max int) int {\n\tval := k.MustInt()\n\tif val < min || val > max {\n\t\treturn defaultVal\n\t}\n\treturn val\n}\n\n// RangeInt64 checks if value is in given range inclusively,\n// and returns default value if it's not.\nfunc (k *Key) RangeInt64(defaultVal, min, max int64) int64 {\n\tval := k.MustInt64()\n\tif val < min || val > max {\n\t\treturn defaultVal\n\t}\n\treturn val\n}\n\n// RangeTimeFormat checks if value with given format is in given range inclusively,\n// and returns default value if it's not.\nfunc (k *Key) RangeTimeFormat(format string, defaultVal, min, max time.Time) time.Time {\n\tval := k.MustTimeFormat(format)\n\tif val.Unix() < min.Unix() || val.Unix() > max.Unix() {\n\t\treturn defaultVal\n\t}\n\treturn val\n}\n\n// RangeTime checks if value with RFC3339 format is in given range inclusively,\n// and returns default value if it's not.\nfunc (k *Key) RangeTime(defaultVal, min, max time.Time) time.Time {\n\treturn k.RangeTimeFormat(time.RFC3339, defaultVal, min, max)\n}\n\n// Strings returns list of string divided by given delimiter.\nfunc (k *Key) Strings(delim string) []string {\n\tstr := k.String()\n\tif len(str) == 0 {\n\t\treturn []string{}\n\t}\n\n\tvals := strings.Split(str, delim)\n\tfor i := range vals {\n\t\tvals[i] = strings.TrimSpace(vals[i])\n\t}\n\treturn vals\n}\n\n// Float64s returns list of float64 divided by given delimiter. Any invalid input will be treated as zero value.\nfunc (k *Key) Float64s(delim string) []float64 {\n\tvals, _ := k.getFloat64s(delim, true, false)\n\treturn vals\n}\n\n// Ints returns list of int divided by given delimiter. Any invalid input will be treated as zero value.\nfunc (k *Key) Ints(delim string) []int {\n\tvals, _ := k.getInts(delim, true, false)\n\treturn vals\n}\n\n// Int64s returns list of int64 divided by given delimiter. Any invalid input will be treated as zero value.\nfunc (k *Key) Int64s(delim string) []int64 {\n\tvals, _ := k.getInt64s(delim, true, false)\n\treturn vals\n}\n\n// Uints returns list of uint divided by given delimiter. Any invalid input will be treated as zero value.\nfunc (k *Key) Uints(delim string) []uint {\n\tvals, _ := k.getUints(delim, true, false)\n\treturn vals\n}\n\n// Uint64s returns list of uint64 divided by given delimiter. Any invalid input will be treated as zero value.\nfunc (k *Key) Uint64s(delim string) []uint64 {\n\tvals, _ := k.getUint64s(delim, true, false)\n\treturn vals\n}\n\n// TimesFormat parses with given format and returns list of time.Time divided by given delimiter.\n// Any invalid input will be treated as zero value (0001-01-01 00:00:00 +0000 UTC).\nfunc (k *Key) TimesFormat(format, delim string) []time.Time {\n\tvals, _ := k.getTimesFormat(format, delim, true, false)\n\treturn vals\n}\n\n// Times parses with RFC3339 format and returns list of time.Time divided by given delimiter.\n// Any invalid input will be treated as zero value (0001-01-01 00:00:00 +0000 UTC).\nfunc (k *Key) Times(delim string) []time.Time {\n\treturn k.TimesFormat(time.RFC3339, delim)\n}\n\n// ValidFloat64s returns list of float64 divided by given delimiter. If some value is not float, then\n// it will not be included to result list.\nfunc (k *Key) ValidFloat64s(delim string) []float64 {\n\tvals, _ := k.getFloat64s(delim, false, false)\n\treturn vals\n}\n\n// ValidInts returns list of int divided by given delimiter. If some value is not integer, then it will\n// not be included to result list.\nfunc (k *Key) ValidInts(delim string) []int {\n\tvals, _ := k.getInts(delim, false, false)\n\treturn vals\n}\n\n// ValidInt64s returns list of int64 divided by given delimiter. If some value is not 64-bit integer,\n// then it will not be included to result list.\nfunc (k *Key) ValidInt64s(delim string) []int64 {\n\tvals, _ := k.getInt64s(delim, false, false)\n\treturn vals\n}\n\n// ValidUints returns list of uint divided by given delimiter. If some value is not unsigned integer,\n// then it will not be included to result list.\nfunc (k *Key) ValidUints(delim string) []uint {\n\tvals, _ := k.getUints(delim, false, false)\n\treturn vals\n}\n\n// ValidUint64s returns list of uint64 divided by given delimiter. If some value is not 64-bit unsigned\n// integer, then it will not be included to result list.\nfunc (k *Key) ValidUint64s(delim string) []uint64 {\n\tvals, _ := k.getUint64s(delim, false, false)\n\treturn vals\n}\n\n// ValidTimesFormat parses with given format and returns list of time.Time divided by given delimiter.\nfunc (k *Key) ValidTimesFormat(format, delim string) []time.Time {\n\tvals, _ := k.getTimesFormat(format, delim, false, false)\n\treturn vals\n}\n\n// ValidTimes parses with RFC3339 format and returns list of time.Time divided by given delimiter.\nfunc (k *Key) ValidTimes(delim string) []time.Time {\n\treturn k.ValidTimesFormat(time.RFC3339, delim)\n}\n\n// StrictFloat64s returns list of float64 divided by given delimiter or error on first invalid input.\nfunc (k *Key) StrictFloat64s(delim string) ([]float64, error) {\n\treturn k.getFloat64s(delim, false, true)\n}\n\n// StrictInts returns list of int divided by given delimiter or error on first invalid input.\nfunc (k *Key) StrictInts(delim string) ([]int, error) {\n\treturn k.getInts(delim, false, true)\n}\n\n// StrictInt64s returns list of int64 divided by given delimiter or error on first invalid input.\nfunc (k *Key) StrictInt64s(delim string) ([]int64, error) {\n\treturn k.getInt64s(delim, false, true)\n}\n\n// StrictUints returns list of uint divided by given delimiter or error on first invalid input.\nfunc (k *Key) StrictUints(delim string) ([]uint, error) {\n\treturn k.getUints(delim, false, true)\n}\n\n// StrictUint64s returns list of uint64 divided by given delimiter or error on first invalid input.\nfunc (k *Key) StrictUint64s(delim string) ([]uint64, error) {\n\treturn k.getUint64s(delim, false, true)\n}\n\n// StrictTimesFormat parses with given format and returns list of time.Time divided by given delimiter\n// or error on first invalid input.\nfunc (k *Key) StrictTimesFormat(format, delim string) ([]time.Time, error) {\n\treturn k.getTimesFormat(format, delim, false, true)\n}\n\n// StrictTimes parses with RFC3339 format and returns list of time.Time divided by given delimiter\n// or error on first invalid input.\nfunc (k *Key) StrictTimes(delim string) ([]time.Time, error) {\n\treturn k.StrictTimesFormat(time.RFC3339, delim)\n}\n\n// getFloat64s returns list of float64 divided by given delimiter.\nfunc (k *Key) getFloat64s(delim string, addInvalid, returnOnInvalid bool) ([]float64, error) {\n\tstrs := k.Strings(delim)\n\tvals := make([]float64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tval, err := strconv.ParseFloat(str, 64)\n\t\tif err != nil && returnOnInvalid {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err == nil || addInvalid {\n\t\t\tvals = append(vals, val)\n\t\t}\n\t}\n\treturn vals, nil\n}\n\n// getInts returns list of int divided by given delimiter.\nfunc (k *Key) getInts(delim string, addInvalid, returnOnInvalid bool) ([]int, error) {\n\tstrs := k.Strings(delim)\n\tvals := make([]int, 0, len(strs))\n\tfor _, str := range strs {\n\t\tval, err := strconv.Atoi(str)\n\t\tif err != nil && returnOnInvalid {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err == nil || addInvalid {\n\t\t\tvals = append(vals, val)\n\t\t}\n\t}\n\treturn vals, nil\n}\n\n// getInt64s returns list of int64 divided by given delimiter.\nfunc (k *Key) getInt64s(delim string, addInvalid, returnOnInvalid bool) ([]int64, error) {\n\tstrs := k.Strings(delim)\n\tvals := make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tval, err := strconv.ParseInt(str, 10, 64)\n\t\tif err != nil && returnOnInvalid {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err == nil || addInvalid {\n\t\t\tvals = append(vals, val)\n\t\t}\n\t}\n\treturn vals, nil\n}\n\n// getUints returns list of uint divided by given delimiter.\nfunc (k *Key) getUints(delim string, addInvalid, returnOnInvalid bool) ([]uint, error) {\n\tstrs := k.Strings(delim)\n\tvals := make([]uint, 0, len(strs))\n\tfor _, str := range strs {\n\t\tval, err := strconv.ParseUint(str, 10, 0)\n\t\tif err != nil && returnOnInvalid {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err == nil || addInvalid {\n\t\t\tvals = append(vals, uint(val))\n\t\t}\n\t}\n\treturn vals, nil\n}\n\n// getUint64s returns list of uint64 divided by given delimiter.\nfunc (k *Key) getUint64s(delim string, addInvalid, returnOnInvalid bool) ([]uint64, error) {\n\tstrs := k.Strings(delim)\n\tvals := make([]uint64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tval, err := strconv.ParseUint(str, 10, 64)\n\t\tif err != nil && returnOnInvalid {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err == nil || addInvalid {\n\t\t\tvals = append(vals, val)\n\t\t}\n\t}\n\treturn vals, nil\n}\n\n// getTimesFormat parses with given format and returns list of time.Time divided by given delimiter.\nfunc (k *Key) getTimesFormat(format, delim string, addInvalid, returnOnInvalid bool) ([]time.Time, error) {\n\tstrs := k.Strings(delim)\n\tvals := make([]time.Time, 0, len(strs))\n\tfor _, str := range strs {\n\t\tval, err := time.Parse(format, str)\n\t\tif err != nil && returnOnInvalid {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err == nil || addInvalid {\n\t\t\tvals = append(vals, val)\n\t\t}\n\t}\n\treturn vals, nil\n}\n\n// SetValue changes key value.\nfunc (k *Key) SetValue(v string) {\n\tif k.s.f.BlockMode {\n\t\tk.s.f.lock.Lock()\n\t\tdefer k.s.f.lock.Unlock()\n\t}\n\n\tk.value = v\n\tk.s.keysHash[k.name] = v\n}\n"
  },
  {
    "path": "vendor/github.com/go-ini/ini/parser.go",
    "content": "// Copyright 2015 Unknwon\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use this file except in compliance with the License. You may obtain\n// a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n// License for the specific language governing permissions and limitations\n// under the License.\n\npackage ini\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\ntype tokenType int\n\nconst (\n\t_TOKEN_INVALID tokenType = iota\n\t_TOKEN_COMMENT\n\t_TOKEN_SECTION\n\t_TOKEN_KEY\n)\n\ntype parser struct {\n\tbuf     *bufio.Reader\n\tisEOF   bool\n\tcount   int\n\tcomment *bytes.Buffer\n}\n\nfunc newParser(r io.Reader) *parser {\n\treturn &parser{\n\t\tbuf:     bufio.NewReader(r),\n\t\tcount:   1,\n\t\tcomment: &bytes.Buffer{},\n\t}\n}\n\n// BOM handles header of BOM-UTF8 format.\n// http://en.wikipedia.org/wiki/Byte_order_mark#Representations_of_byte_order_marks_by_encoding\nfunc (p *parser) BOM() error {\n\tmask, err := p.buf.Peek(3)\n\tif err != nil && err != io.EOF {\n\t\treturn err\n\t} else if len(mask) < 3 {\n\t\treturn nil\n\t} else if mask[0] == 239 && mask[1] == 187 && mask[2] == 191 {\n\t\tp.buf.Read(mask)\n\t}\n\treturn nil\n}\n\nfunc (p *parser) readUntil(delim byte) ([]byte, error) {\n\tdata, err := p.buf.ReadBytes(delim)\n\tif err != nil {\n\t\tif err == io.EOF {\n\t\t\tp.isEOF = true\n\t\t} else {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn data, nil\n}\n\nfunc cleanComment(in []byte) ([]byte, bool) {\n\ti := bytes.IndexAny(in, \"#;\")\n\tif i == -1 {\n\t\treturn nil, false\n\t}\n\treturn in[i:], true\n}\n\nfunc readKeyName(in []byte) (string, int, error) {\n\tline := string(in)\n\n\t// Check if key name surrounded by quotes.\n\tvar keyQuote string\n\tif line[0] == '\"' {\n\t\tif len(line) > 6 && string(line[0:3]) == `\"\"\"` {\n\t\t\tkeyQuote = `\"\"\"`\n\t\t} else {\n\t\t\tkeyQuote = `\"`\n\t\t}\n\t} else if line[0] == '`' {\n\t\tkeyQuote = \"`\"\n\t}\n\n\t// Get out key name\n\tendIdx := -1\n\tif len(keyQuote) > 0 {\n\t\tstartIdx := len(keyQuote)\n\t\t// FIXME: fail case -> \"\"\"\"\"\"name\"\"\"=value\n\t\tpos := strings.Index(line[startIdx:], keyQuote)\n\t\tif pos == -1 {\n\t\t\treturn \"\", -1, fmt.Errorf(\"missing closing key quote: %s\", line)\n\t\t}\n\t\tpos += startIdx\n\n\t\t// Find key-value delimiter\n\t\ti := strings.IndexAny(line[pos+startIdx:], \"=:\")\n\t\tif i < 0 {\n\t\t\treturn \"\", -1, ErrDelimiterNotFound{line}\n\t\t}\n\t\tendIdx = pos + i\n\t\treturn strings.TrimSpace(line[startIdx:pos]), endIdx + startIdx + 1, nil\n\t}\n\n\tendIdx = strings.IndexAny(line, \"=:\")\n\tif endIdx < 0 {\n\t\treturn \"\", -1, ErrDelimiterNotFound{line}\n\t}\n\treturn strings.TrimSpace(line[0:endIdx]), endIdx + 1, nil\n}\n\nfunc (p *parser) readMultilines(line, val, valQuote string) (string, error) {\n\tfor {\n\t\tdata, err := p.readUntil('\\n')\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tnext := string(data)\n\n\t\tpos := strings.LastIndex(next, valQuote)\n\t\tif pos > -1 {\n\t\t\tval += next[:pos]\n\n\t\t\tcomment, has := cleanComment([]byte(next[pos:]))\n\t\t\tif has {\n\t\t\t\tp.comment.Write(bytes.TrimSpace(comment))\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tval += next\n\t\tif p.isEOF {\n\t\t\treturn \"\", fmt.Errorf(\"missing closing key quote from '%s' to '%s'\", line, next)\n\t\t}\n\t}\n\treturn val, nil\n}\n\nfunc (p *parser) readContinuationLines(val string) (string, error) {\n\tfor {\n\t\tdata, err := p.readUntil('\\n')\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tnext := strings.TrimSpace(string(data))\n\n\t\tif len(next) == 0 {\n\t\t\tbreak\n\t\t}\n\t\tval += next\n\t\tif val[len(val)-1] != '\\\\' {\n\t\t\tbreak\n\t\t}\n\t\tval = val[:len(val)-1]\n\t}\n\treturn val, nil\n}\n\n// hasSurroundedQuote check if and only if the first and last characters\n// are quotes \\\" or \\'.\n// It returns false if any other parts also contain same kind of quotes.\nfunc hasSurroundedQuote(in string, quote byte) bool {\n\treturn len(in) > 2 && in[0] == quote && in[len(in)-1] == quote &&\n\t\tstrings.IndexByte(in[1:], quote) == len(in)-2\n}\n\nfunc (p *parser) readValue(in []byte, ignoreContinuation bool) (string, error) {\n\tline := strings.TrimLeftFunc(string(in), unicode.IsSpace)\n\tif len(line) == 0 {\n\t\treturn \"\", nil\n\t}\n\n\tvar valQuote string\n\tif len(line) > 3 && string(line[0:3]) == `\"\"\"` {\n\t\tvalQuote = `\"\"\"`\n\t} else if line[0] == '`' {\n\t\tvalQuote = \"`\"\n\t}\n\n\tif len(valQuote) > 0 {\n\t\tstartIdx := len(valQuote)\n\t\tpos := strings.LastIndex(line[startIdx:], valQuote)\n\t\t// Check for multi-line value\n\t\tif pos == -1 {\n\t\t\treturn p.readMultilines(line, line[startIdx:], valQuote)\n\t\t}\n\n\t\treturn line[startIdx : pos+startIdx], nil\n\t}\n\n\t// Won't be able to reach here if value only contains whitespace.\n\tline = strings.TrimSpace(line)\n\n\t// Check continuation lines when desired.\n\tif !ignoreContinuation && line[len(line)-1] == '\\\\' {\n\t\treturn p.readContinuationLines(line[:len(line)-1])\n\t}\n\n\ti := strings.IndexAny(line, \"#;\")\n\tif i > -1 {\n\t\tp.comment.WriteString(line[i:])\n\t\tline = strings.TrimSpace(line[:i])\n\t}\n\n\t// Trim single quotes\n\tif hasSurroundedQuote(line, '\\'') ||\n\t\thasSurroundedQuote(line, '\"') {\n\t\tline = line[1 : len(line)-1]\n\t}\n\treturn line, nil\n}\n\n// parse parses data through an io.Reader.\nfunc (f *File) parse(reader io.Reader) (err error) {\n\tp := newParser(reader)\n\tif err = p.BOM(); err != nil {\n\t\treturn fmt.Errorf(\"BOM: %v\", err)\n\t}\n\n\t// Ignore error because default section name is never empty string.\n\tsection, _ := f.NewSection(DEFAULT_SECTION)\n\n\tvar line []byte\n\tfor !p.isEOF {\n\t\tline, err = p.readUntil('\\n')\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tline = bytes.TrimLeftFunc(line, unicode.IsSpace)\n\t\tif len(line) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Comments\n\t\tif line[0] == '#' || line[0] == ';' {\n\t\t\t// Note: we do not care ending line break,\n\t\t\t// it is needed for adding second line,\n\t\t\t// so just clean it once at the end when set to value.\n\t\t\tp.comment.Write(line)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Section\n\t\tif line[0] == '[' {\n\t\t\t// Read to the next ']' (TODO: support quoted strings)\n\t\t\t// TODO(unknwon): use LastIndexByte when stop supporting Go1.4\n\t\t\tcloseIdx := bytes.LastIndex(line, []byte(\"]\"))\n\t\t\tif closeIdx == -1 {\n\t\t\t\treturn fmt.Errorf(\"unclosed section: %s\", line)\n\t\t\t}\n\n\t\t\tname := string(line[1:closeIdx])\n\t\t\tsection, err = f.NewSection(name)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tcomment, has := cleanComment(line[closeIdx+1:])\n\t\t\tif has {\n\t\t\t\tp.comment.Write(comment)\n\t\t\t}\n\n\t\t\tsection.Comment = strings.TrimSpace(p.comment.String())\n\n\t\t\t// Reset aotu-counter and comments\n\t\t\tp.comment.Reset()\n\t\t\tp.count = 1\n\t\t\tcontinue\n\t\t}\n\n\t\tkname, offset, err := readKeyName(line)\n\t\tif err != nil {\n\t\t\t// Treat as boolean key when desired, and whole line is key name.\n\t\t\tif IsErrDelimiterNotFound(err) && f.options.AllowBooleanKeys {\n\t\t\t\tkey, err := section.NewKey(string(line), \"true\")\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tkey.isBooleanType = true\n\t\t\t\tkey.Comment = strings.TrimSpace(p.comment.String())\n\t\t\t\tp.comment.Reset()\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\n\t\t// Auto increment.\n\t\tisAutoIncr := false\n\t\tif kname == \"-\" {\n\t\t\tisAutoIncr = true\n\t\t\tkname = \"#\" + strconv.Itoa(p.count)\n\t\t\tp.count++\n\t\t}\n\n\t\tkey, err := section.NewKey(kname, \"\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tkey.isAutoIncrement = isAutoIncr\n\n\t\tvalue, err := p.readValue(line[offset:], f.options.IgnoreContinuation)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tkey.SetValue(value)\n\t\tkey.Comment = strings.TrimSpace(p.comment.String())\n\t\tp.comment.Reset()\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/go-ini/ini/section.go",
    "content": "// Copyright 2014 Unknwon\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use this file except in compliance with the License. You may obtain\n// a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n// License for the specific language governing permissions and limitations\n// under the License.\n\npackage ini\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n)\n\n// Section represents a config section.\ntype Section struct {\n\tf        *File\n\tComment  string\n\tname     string\n\tkeys     map[string]*Key\n\tkeyList  []string\n\tkeysHash map[string]string\n}\n\nfunc newSection(f *File, name string) *Section {\n\treturn &Section{f, \"\", name, make(map[string]*Key), make([]string, 0, 10), make(map[string]string)}\n}\n\n// Name returns name of Section.\nfunc (s *Section) Name() string {\n\treturn s.name\n}\n\n// NewKey creates a new key to given section.\nfunc (s *Section) NewKey(name, val string) (*Key, error) {\n\tif len(name) == 0 {\n\t\treturn nil, errors.New(\"error creating new key: empty key name\")\n\t} else if s.f.options.Insensitive {\n\t\tname = strings.ToLower(name)\n\t}\n\n\tif s.f.BlockMode {\n\t\ts.f.lock.Lock()\n\t\tdefer s.f.lock.Unlock()\n\t}\n\n\tif inSlice(name, s.keyList) {\n\t\ts.keys[name].value = val\n\t\treturn s.keys[name], nil\n\t}\n\n\ts.keyList = append(s.keyList, name)\n\ts.keys[name] = &Key{\n\t\ts:     s,\n\t\tname:  name,\n\t\tvalue: val,\n\t}\n\ts.keysHash[name] = val\n\treturn s.keys[name], nil\n}\n\n// GetKey returns key in section by given name.\nfunc (s *Section) GetKey(name string) (*Key, error) {\n\t// FIXME: change to section level lock?\n\tif s.f.BlockMode {\n\t\ts.f.lock.RLock()\n\t}\n\tif s.f.options.Insensitive {\n\t\tname = strings.ToLower(name)\n\t}\n\tkey := s.keys[name]\n\tif s.f.BlockMode {\n\t\ts.f.lock.RUnlock()\n\t}\n\n\tif key == nil {\n\t\t// Check if it is a child-section.\n\t\tsname := s.name\n\t\tfor {\n\t\t\tif i := strings.LastIndex(sname, \".\"); i > -1 {\n\t\t\t\tsname = sname[:i]\n\t\t\t\tsec, err := s.f.GetSection(sname)\n\t\t\t\tif err != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\treturn sec.GetKey(name)\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\treturn nil, fmt.Errorf(\"error when getting key of section '%s': key '%s' not exists\", s.name, name)\n\t}\n\treturn key, nil\n}\n\n// HasKey returns true if section contains a key with given name.\nfunc (s *Section) HasKey(name string) bool {\n\tkey, _ := s.GetKey(name)\n\treturn key != nil\n}\n\n// Haskey is a backwards-compatible name for HasKey.\nfunc (s *Section) Haskey(name string) bool {\n\treturn s.HasKey(name)\n}\n\n// HasValue returns true if section contains given raw value.\nfunc (s *Section) HasValue(value string) bool {\n\tif s.f.BlockMode {\n\t\ts.f.lock.RLock()\n\t\tdefer s.f.lock.RUnlock()\n\t}\n\n\tfor _, k := range s.keys {\n\t\tif value == k.value {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// Key assumes named Key exists in section and returns a zero-value when not.\nfunc (s *Section) Key(name string) *Key {\n\tkey, err := s.GetKey(name)\n\tif err != nil {\n\t\t// It's OK here because the only possible error is empty key name,\n\t\t// but if it's empty, this piece of code won't be executed.\n\t\tkey, _ = s.NewKey(name, \"\")\n\t\treturn key\n\t}\n\treturn key\n}\n\n// Keys returns list of keys of section.\nfunc (s *Section) Keys() []*Key {\n\tkeys := make([]*Key, len(s.keyList))\n\tfor i := range s.keyList {\n\t\tkeys[i] = s.Key(s.keyList[i])\n\t}\n\treturn keys\n}\n\n// ParentKeys returns list of keys of parent section.\nfunc (s *Section) ParentKeys() []*Key {\n\tvar parentKeys []*Key\n\tsname := s.name\n\tfor {\n\t\tif i := strings.LastIndex(sname, \".\"); i > -1 {\n\t\t\tsname = sname[:i]\n\t\t\tsec, err := s.f.GetSection(sname)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tparentKeys = append(parentKeys, sec.Keys()...)\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\n\t}\n\treturn parentKeys\n}\n\n// KeyStrings returns list of key names of section.\nfunc (s *Section) KeyStrings() []string {\n\tlist := make([]string, len(s.keyList))\n\tcopy(list, s.keyList)\n\treturn list\n}\n\n// KeysHash returns keys hash consisting of names and values.\nfunc (s *Section) KeysHash() map[string]string {\n\tif s.f.BlockMode {\n\t\ts.f.lock.RLock()\n\t\tdefer s.f.lock.RUnlock()\n\t}\n\n\thash := map[string]string{}\n\tfor key, value := range s.keysHash {\n\t\thash[key] = value\n\t}\n\treturn hash\n}\n\n// DeleteKey deletes a key from section.\nfunc (s *Section) DeleteKey(name string) {\n\tif s.f.BlockMode {\n\t\ts.f.lock.Lock()\n\t\tdefer s.f.lock.Unlock()\n\t}\n\n\tfor i, k := range s.keyList {\n\t\tif k == name {\n\t\t\ts.keyList = append(s.keyList[:i], s.keyList[i+1:]...)\n\t\t\tdelete(s.keys, name)\n\t\t\treturn\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/go-ini/ini/struct.go",
    "content": "// Copyright 2014 Unknwon\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use this file except in compliance with the License. You may obtain\n// a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n// License for the specific language governing permissions and limitations\n// under the License.\n\npackage ini\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strings\"\n\t\"time\"\n\t\"unicode\"\n)\n\n// NameMapper represents a ini tag name mapper.\ntype NameMapper func(string) string\n\n// Built-in name getters.\nvar (\n\t// AllCapsUnderscore converts to format ALL_CAPS_UNDERSCORE.\n\tAllCapsUnderscore NameMapper = func(raw string) string {\n\t\tnewstr := make([]rune, 0, len(raw))\n\t\tfor i, chr := range raw {\n\t\t\tif isUpper := 'A' <= chr && chr <= 'Z'; isUpper {\n\t\t\t\tif i > 0 {\n\t\t\t\t\tnewstr = append(newstr, '_')\n\t\t\t\t}\n\t\t\t}\n\t\t\tnewstr = append(newstr, unicode.ToUpper(chr))\n\t\t}\n\t\treturn string(newstr)\n\t}\n\t// TitleUnderscore converts to format title_underscore.\n\tTitleUnderscore NameMapper = func(raw string) string {\n\t\tnewstr := make([]rune, 0, len(raw))\n\t\tfor i, chr := range raw {\n\t\t\tif isUpper := 'A' <= chr && chr <= 'Z'; isUpper {\n\t\t\t\tif i > 0 {\n\t\t\t\t\tnewstr = append(newstr, '_')\n\t\t\t\t}\n\t\t\t\tchr -= ('A' - 'a')\n\t\t\t}\n\t\t\tnewstr = append(newstr, chr)\n\t\t}\n\t\treturn string(newstr)\n\t}\n)\n\nfunc (s *Section) parseFieldName(raw, actual string) string {\n\tif len(actual) > 0 {\n\t\treturn actual\n\t}\n\tif s.f.NameMapper != nil {\n\t\treturn s.f.NameMapper(raw)\n\t}\n\treturn raw\n}\n\nfunc parseDelim(actual string) string {\n\tif len(actual) > 0 {\n\t\treturn actual\n\t}\n\treturn \",\"\n}\n\nvar reflectTime = reflect.TypeOf(time.Now()).Kind()\n\n// setSliceWithProperType sets proper values to slice based on its type.\nfunc setSliceWithProperType(key *Key, field reflect.Value, delim string) error {\n\tstrs := key.Strings(delim)\n\tnumVals := len(strs)\n\tif numVals == 0 {\n\t\treturn nil\n\t}\n\n\tvar vals interface{}\n\n\tsliceOf := field.Type().Elem().Kind()\n\tswitch sliceOf {\n\tcase reflect.String:\n\t\tvals = strs\n\tcase reflect.Int:\n\t\tvals = key.Ints(delim)\n\tcase reflect.Int64:\n\t\tvals = key.Int64s(delim)\n\tcase reflect.Uint:\n\t\tvals = key.Uints(delim)\n\tcase reflect.Uint64:\n\t\tvals = key.Uint64s(delim)\n\tcase reflect.Float64:\n\t\tvals = key.Float64s(delim)\n\tcase reflectTime:\n\t\tvals = key.Times(delim)\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported type '[]%s'\", sliceOf)\n\t}\n\n\tslice := reflect.MakeSlice(field.Type(), numVals, numVals)\n\tfor i := 0; i < numVals; i++ {\n\t\tswitch sliceOf {\n\t\tcase reflect.String:\n\t\t\tslice.Index(i).Set(reflect.ValueOf(vals.([]string)[i]))\n\t\tcase reflect.Int:\n\t\t\tslice.Index(i).Set(reflect.ValueOf(vals.([]int)[i]))\n\t\tcase reflect.Int64:\n\t\t\tslice.Index(i).Set(reflect.ValueOf(vals.([]int64)[i]))\n\t\tcase reflect.Uint:\n\t\t\tslice.Index(i).Set(reflect.ValueOf(vals.([]uint)[i]))\n\t\tcase reflect.Uint64:\n\t\t\tslice.Index(i).Set(reflect.ValueOf(vals.([]uint64)[i]))\n\t\tcase reflect.Float64:\n\t\t\tslice.Index(i).Set(reflect.ValueOf(vals.([]float64)[i]))\n\t\tcase reflectTime:\n\t\t\tslice.Index(i).Set(reflect.ValueOf(vals.([]time.Time)[i]))\n\t\t}\n\t}\n\tfield.Set(slice)\n\treturn nil\n}\n\n// setWithProperType sets proper value to field based on its type,\n// but it does not return error for failing parsing,\n// because we want to use default value that is already assigned to strcut.\nfunc setWithProperType(t reflect.Type, key *Key, field reflect.Value, delim string) error {\n\tswitch t.Kind() {\n\tcase reflect.String:\n\t\tif len(key.String()) == 0 {\n\t\t\treturn nil\n\t\t}\n\t\tfield.SetString(key.String())\n\tcase reflect.Bool:\n\t\tboolVal, err := key.Bool()\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\tfield.SetBool(boolVal)\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tdurationVal, err := key.Duration()\n\t\t// Skip zero value\n\t\tif err == nil && int(durationVal) > 0 {\n\t\t\tfield.Set(reflect.ValueOf(durationVal))\n\t\t\treturn nil\n\t\t}\n\n\t\tintVal, err := key.Int64()\n\t\tif err != nil || intVal == 0 {\n\t\t\treturn nil\n\t\t}\n\t\tfield.SetInt(intVal)\n\t//\tbyte is an alias for uint8, so supporting uint8 breaks support for byte\n\tcase reflect.Uint, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\tdurationVal, err := key.Duration()\n\t\t// Skip zero value\n\t\tif err == nil && int(durationVal) > 0 {\n\t\t\tfield.Set(reflect.ValueOf(durationVal))\n\t\t\treturn nil\n\t\t}\n\n\t\tuintVal, err := key.Uint64()\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\tfield.SetUint(uintVal)\n\n\tcase reflect.Float64:\n\t\tfloatVal, err := key.Float64()\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\tfield.SetFloat(floatVal)\n\tcase reflectTime:\n\t\ttimeVal, err := key.Time()\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\tfield.Set(reflect.ValueOf(timeVal))\n\tcase reflect.Slice:\n\t\treturn setSliceWithProperType(key, field, delim)\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported type '%s'\", t)\n\t}\n\treturn nil\n}\n\nfunc (s *Section) mapTo(val reflect.Value) error {\n\tif val.Kind() == reflect.Ptr {\n\t\tval = val.Elem()\n\t}\n\ttyp := val.Type()\n\n\tfor i := 0; i < typ.NumField(); i++ {\n\t\tfield := val.Field(i)\n\t\ttpField := typ.Field(i)\n\n\t\ttag := tpField.Tag.Get(\"ini\")\n\t\tif tag == \"-\" {\n\t\t\tcontinue\n\t\t}\n\n\t\topts := strings.SplitN(tag, \",\", 2) // strip off possible omitempty\n\t\tfieldName := s.parseFieldName(tpField.Name, opts[0])\n\t\tif len(fieldName) == 0 || !field.CanSet() {\n\t\t\tcontinue\n\t\t}\n\n\t\tisAnonymous := tpField.Type.Kind() == reflect.Ptr && tpField.Anonymous\n\t\tisStruct := tpField.Type.Kind() == reflect.Struct\n\t\tif isAnonymous {\n\t\t\tfield.Set(reflect.New(tpField.Type.Elem()))\n\t\t}\n\n\t\tif isAnonymous || isStruct {\n\t\t\tif sec, err := s.f.GetSection(fieldName); err == nil {\n\t\t\t\tif err = sec.mapTo(field); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"error mapping field(%s): %v\", fieldName, err)\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif key, err := s.GetKey(fieldName); err == nil {\n\t\t\tif err = setWithProperType(tpField.Type, key, field, parseDelim(tpField.Tag.Get(\"delim\"))); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error mapping field(%s): %v\", fieldName, err)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// MapTo maps section to given struct.\nfunc (s *Section) MapTo(v interface{}) error {\n\ttyp := reflect.TypeOf(v)\n\tval := reflect.ValueOf(v)\n\tif typ.Kind() == reflect.Ptr {\n\t\ttyp = typ.Elem()\n\t\tval = val.Elem()\n\t} else {\n\t\treturn errors.New(\"cannot map to non-pointer struct\")\n\t}\n\n\treturn s.mapTo(val)\n}\n\n// MapTo maps file to given struct.\nfunc (f *File) MapTo(v interface{}) error {\n\treturn f.Section(\"\").MapTo(v)\n}\n\n// MapTo maps data sources to given struct with name mapper.\nfunc MapToWithMapper(v interface{}, mapper NameMapper, source interface{}, others ...interface{}) error {\n\tcfg, err := Load(source, others...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcfg.NameMapper = mapper\n\treturn cfg.MapTo(v)\n}\n\n// MapTo maps data sources to given struct.\nfunc MapTo(v, source interface{}, others ...interface{}) error {\n\treturn MapToWithMapper(v, nil, source, others...)\n}\n\n// reflectSliceWithProperType does the opposite thing as setSliceWithProperType.\nfunc reflectSliceWithProperType(key *Key, field reflect.Value, delim string) error {\n\tslice := field.Slice(0, field.Len())\n\tif field.Len() == 0 {\n\t\treturn nil\n\t}\n\n\tvar buf bytes.Buffer\n\tsliceOf := field.Type().Elem().Kind()\n\tfor i := 0; i < field.Len(); i++ {\n\t\tswitch sliceOf {\n\t\tcase reflect.String:\n\t\t\tbuf.WriteString(slice.Index(i).String())\n\t\tcase reflect.Int, reflect.Int64:\n\t\t\tbuf.WriteString(fmt.Sprint(slice.Index(i).Int()))\n\t\tcase reflect.Uint, reflect.Uint64:\n\t\t\tbuf.WriteString(fmt.Sprint(slice.Index(i).Uint()))\n\t\tcase reflect.Float64:\n\t\t\tbuf.WriteString(fmt.Sprint(slice.Index(i).Float()))\n\t\tcase reflectTime:\n\t\t\tbuf.WriteString(slice.Index(i).Interface().(time.Time).Format(time.RFC3339))\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unsupported type '[]%s'\", sliceOf)\n\t\t}\n\t\tbuf.WriteString(delim)\n\t}\n\tkey.SetValue(buf.String()[:buf.Len()-1])\n\treturn nil\n}\n\n// reflectWithProperType does the opposite thing as setWithProperType.\nfunc reflectWithProperType(t reflect.Type, key *Key, field reflect.Value, delim string) error {\n\tswitch t.Kind() {\n\tcase reflect.String:\n\t\tkey.SetValue(field.String())\n\tcase reflect.Bool:\n\t\tkey.SetValue(fmt.Sprint(field.Bool()))\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tkey.SetValue(fmt.Sprint(field.Int()))\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\tkey.SetValue(fmt.Sprint(field.Uint()))\n\tcase reflect.Float32, reflect.Float64:\n\t\tkey.SetValue(fmt.Sprint(field.Float()))\n\tcase reflectTime:\n\t\tkey.SetValue(fmt.Sprint(field.Interface().(time.Time).Format(time.RFC3339)))\n\tcase reflect.Slice:\n\t\treturn reflectSliceWithProperType(key, field, delim)\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported type '%s'\", t)\n\t}\n\treturn nil\n}\n\n// CR: copied from encoding/json/encode.go with modifications of time.Time support.\n// TODO: add more test coverage.\nfunc isEmptyValue(v reflect.Value) bool {\n\tswitch v.Kind() {\n\tcase reflect.Array, reflect.Map, reflect.Slice, reflect.String:\n\t\treturn v.Len() == 0\n\tcase reflect.Bool:\n\t\treturn !v.Bool()\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn v.Int() == 0\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn v.Uint() == 0\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn v.Float() == 0\n\tcase reflectTime:\n\t\treturn v.Interface().(time.Time).IsZero()\n\tcase reflect.Interface, reflect.Ptr:\n\t\treturn v.IsNil()\n\t}\n\treturn false\n}\n\nfunc (s *Section) reflectFrom(val reflect.Value) error {\n\tif val.Kind() == reflect.Ptr {\n\t\tval = val.Elem()\n\t}\n\ttyp := val.Type()\n\n\tfor i := 0; i < typ.NumField(); i++ {\n\t\tfield := val.Field(i)\n\t\ttpField := typ.Field(i)\n\n\t\ttag := tpField.Tag.Get(\"ini\")\n\t\tif tag == \"-\" {\n\t\t\tcontinue\n\t\t}\n\n\t\topts := strings.SplitN(tag, \",\", 2)\n\t\tif len(opts) == 2 && opts[1] == \"omitempty\" && isEmptyValue(field) {\n\t\t\tcontinue\n\t\t}\n\n\t\tfieldName := s.parseFieldName(tpField.Name, opts[0])\n\t\tif len(fieldName) == 0 || !field.CanSet() {\n\t\t\tcontinue\n\t\t}\n\n\t\tif (tpField.Type.Kind() == reflect.Ptr && tpField.Anonymous) ||\n\t\t\t(tpField.Type.Kind() == reflect.Struct && tpField.Type.Name() != \"Time\") {\n\t\t\t// Note: The only error here is section doesn't exist.\n\t\t\tsec, err := s.f.GetSection(fieldName)\n\t\t\tif err != nil {\n\t\t\t\t// Note: fieldName can never be empty here, ignore error.\n\t\t\t\tsec, _ = s.f.NewSection(fieldName)\n\t\t\t}\n\t\t\tif err = sec.reflectFrom(field); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error reflecting field (%s): %v\", fieldName, err)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\t// Note: Same reason as secion.\n\t\tkey, err := s.GetKey(fieldName)\n\t\tif err != nil {\n\t\t\tkey, _ = s.NewKey(fieldName, \"\")\n\t\t}\n\t\tif err = reflectWithProperType(tpField.Type, key, field, parseDelim(tpField.Tag.Get(\"delim\"))); err != nil {\n\t\t\treturn fmt.Errorf(\"error reflecting field (%s): %v\", fieldName, err)\n\t\t}\n\n\t}\n\treturn nil\n}\n\n// ReflectFrom reflects secion from given struct.\nfunc (s *Section) ReflectFrom(v interface{}) error {\n\ttyp := reflect.TypeOf(v)\n\tval := reflect.ValueOf(v)\n\tif typ.Kind() == reflect.Ptr {\n\t\ttyp = typ.Elem()\n\t\tval = val.Elem()\n\t} else {\n\t\treturn errors.New(\"cannot reflect from non-pointer struct\")\n\t}\n\n\treturn s.reflectFrom(val)\n}\n\n// ReflectFrom reflects file from given struct.\nfunc (f *File) ReflectFrom(v interface{}) error {\n\treturn f.Section(\"\").ReflectFrom(v)\n}\n\n// ReflectFrom reflects data sources from given struct with name mapper.\nfunc ReflectFromWithMapper(cfg *File, v interface{}, mapper NameMapper) error {\n\tcfg.NameMapper = mapper\n\treturn cfg.ReflectFrom(v)\n}\n\n// ReflectFrom reflects data sources from given struct.\nfunc ReflectFrom(cfg *File, v interface{}) error {\n\treturn ReflectFromWithMapper(cfg, v, nil)\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/LICENSE",
    "content": "Mozilla Public License, version 2.0\n\n1. Definitions\n\n1.1. “Contributor”\n\n     means each individual or legal entity that creates, contributes to the\n     creation of, or owns Covered Software.\n\n1.2. “Contributor Version”\n\n     means the combination of the Contributions of others (if any) used by a\n     Contributor and that particular Contributor’s Contribution.\n\n1.3. “Contribution”\n\n     means Covered Software of a particular Contributor.\n\n1.4. “Covered Software”\n\n     means Source Code Form to which the initial Contributor has attached the\n     notice in Exhibit A, the Executable Form of such Source Code Form, and\n     Modifications of such Source Code Form, in each case including portions\n     thereof.\n\n1.5. “Incompatible With Secondary Licenses”\n     means\n\n     a. that the initial Contributor has attached the notice described in\n        Exhibit B to the Covered Software; or\n\n     b. that the Covered Software was made available under the terms of version\n        1.1 or earlier of the License, but not also under the terms of a\n        Secondary License.\n\n1.6. “Executable Form”\n\n     means any form of the work other than Source Code Form.\n\n1.7. “Larger Work”\n\n     means a work that combines Covered Software with other material, in a separate\n     file or files, that is not Covered Software.\n\n1.8. “License”\n\n     means this document.\n\n1.9. “Licensable”\n\n     means having the right to grant, to the maximum extent possible, whether at the\n     time of the initial grant or subsequently, any and all of the rights conveyed by\n     this License.\n\n1.10. “Modifications”\n\n     means any of the following:\n\n     a. any file in Source Code Form that results from an addition to, deletion\n        from, or modification of the contents of Covered Software; or\n\n     b. any new file in Source Code Form that contains any Covered Software.\n\n1.11. “Patent Claims” of a Contributor\n\n      means any patent claim(s), including without limitation, method, process,\n      and apparatus claims, in any patent Licensable by such Contributor that\n      would be infringed, but for the grant of the License, by the making,\n      using, selling, offering for sale, having made, import, or transfer of\n      either its Contributions or its Contributor Version.\n\n1.12. “Secondary License”\n\n      means either the GNU General Public License, Version 2.0, the GNU Lesser\n      General Public License, Version 2.1, the GNU Affero General Public\n      License, Version 3.0, or any later versions of those licenses.\n\n1.13. “Source Code Form”\n\n      means the form of the work preferred for making modifications.\n\n1.14. “You” (or “Your”)\n\n      means an individual or a legal entity exercising rights under this\n      License. For legal entities, “You” includes any entity that controls, is\n      controlled by, or is under common control with You. For purposes of this\n      definition, “control” means (a) the power, direct or indirect, to cause\n      the direction or management of such entity, whether by contract or\n      otherwise, or (b) ownership of more than fifty percent (50%) of the\n      outstanding shares or beneficial ownership of such entity.\n\n\n2. License Grants and Conditions\n\n2.1. Grants\n\n     Each Contributor hereby grants You a world-wide, royalty-free,\n     non-exclusive license:\n\n     a. under intellectual property rights (other than patent or trademark)\n        Licensable by such Contributor to use, reproduce, make available,\n        modify, display, perform, distribute, and otherwise exploit its\n        Contributions, either on an unmodified basis, with Modifications, or as\n        part of a Larger Work; and\n\n     b. under Patent Claims of such Contributor to make, use, sell, offer for\n        sale, have made, import, and otherwise transfer either its Contributions\n        or its Contributor Version.\n\n2.2. Effective Date\n\n     The licenses granted in Section 2.1 with respect to any Contribution become\n     effective for each Contribution on the date the Contributor first distributes\n     such Contribution.\n\n2.3. Limitations on Grant Scope\n\n     The licenses granted in this Section 2 are the only rights granted under this\n     License. No additional rights or licenses will be implied from the distribution\n     or licensing of Covered Software under this License. Notwithstanding Section\n     2.1(b) above, no patent license is granted by a Contributor:\n\n     a. for any code that a Contributor has removed from Covered Software; or\n\n     b. for infringements caused by: (i) Your and any other third party’s\n        modifications of Covered Software, or (ii) the combination of its\n        Contributions with other software (except as part of its Contributor\n        Version); or\n\n     c. under Patent Claims infringed by Covered Software in the absence of its\n        Contributions.\n\n     This License does not grant any rights in the trademarks, service marks, or\n     logos of any Contributor (except as may be necessary to comply with the\n     notice requirements in Section 3.4).\n\n2.4. Subsequent Licenses\n\n     No Contributor makes additional grants as a result of Your choice to\n     distribute the Covered Software under a subsequent version of this License\n     (see Section 10.2) or under the terms of a Secondary License (if permitted\n     under the terms of Section 3.3).\n\n2.5. Representation\n\n     Each Contributor represents that the Contributor believes its Contributions\n     are its original creation(s) or it has sufficient rights to grant the\n     rights to its Contributions conveyed by this License.\n\n2.6. Fair Use\n\n     This License is not intended to limit any rights You have under applicable\n     copyright doctrines of fair use, fair dealing, or other equivalents.\n\n2.7. Conditions\n\n     Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in\n     Section 2.1.\n\n\n3. Responsibilities\n\n3.1. Distribution of Source Form\n\n     All distribution of Covered Software in Source Code Form, including any\n     Modifications that You create or to which You contribute, must be under the\n     terms of this License. You must inform recipients that the Source Code Form\n     of the Covered Software is governed by the terms of this License, and how\n     they can obtain a copy of this License. You may not attempt to alter or\n     restrict the recipients’ rights in the Source Code Form.\n\n3.2. Distribution of Executable Form\n\n     If You distribute Covered Software in Executable Form then:\n\n     a. such Covered Software must also be made available in Source Code Form,\n        as described in Section 3.1, and You must inform recipients of the\n        Executable Form how they can obtain a copy of such Source Code Form by\n        reasonable means in a timely manner, at a charge no more than the cost\n        of distribution to the recipient; and\n\n     b. You may distribute such Executable Form under the terms of this License,\n        or sublicense it under different terms, provided that the license for\n        the Executable Form does not attempt to limit or alter the recipients’\n        rights in the Source Code Form under this License.\n\n3.3. Distribution of a Larger Work\n\n     You may create and distribute a Larger Work under terms of Your choice,\n     provided that You also comply with the requirements of this License for the\n     Covered Software. If the Larger Work is a combination of Covered Software\n     with a work governed by one or more Secondary Licenses, and the Covered\n     Software is not Incompatible With Secondary Licenses, this License permits\n     You to additionally distribute such Covered Software under the terms of\n     such Secondary License(s), so that the recipient of the Larger Work may, at\n     their option, further distribute the Covered Software under the terms of\n     either this License or such Secondary License(s).\n\n3.4. Notices\n\n     You may not remove or alter the substance of any license notices (including\n     copyright notices, patent notices, disclaimers of warranty, or limitations\n     of liability) contained within the Source Code Form of the Covered\n     Software, except that You may alter any license notices to the extent\n     required to remedy known factual inaccuracies.\n\n3.5. Application of Additional Terms\n\n     You may choose to offer, and to charge a fee for, warranty, support,\n     indemnity or liability obligations to one or more recipients of Covered\n     Software. However, You may do so only on Your own behalf, and not on behalf\n     of any Contributor. You must make it absolutely clear that any such\n     warranty, support, indemnity, or liability obligation is offered by You\n     alone, and You hereby agree to indemnify every Contributor for any\n     liability incurred by such Contributor as a result of warranty, support,\n     indemnity or liability terms You offer. You may include additional\n     disclaimers of warranty and limitations of liability specific to any\n     jurisdiction.\n\n4. Inability to Comply Due to Statute or Regulation\n\n   If it is impossible for You to comply with any of the terms of this License\n   with respect to some or all of the Covered Software due to statute, judicial\n   order, or regulation then You must: (a) comply with the terms of this License\n   to the maximum extent possible; and (b) describe the limitations and the code\n   they affect. Such description must be placed in a text file included with all\n   distributions of the Covered Software under this License. Except to the\n   extent prohibited by statute or regulation, such description must be\n   sufficiently detailed for a recipient of ordinary skill to be able to\n   understand it.\n\n5. Termination\n\n5.1. The rights granted under this License will terminate automatically if You\n     fail to comply with any of its terms. However, if You become compliant,\n     then the rights granted under this License from a particular Contributor\n     are reinstated (a) provisionally, unless and until such Contributor\n     explicitly and finally terminates Your grants, and (b) on an ongoing basis,\n     if such Contributor fails to notify You of the non-compliance by some\n     reasonable means prior to 60 days after You have come back into compliance.\n     Moreover, Your grants from a particular Contributor are reinstated on an\n     ongoing basis if such Contributor notifies You of the non-compliance by\n     some reasonable means, this is the first time You have received notice of\n     non-compliance with this License from such Contributor, and You become\n     compliant prior to 30 days after Your receipt of the notice.\n\n5.2. If You initiate litigation against any entity by asserting a patent\n     infringement claim (excluding declaratory judgment actions, counter-claims,\n     and cross-claims) alleging that a Contributor Version directly or\n     indirectly infringes any patent, then the rights granted to You by any and\n     all Contributors for the Covered Software under Section 2.1 of this License\n     shall terminate.\n\n5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user\n     license agreements (excluding distributors and resellers) which have been\n     validly granted by You or Your distributors under this License prior to\n     termination shall survive termination.\n\n6. Disclaimer of Warranty\n\n   Covered Software is provided under this License on an “as is” basis, without\n   warranty of any kind, either expressed, implied, or statutory, including,\n   without limitation, warranties that the Covered Software is free of defects,\n   merchantable, fit for a particular purpose or non-infringing. The entire\n   risk as to the quality and performance of the Covered Software is with You.\n   Should any Covered Software prove defective in any respect, You (not any\n   Contributor) assume the cost of any necessary servicing, repair, or\n   correction. This disclaimer of warranty constitutes an essential part of this\n   License. No use of  any Covered Software is authorized under this License\n   except under this disclaimer.\n\n7. Limitation of Liability\n\n   Under no circumstances and under no legal theory, whether tort (including\n   negligence), contract, or otherwise, shall any Contributor, or anyone who\n   distributes Covered Software as permitted above, be liable to You for any\n   direct, indirect, special, incidental, or consequential damages of any\n   character including, without limitation, damages for lost profits, loss of\n   goodwill, work stoppage, computer failure or malfunction, or any and all\n   other commercial damages or losses, even if such party shall have been\n   informed of the possibility of such damages. This limitation of liability\n   shall not apply to liability for death or personal injury resulting from such\n   party’s negligence to the extent applicable law prohibits such limitation.\n   Some jurisdictions do not allow the exclusion or limitation of incidental or\n   consequential damages, so this exclusion and limitation may not apply to You.\n\n8. Litigation\n\n   Any litigation relating to this License may be brought only in the courts of\n   a jurisdiction where the defendant maintains its principal place of business\n   and such litigation shall be governed by laws of that jurisdiction, without\n   reference to its conflict-of-law provisions. Nothing in this Section shall\n   prevent a party’s ability to bring cross-claims or counter-claims.\n\n9. Miscellaneous\n\n   This License represents the complete agreement concerning the subject matter\n   hereof. If any provision of this License is held to be unenforceable, such\n   provision shall be reformed only to the extent necessary to make it\n   enforceable. Any law or regulation which provides that the language of a\n   contract shall be construed against the drafter shall not be used to construe\n   this License against a Contributor.\n\n\n10. Versions of the License\n\n10.1. New Versions\n\n      Mozilla Foundation is the license steward. Except as provided in Section\n      10.3, no one other than the license steward has the right to modify or\n      publish new versions of this License. Each version will be given a\n      distinguishing version number.\n\n10.2. Effect of New Versions\n\n      You may distribute the Covered Software under the terms of the version of\n      the License under which You originally received the Covered Software, or\n      under the terms of any subsequent version published by the license\n      steward.\n\n10.3. Modified Versions\n\n      If you create software not governed by this License, and you want to\n      create a new license for such software, you may create and use a modified\n      version of this License if you rename the license and remove any\n      references to the name of the license steward (except to note that such\n      modified license differs from this License).\n\n10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses\n      If You choose to distribute Source Code Form that is Incompatible With\n      Secondary Licenses under the terms of this version of the License, the\n      notice described in Exhibit B of this License must be attached.\n\nExhibit A - Source Code Form License Notice\n\n      This Source Code Form is subject to the\n      terms of the Mozilla Public License, v.\n      2.0. If a copy of the MPL was not\n      distributed with this file, You can\n      obtain one at\n      http://mozilla.org/MPL/2.0/.\n\nIf it is not possible or desirable to put the notice in a particular file, then\nYou may include the notice in a location (such as a LICENSE file in a relevant\ndirectory) where a recipient would be likely to look for such a notice.\n\nYou may add additional accurate notices of copyright ownership.\n\nExhibit B - “Incompatible With Secondary Licenses” Notice\n\n      This Source Code Form is “Incompatible\n      With Secondary Licenses”, as defined by\n      the Mozilla Public License, v. 2.0.\n\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/Makefile",
    "content": "TEST?=./...\r\n\r\ndefault: test\r\n\r\nfmt: generate\r\n\tgo fmt ./...\r\n\r\ntest: generate\r\n\tgo test $(TEST) $(TESTARGS)\r\n\r\ngenerate:\r\n\tgo generate ./...\r\n\r\nupdatedeps:\r\n\tgo get -u golang.org/x/tools/cmd/stringer\r\n\r\n.PHONY: default generate test updatedeps\r\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/README.md",
    "content": "# HCL\n\n[![GoDoc](https://godoc.org/github.com/hashicorp/hcl?status.png)](https://godoc.org/github.com/hashicorp/hcl) [![Build Status](https://travis-ci.org/hashicorp/hcl.svg?branch=master)](https://travis-ci.org/hashicorp/hcl)\n\nHCL (HashiCorp Configuration Language) is a configuration language built\nby HashiCorp. The goal of HCL is to build a structured configuration language\nthat is both human and machine friendly for use with command-line tools, but\nspecifically targeted towards DevOps tools, servers, etc.\n\nHCL is also fully JSON compatible. That is, JSON can be used as completely\nvalid input to a system expecting HCL. This helps makes systems\ninteroperable with other systems.\n\nHCL is heavily inspired by\n[libucl](https://github.com/vstakhov/libucl),\nnginx configuration, and others similar.\n\n## Why?\n\nA common question when viewing HCL is to ask the question: why not\nJSON, YAML, etc.?\n\nPrior to HCL, the tools we built at [HashiCorp](http://www.hashicorp.com)\nused a variety of configuration languages from full programming languages\nsuch as Ruby to complete data structure languages such as JSON. What we\nlearned is that some people wanted human-friendly configuration languages\nand some people wanted machine-friendly languages.\n\nJSON fits a nice balance in this, but is fairly verbose and most\nimportantly doesn't support comments. With YAML, we found that beginners\nhad a really hard time determining what the actual structure was, and\nended up guessing more often than not whether to use a hyphen, colon, etc.\nin order to represent some configuration key.\n\nFull programming languages such as Ruby enable complex behavior\na configuration language shouldn't usually allow, and also forces\npeople to learn some set of Ruby.\n\nBecause of this, we decided to create our own configuration language\nthat is JSON-compatible. Our configuration language (HCL) is designed\nto be written and modified by humans. The API for HCL allows JSON\nas an input so that it is also machine-friendly (machines can generate\nJSON instead of trying to generate HCL).\n\nOur goal with HCL is not to alienate other configuration languages.\nIt is instead to provide HCL as a specialized language for our tools,\nand JSON as the interoperability layer.\n\n## Syntax\n\nFor a complete grammar, please see the parser itself. A high-level overview\nof the syntax and grammar is listed here.\n\n  * Single line comments start with `#` or `//`\n\n  * Multi-line comments are wrapped in `/*` and `*/`. Nested block comments\n    are not allowed. A multi-line comment (also known as a block comment)\n    terminates at the first `*/` found.\n\n  * Values are assigned with the syntax `key = value` (whitespace doesn't\n    matter). The value can be any primitive: a string, number, boolean,\n    object, or list.\n\n  * Strings are double-quoted and can contain any UTF-8 characters.\n    Example: `\"Hello, World\"`\n\n  * Multi-line strings start with `<<EOF` at the end of a line, and end\n    with `EOF` on its own line ([here documents](https://en.wikipedia.org/wiki/Here_document)).\n    Any text may be used in place of `EOF`. Example:\n```\n<<FOO\nhello\nworld\nFOO\n```\n\n  * Numbers are assumed to be base 10. If you prefix a number with 0x,\n    it is treated as a hexadecimal. If it is prefixed with 0, it is\n    treated as an octal. Numbers can be in scientific notation: \"1e10\".\n\n  * Boolean values: `true`, `false`\n\n  * Arrays can be made by wrapping it in `[]`. Example:\n    `[\"foo\", \"bar\", 42]`. Arrays can contain primitives,\n    other arrays, and objects. As an alternative, lists\n    of objects can be created with repeated blocks, using\n    this structure:\n\n    ```hcl\n    service {\n        key = \"value\"\n    }\n\n    service {\n        key = \"value\"\n    }\n    ```\n\nObjects and nested objects are created using the structure shown below:\n\n```\nvariable \"ami\" {\n    description = \"the AMI to use\"\n}\n```\nThis would be equivalent to the following json:\n``` json\n{\n  \"variable\": {\n      \"ami\": {\n          \"description\": \"the AMI to use\"\n        }\n    }\n}\n```\n\n## Thanks\n\nThanks to:\n\n  * [@vstakhov](https://github.com/vstakhov) - The original libucl parser\n    and syntax that HCL was based off of.\n\n  * [@fatih](https://github.com/fatih) - The rewritten HCL parser\n    in pure Go (no goyacc) and support for a printer.\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/appveyor.yml",
    "content": "version: \"build-{branch}-{build}\"\nimage: Visual Studio 2015\nclone_folder: c:\\gopath\\src\\github.com\\hashicorp\\hcl\nenvironment:\n  GOPATH: c:\\gopath\ninit:\n  - git config --global core.autocrlf true\ninstall:\n- cmd: >-\n    echo %Path%\n\n    go version\n\n    go env\nbuild_script:\n- cmd: go test -v ./...\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/decoder.go",
    "content": "package hcl\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/hashicorp/hcl/hcl/ast\"\n\t\"github.com/hashicorp/hcl/hcl/parser\"\n\t\"github.com/hashicorp/hcl/hcl/token\"\n)\n\n// This is the tag to use with structures to have settings for HCL\nconst tagName = \"hcl\"\n\nvar (\n\t// nodeType holds a reference to the type of ast.Node\n\tnodeType reflect.Type = findNodeType()\n)\n\n// Unmarshal accepts a byte slice as input and writes the\n// data to the value pointed to by v.\nfunc Unmarshal(bs []byte, v interface{}) error {\n\troot, err := parse(bs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn DecodeObject(v, root)\n}\n\n// Decode reads the given input and decodes it into the structure\n// given by `out`.\nfunc Decode(out interface{}, in string) error {\n\tobj, err := Parse(in)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn DecodeObject(out, obj)\n}\n\n// DecodeObject is a lower-level version of Decode. It decodes a\n// raw Object into the given output.\nfunc DecodeObject(out interface{}, n ast.Node) error {\n\tval := reflect.ValueOf(out)\n\tif val.Kind() != reflect.Ptr {\n\t\treturn errors.New(\"result must be a pointer\")\n\t}\n\n\t// If we have the file, we really decode the root node\n\tif f, ok := n.(*ast.File); ok {\n\t\tn = f.Node\n\t}\n\n\tvar d decoder\n\treturn d.decode(\"root\", n, val.Elem())\n}\n\ntype decoder struct {\n\tstack []reflect.Kind\n}\n\nfunc (d *decoder) decode(name string, node ast.Node, result reflect.Value) error {\n\tk := result\n\n\t// If we have an interface with a valid value, we use that\n\t// for the check.\n\tif result.Kind() == reflect.Interface {\n\t\telem := result.Elem()\n\t\tif elem.IsValid() {\n\t\t\tk = elem\n\t\t}\n\t}\n\n\t// Push current onto stack unless it is an interface.\n\tif k.Kind() != reflect.Interface {\n\t\td.stack = append(d.stack, k.Kind())\n\n\t\t// Schedule a pop\n\t\tdefer func() {\n\t\t\td.stack = d.stack[:len(d.stack)-1]\n\t\t}()\n\t}\n\n\tswitch k.Kind() {\n\tcase reflect.Bool:\n\t\treturn d.decodeBool(name, node, result)\n\tcase reflect.Float64:\n\t\treturn d.decodeFloat(name, node, result)\n\tcase reflect.Int:\n\t\treturn d.decodeInt(name, node, result)\n\tcase reflect.Interface:\n\t\t// When we see an interface, we make our own thing\n\t\treturn d.decodeInterface(name, node, result)\n\tcase reflect.Map:\n\t\treturn d.decodeMap(name, node, result)\n\tcase reflect.Ptr:\n\t\treturn d.decodePtr(name, node, result)\n\tcase reflect.Slice:\n\t\treturn d.decodeSlice(name, node, result)\n\tcase reflect.String:\n\t\treturn d.decodeString(name, node, result)\n\tcase reflect.Struct:\n\t\treturn d.decodeStruct(name, node, result)\n\tdefault:\n\t\treturn &parser.PosError{\n\t\t\tPos: node.Pos(),\n\t\t\tErr: fmt.Errorf(\"%s: unknown kind to decode into: %s\", name, k.Kind()),\n\t\t}\n\t}\n}\n\nfunc (d *decoder) decodeBool(name string, node ast.Node, result reflect.Value) error {\n\tswitch n := node.(type) {\n\tcase *ast.LiteralType:\n\t\tif n.Token.Type == token.BOOL {\n\t\t\tv, err := strconv.ParseBool(n.Token.Text)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tresult.Set(reflect.ValueOf(v))\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn &parser.PosError{\n\t\tPos: node.Pos(),\n\t\tErr: fmt.Errorf(\"%s: unknown type %T\", name, node),\n\t}\n}\n\nfunc (d *decoder) decodeFloat(name string, node ast.Node, result reflect.Value) error {\n\tswitch n := node.(type) {\n\tcase *ast.LiteralType:\n\t\tif n.Token.Type == token.FLOAT {\n\t\t\tv, err := strconv.ParseFloat(n.Token.Text, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tresult.Set(reflect.ValueOf(v))\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn &parser.PosError{\n\t\tPos: node.Pos(),\n\t\tErr: fmt.Errorf(\"%s: unknown type %T\", name, node),\n\t}\n}\n\nfunc (d *decoder) decodeInt(name string, node ast.Node, result reflect.Value) error {\n\tswitch n := node.(type) {\n\tcase *ast.LiteralType:\n\t\tswitch n.Token.Type {\n\t\tcase token.NUMBER:\n\t\t\tv, err := strconv.ParseInt(n.Token.Text, 0, 0)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tresult.Set(reflect.ValueOf(int(v)))\n\t\t\treturn nil\n\t\tcase token.STRING:\n\t\t\tv, err := strconv.ParseInt(n.Token.Value().(string), 0, 0)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tresult.Set(reflect.ValueOf(int(v)))\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn &parser.PosError{\n\t\tPos: node.Pos(),\n\t\tErr: fmt.Errorf(\"%s: unknown type %T\", name, node),\n\t}\n}\n\nfunc (d *decoder) decodeInterface(name string, node ast.Node, result reflect.Value) error {\n\t// When we see an ast.Node, we retain the value to enable deferred decoding.\n\t// Very useful in situations where we want to preserve ast.Node information\n\t// like Pos\n\tif result.Type() == nodeType && result.CanSet() {\n\t\tresult.Set(reflect.ValueOf(node))\n\t\treturn nil\n\t}\n\n\tvar set reflect.Value\n\tredecode := true\n\n\t// For testing types, ObjectType should just be treated as a list. We\n\t// set this to a temporary var because we want to pass in the real node.\n\ttestNode := node\n\tif ot, ok := node.(*ast.ObjectType); ok {\n\t\ttestNode = ot.List\n\t}\n\n\tswitch n := testNode.(type) {\n\tcase *ast.ObjectList:\n\t\t// If we're at the root or we're directly within a slice, then we\n\t\t// decode objects into map[string]interface{}, otherwise we decode\n\t\t// them into lists.\n\t\tif len(d.stack) == 0 || d.stack[len(d.stack)-1] == reflect.Slice {\n\t\t\tvar temp map[string]interface{}\n\t\t\ttempVal := reflect.ValueOf(temp)\n\t\t\tresult := reflect.MakeMap(\n\t\t\t\treflect.MapOf(\n\t\t\t\t\treflect.TypeOf(\"\"),\n\t\t\t\t\ttempVal.Type().Elem()))\n\n\t\t\tset = result\n\t\t} else {\n\t\t\tvar temp []map[string]interface{}\n\t\t\ttempVal := reflect.ValueOf(temp)\n\t\t\tresult := reflect.MakeSlice(\n\t\t\t\treflect.SliceOf(tempVal.Type().Elem()), 0, len(n.Items))\n\t\t\tset = result\n\t\t}\n\tcase *ast.ObjectType:\n\t\t// If we're at the root or we're directly within a slice, then we\n\t\t// decode objects into map[string]interface{}, otherwise we decode\n\t\t// them into lists.\n\t\tif len(d.stack) == 0 || d.stack[len(d.stack)-1] == reflect.Slice {\n\t\t\tvar temp map[string]interface{}\n\t\t\ttempVal := reflect.ValueOf(temp)\n\t\t\tresult := reflect.MakeMap(\n\t\t\t\treflect.MapOf(\n\t\t\t\t\treflect.TypeOf(\"\"),\n\t\t\t\t\ttempVal.Type().Elem()))\n\n\t\t\tset = result\n\t\t} else {\n\t\t\tvar temp []map[string]interface{}\n\t\t\ttempVal := reflect.ValueOf(temp)\n\t\t\tresult := reflect.MakeSlice(\n\t\t\t\treflect.SliceOf(tempVal.Type().Elem()), 0, 1)\n\t\t\tset = result\n\t\t}\n\tcase *ast.ListType:\n\t\tvar temp []interface{}\n\t\ttempVal := reflect.ValueOf(temp)\n\t\tresult := reflect.MakeSlice(\n\t\t\treflect.SliceOf(tempVal.Type().Elem()), 0, 0)\n\t\tset = result\n\tcase *ast.LiteralType:\n\t\tswitch n.Token.Type {\n\t\tcase token.BOOL:\n\t\t\tvar result bool\n\t\t\tset = reflect.Indirect(reflect.New(reflect.TypeOf(result)))\n\t\tcase token.FLOAT:\n\t\t\tvar result float64\n\t\t\tset = reflect.Indirect(reflect.New(reflect.TypeOf(result)))\n\t\tcase token.NUMBER:\n\t\t\tvar result int\n\t\t\tset = reflect.Indirect(reflect.New(reflect.TypeOf(result)))\n\t\tcase token.STRING, token.HEREDOC:\n\t\t\tset = reflect.Indirect(reflect.New(reflect.TypeOf(\"\")))\n\t\tdefault:\n\t\t\treturn &parser.PosError{\n\t\t\t\tPos: node.Pos(),\n\t\t\t\tErr: fmt.Errorf(\"%s: cannot decode into interface: %T\", name, node),\n\t\t\t}\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\n\t\t\t\"%s: cannot decode into interface: %T\",\n\t\t\tname, node)\n\t}\n\n\t// Set the result to what its supposed to be, then reset\n\t// result so we don't reflect into this method anymore.\n\tresult.Set(set)\n\n\tif redecode {\n\t\t// Revisit the node so that we can use the newly instantiated\n\t\t// thing and populate it.\n\t\tif err := d.decode(name, node, result); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (d *decoder) decodeMap(name string, node ast.Node, result reflect.Value) error {\n\tif item, ok := node.(*ast.ObjectItem); ok {\n\t\tnode = &ast.ObjectList{Items: []*ast.ObjectItem{item}}\n\t}\n\n\tif ot, ok := node.(*ast.ObjectType); ok {\n\t\tnode = ot.List\n\t}\n\n\tn, ok := node.(*ast.ObjectList)\n\tif !ok {\n\t\treturn &parser.PosError{\n\t\t\tPos: node.Pos(),\n\t\t\tErr: fmt.Errorf(\"%s: not an object type for map (%T)\", name, node),\n\t\t}\n\t}\n\n\t// If we have an interface, then we can address the interface,\n\t// but not the slice itself, so get the element but set the interface\n\tset := result\n\tif result.Kind() == reflect.Interface {\n\t\tresult = result.Elem()\n\t}\n\n\tresultType := result.Type()\n\tresultElemType := resultType.Elem()\n\tresultKeyType := resultType.Key()\n\tif resultKeyType.Kind() != reflect.String {\n\t\treturn &parser.PosError{\n\t\t\tPos: node.Pos(),\n\t\t\tErr: fmt.Errorf(\"%s: map must have string keys\", name),\n\t\t}\n\t}\n\n\t// Make a map if it is nil\n\tresultMap := result\n\tif result.IsNil() {\n\t\tresultMap = reflect.MakeMap(\n\t\t\treflect.MapOf(resultKeyType, resultElemType))\n\t}\n\n\t// Go through each element and decode it.\n\tdone := make(map[string]struct{})\n\tfor _, item := range n.Items {\n\t\tif item.Val == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\t// github.com/hashicorp/terraform/issue/5740\n\t\tif len(item.Keys) == 0 {\n\t\t\treturn &parser.PosError{\n\t\t\t\tPos: node.Pos(),\n\t\t\t\tErr: fmt.Errorf(\"%s: map must have string keys\", name),\n\t\t\t}\n\t\t}\n\n\t\t// Get the key we're dealing with, which is the first item\n\t\tkeyStr := item.Keys[0].Token.Value().(string)\n\n\t\t// If we've already processed this key, then ignore it\n\t\tif _, ok := done[keyStr]; ok {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Determine the value. If we have more than one key, then we\n\t\t// get the objectlist of only these keys.\n\t\titemVal := item.Val\n\t\tif len(item.Keys) > 1 {\n\t\t\titemVal = n.Filter(keyStr)\n\t\t\tdone[keyStr] = struct{}{}\n\t\t}\n\n\t\t// Make the field name\n\t\tfieldName := fmt.Sprintf(\"%s.%s\", name, keyStr)\n\n\t\t// Get the key/value as reflection values\n\t\tkey := reflect.ValueOf(keyStr)\n\t\tval := reflect.Indirect(reflect.New(resultElemType))\n\n\t\t// If we have a pre-existing value in the map, use that\n\t\toldVal := resultMap.MapIndex(key)\n\t\tif oldVal.IsValid() {\n\t\t\tval.Set(oldVal)\n\t\t}\n\n\t\t// Decode!\n\t\tif err := d.decode(fieldName, itemVal, val); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Set the value on the map\n\t\tresultMap.SetMapIndex(key, val)\n\t}\n\n\t// Set the final map if we can\n\tset.Set(resultMap)\n\treturn nil\n}\n\nfunc (d *decoder) decodePtr(name string, node ast.Node, result reflect.Value) error {\n\t// Create an element of the concrete (non pointer) type and decode\n\t// into that. Then set the value of the pointer to this type.\n\tresultType := result.Type()\n\tresultElemType := resultType.Elem()\n\tval := reflect.New(resultElemType)\n\tif err := d.decode(name, node, reflect.Indirect(val)); err != nil {\n\t\treturn err\n\t}\n\n\tresult.Set(val)\n\treturn nil\n}\n\nfunc (d *decoder) decodeSlice(name string, node ast.Node, result reflect.Value) error {\n\t// If we have an interface, then we can address the interface,\n\t// but not the slice itself, so get the element but set the interface\n\tset := result\n\tif result.Kind() == reflect.Interface {\n\t\tresult = result.Elem()\n\t}\n\n\t// Create the slice if it isn't nil\n\tresultType := result.Type()\n\tresultElemType := resultType.Elem()\n\tif result.IsNil() {\n\t\tresultSliceType := reflect.SliceOf(resultElemType)\n\t\tresult = reflect.MakeSlice(\n\t\t\tresultSliceType, 0, 0)\n\t}\n\n\t// Figure out the items we'll be copying into the slice\n\tvar items []ast.Node\n\tswitch n := node.(type) {\n\tcase *ast.ObjectList:\n\t\titems = make([]ast.Node, len(n.Items))\n\t\tfor i, item := range n.Items {\n\t\t\titems[i] = item\n\t\t}\n\tcase *ast.ObjectType:\n\t\titems = []ast.Node{n}\n\tcase *ast.ListType:\n\t\titems = n.List\n\tdefault:\n\t\treturn &parser.PosError{\n\t\t\tPos: node.Pos(),\n\t\t\tErr: fmt.Errorf(\"unknown slice type: %T\", node),\n\t\t}\n\t}\n\n\tfor i, item := range items {\n\t\tfieldName := fmt.Sprintf(\"%s[%d]\", name, i)\n\n\t\t// Decode\n\t\tval := reflect.Indirect(reflect.New(resultElemType))\n\t\tif err := d.decode(fieldName, item, val); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Append it onto the slice\n\t\tresult = reflect.Append(result, val)\n\t}\n\n\tset.Set(result)\n\treturn nil\n}\n\nfunc (d *decoder) decodeString(name string, node ast.Node, result reflect.Value) error {\n\tswitch n := node.(type) {\n\tcase *ast.LiteralType:\n\t\tswitch n.Token.Type {\n\t\tcase token.NUMBER:\n\t\t\tresult.Set(reflect.ValueOf(n.Token.Text).Convert(result.Type()))\n\t\t\treturn nil\n\t\tcase token.STRING, token.HEREDOC:\n\t\t\tresult.Set(reflect.ValueOf(n.Token.Value()).Convert(result.Type()))\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn &parser.PosError{\n\t\tPos: node.Pos(),\n\t\tErr: fmt.Errorf(\"%s: unknown type for string %T\", name, node),\n\t}\n}\n\nfunc (d *decoder) decodeStruct(name string, node ast.Node, result reflect.Value) error {\n\tvar item *ast.ObjectItem\n\tif it, ok := node.(*ast.ObjectItem); ok {\n\t\titem = it\n\t\tnode = it.Val\n\t}\n\n\tif ot, ok := node.(*ast.ObjectType); ok {\n\t\tnode = ot.List\n\t}\n\n\t// Handle the special case where the object itself is a literal. Previously\n\t// the yacc parser would always ensure top-level elements were arrays. The new\n\t// parser does not make the same guarantees, thus we need to convert any\n\t// top-level literal elements into a list.\n\tif _, ok := node.(*ast.LiteralType); ok && item != nil {\n\t\tnode = &ast.ObjectList{Items: []*ast.ObjectItem{item}}\n\t}\n\n\tlist, ok := node.(*ast.ObjectList)\n\tif !ok {\n\t\treturn &parser.PosError{\n\t\t\tPos: node.Pos(),\n\t\t\tErr: fmt.Errorf(\"%s: not an object type for struct (%T)\", name, node),\n\t\t}\n\t}\n\n\t// This slice will keep track of all the structs we'll be decoding.\n\t// There can be more than one struct if there are embedded structs\n\t// that are squashed.\n\tstructs := make([]reflect.Value, 1, 5)\n\tstructs[0] = result\n\n\t// Compile the list of all the fields that we're going to be decoding\n\t// from all the structs.\n\tfields := make(map[*reflect.StructField]reflect.Value)\n\tfor len(structs) > 0 {\n\t\tstructVal := structs[0]\n\t\tstructs = structs[1:]\n\n\t\tstructType := structVal.Type()\n\t\tfor i := 0; i < structType.NumField(); i++ {\n\t\t\tfieldType := structType.Field(i)\n\t\t\ttagParts := strings.Split(fieldType.Tag.Get(tagName), \",\")\n\n\t\t\t// Ignore fields with tag name \"-\"\n\t\t\tif tagParts[0] == \"-\" {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif fieldType.Anonymous {\n\t\t\t\tfieldKind := fieldType.Type.Kind()\n\t\t\t\tif fieldKind != reflect.Struct {\n\t\t\t\t\treturn &parser.PosError{\n\t\t\t\t\t\tPos: node.Pos(),\n\t\t\t\t\t\tErr: fmt.Errorf(\"%s: unsupported type to struct: %s\",\n\t\t\t\t\t\t\tfieldType.Name, fieldKind),\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// We have an embedded field. We \"squash\" the fields down\n\t\t\t\t// if specified in the tag.\n\t\t\t\tsquash := false\n\t\t\t\tfor _, tag := range tagParts[1:] {\n\t\t\t\t\tif tag == \"squash\" {\n\t\t\t\t\t\tsquash = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif squash {\n\t\t\t\t\tstructs = append(\n\t\t\t\t\t\tstructs, result.FieldByName(fieldType.Name))\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Normal struct field, store it away\n\t\t\tfields[&fieldType] = structVal.Field(i)\n\t\t}\n\t}\n\n\tusedKeys := make(map[string]struct{})\n\tdecodedFields := make([]string, 0, len(fields))\n\tdecodedFieldsVal := make([]reflect.Value, 0)\n\tunusedKeysVal := make([]reflect.Value, 0)\n\tfor fieldType, field := range fields {\n\t\tif !field.IsValid() {\n\t\t\t// This should never happen\n\t\t\tpanic(\"field is not valid\")\n\t\t}\n\n\t\t// If we can't set the field, then it is unexported or something,\n\t\t// and we just continue onwards.\n\t\tif !field.CanSet() {\n\t\t\tcontinue\n\t\t}\n\n\t\tfieldName := fieldType.Name\n\n\t\ttagValue := fieldType.Tag.Get(tagName)\n\t\ttagParts := strings.SplitN(tagValue, \",\", 2)\n\t\tif len(tagParts) >= 2 {\n\t\t\tswitch tagParts[1] {\n\t\t\tcase \"decodedFields\":\n\t\t\t\tdecodedFieldsVal = append(decodedFieldsVal, field)\n\t\t\t\tcontinue\n\t\t\tcase \"key\":\n\t\t\t\tif item == nil {\n\t\t\t\t\treturn &parser.PosError{\n\t\t\t\t\t\tPos: node.Pos(),\n\t\t\t\t\t\tErr: fmt.Errorf(\"%s: %s asked for 'key', impossible\",\n\t\t\t\t\t\t\tname, fieldName),\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfield.SetString(item.Keys[0].Token.Value().(string))\n\t\t\t\tcontinue\n\t\t\tcase \"unusedKeys\":\n\t\t\t\tunusedKeysVal = append(unusedKeysVal, field)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif tagParts[0] != \"\" {\n\t\t\tfieldName = tagParts[0]\n\t\t}\n\n\t\t// Determine the element we'll use to decode. If it is a single\n\t\t// match (only object with the field), then we decode it exactly.\n\t\t// If it is a prefix match, then we decode the matches.\n\t\tfilter := list.Filter(fieldName)\n\t\tprefixMatches := filter.Children()\n\t\tmatches := filter.Elem()\n\t\tif len(matches.Items) == 0 && len(prefixMatches.Items) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Track the used key\n\t\tusedKeys[fieldName] = struct{}{}\n\n\t\t// Create the field name and decode. We range over the elements\n\t\t// because we actually want the value.\n\t\tfieldName = fmt.Sprintf(\"%s.%s\", name, fieldName)\n\t\tif len(prefixMatches.Items) > 0 {\n\t\t\tif err := d.decode(fieldName, prefixMatches, field); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tfor _, match := range matches.Items {\n\t\t\tvar decodeNode ast.Node = match.Val\n\t\t\tif ot, ok := decodeNode.(*ast.ObjectType); ok {\n\t\t\t\tdecodeNode = &ast.ObjectList{Items: ot.List.Items}\n\t\t\t}\n\n\t\t\tif err := d.decode(fieldName, decodeNode, field); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tdecodedFields = append(decodedFields, fieldType.Name)\n\t}\n\n\tif len(decodedFieldsVal) > 0 {\n\t\t// Sort it so that it is deterministic\n\t\tsort.Strings(decodedFields)\n\n\t\tfor _, v := range decodedFieldsVal {\n\t\t\tv.Set(reflect.ValueOf(decodedFields))\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// findNodeType returns the type of ast.Node\nfunc findNodeType() reflect.Type {\n\tvar nodeContainer struct {\n\t\tNode ast.Node\n\t}\n\tvalue := reflect.ValueOf(nodeContainer).FieldByName(\"Node\")\n\treturn value.Type()\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/hcl/ast/ast.go",
    "content": "// Package ast declares the types used to represent syntax trees for HCL\n// (HashiCorp Configuration Language)\npackage ast\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/hashicorp/hcl/hcl/token\"\n)\n\n// Node is an element in the abstract syntax tree.\ntype Node interface {\n\tnode()\n\tPos() token.Pos\n}\n\nfunc (File) node()         {}\nfunc (ObjectList) node()   {}\nfunc (ObjectKey) node()    {}\nfunc (ObjectItem) node()   {}\nfunc (Comment) node()      {}\nfunc (CommentGroup) node() {}\nfunc (ObjectType) node()   {}\nfunc (LiteralType) node()  {}\nfunc (ListType) node()     {}\n\n// File represents a single HCL file\ntype File struct {\n\tNode     Node            // usually a *ObjectList\n\tComments []*CommentGroup // list of all comments in the source\n}\n\nfunc (f *File) Pos() token.Pos {\n\treturn f.Node.Pos()\n}\n\n// ObjectList represents a list of ObjectItems. An HCL file itself is an\n// ObjectList.\ntype ObjectList struct {\n\tItems []*ObjectItem\n}\n\nfunc (o *ObjectList) Add(item *ObjectItem) {\n\to.Items = append(o.Items, item)\n}\n\n// Filter filters out the objects with the given key list as a prefix.\n//\n// The returned list of objects contain ObjectItems where the keys have\n// this prefix already stripped off. This might result in objects with\n// zero-length key lists if they have no children.\n//\n// If no matches are found, an empty ObjectList (non-nil) is returned.\nfunc (o *ObjectList) Filter(keys ...string) *ObjectList {\n\tvar result ObjectList\n\tfor _, item := range o.Items {\n\t\t// If there aren't enough keys, then ignore this\n\t\tif len(item.Keys) < len(keys) {\n\t\t\tcontinue\n\t\t}\n\n\t\tmatch := true\n\t\tfor i, key := range item.Keys[:len(keys)] {\n\t\t\tkey := key.Token.Value().(string)\n\t\t\tif key != keys[i] && !strings.EqualFold(key, keys[i]) {\n\t\t\t\tmatch = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !match {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Strip off the prefix from the children\n\t\tnewItem := *item\n\t\tnewItem.Keys = newItem.Keys[len(keys):]\n\t\tresult.Add(&newItem)\n\t}\n\n\treturn &result\n}\n\n// Children returns further nested objects (key length > 0) within this\n// ObjectList. This should be used with Filter to get at child items.\nfunc (o *ObjectList) Children() *ObjectList {\n\tvar result ObjectList\n\tfor _, item := range o.Items {\n\t\tif len(item.Keys) > 0 {\n\t\t\tresult.Add(item)\n\t\t}\n\t}\n\n\treturn &result\n}\n\n// Elem returns items in the list that are direct element assignments\n// (key length == 0). This should be used with Filter to get at elements.\nfunc (o *ObjectList) Elem() *ObjectList {\n\tvar result ObjectList\n\tfor _, item := range o.Items {\n\t\tif len(item.Keys) == 0 {\n\t\t\tresult.Add(item)\n\t\t}\n\t}\n\n\treturn &result\n}\n\nfunc (o *ObjectList) Pos() token.Pos {\n\t// always returns the uninitiliazed position\n\treturn o.Items[0].Pos()\n}\n\n// ObjectItem represents a HCL Object Item. An item is represented with a key\n// (or keys). It can be an assignment or an object (both normal and nested)\ntype ObjectItem struct {\n\t// keys is only one length long if it's of type assignment. If it's a\n\t// nested object it can be larger than one. In that case \"assign\" is\n\t// invalid as there is no assignments for a nested object.\n\tKeys []*ObjectKey\n\n\t// assign contains the position of \"=\", if any\n\tAssign token.Pos\n\n\t// val is the item itself. It can be an object,list, number, bool or a\n\t// string. If key length is larger than one, val can be only of type\n\t// Object.\n\tVal Node\n\n\tLeadComment *CommentGroup // associated lead comment\n\tLineComment *CommentGroup // associated line comment\n}\n\nfunc (o *ObjectItem) Pos() token.Pos {\n\t// I'm not entirely sure what causes this, but removing this causes\n\t// a test failure. We should investigate at some point.\n\tif len(o.Keys) == 0 {\n\t\treturn token.Pos{}\n\t}\n\n\treturn o.Keys[0].Pos()\n}\n\n// ObjectKeys are either an identifier or of type string.\ntype ObjectKey struct {\n\tToken token.Token\n}\n\nfunc (o *ObjectKey) Pos() token.Pos {\n\treturn o.Token.Pos\n}\n\n// LiteralType represents a literal of basic type. Valid types are:\n// token.NUMBER, token.FLOAT, token.BOOL and token.STRING\ntype LiteralType struct {\n\tToken token.Token\n\n\t// associated line comment, only when used in a list\n\tLineComment *CommentGroup\n}\n\nfunc (l *LiteralType) Pos() token.Pos {\n\treturn l.Token.Pos\n}\n\n// ListStatement represents a HCL List type\ntype ListType struct {\n\tLbrack token.Pos // position of \"[\"\n\tRbrack token.Pos // position of \"]\"\n\tList   []Node    // the elements in lexical order\n}\n\nfunc (l *ListType) Pos() token.Pos {\n\treturn l.Lbrack\n}\n\nfunc (l *ListType) Add(node Node) {\n\tl.List = append(l.List, node)\n}\n\n// ObjectType represents a HCL Object Type\ntype ObjectType struct {\n\tLbrace token.Pos   // position of \"{\"\n\tRbrace token.Pos   // position of \"}\"\n\tList   *ObjectList // the nodes in lexical order\n}\n\nfunc (o *ObjectType) Pos() token.Pos {\n\treturn o.Lbrace\n}\n\n// Comment node represents a single //, # style or /*- style commment\ntype Comment struct {\n\tStart token.Pos // position of / or #\n\tText  string\n}\n\nfunc (c *Comment) Pos() token.Pos {\n\treturn c.Start\n}\n\n// CommentGroup node represents a sequence of comments with no other tokens and\n// no empty lines between.\ntype CommentGroup struct {\n\tList []*Comment // len(List) > 0\n}\n\nfunc (c *CommentGroup) Pos() token.Pos {\n\treturn c.List[0].Pos()\n}\n\n//-------------------------------------------------------------------\n// GoStringer\n//-------------------------------------------------------------------\n\nfunc (o *ObjectKey) GoString() string  { return fmt.Sprintf(\"*%#v\", *o) }\nfunc (o *ObjectList) GoString() string { return fmt.Sprintf(\"*%#v\", *o) }\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/hcl/ast/walk.go",
    "content": "package ast\n\nimport \"fmt\"\n\n// WalkFunc describes a function to be called for each node during a Walk. The\n// returned node can be used to rewrite the AST. Walking stops the returned\n// bool is false.\ntype WalkFunc func(Node) (Node, bool)\n\n// Walk traverses an AST in depth-first order: It starts by calling fn(node);\n// node must not be nil. If fn returns true, Walk invokes fn recursively for\n// each of the non-nil children of node, followed by a call of fn(nil). The\n// returned node of fn can be used to rewrite the passed node to fn.\nfunc Walk(node Node, fn WalkFunc) Node {\n\trewritten, ok := fn(node)\n\tif !ok {\n\t\treturn rewritten\n\t}\n\n\tswitch n := node.(type) {\n\tcase *File:\n\t\tn.Node = Walk(n.Node, fn)\n\tcase *ObjectList:\n\t\tfor i, item := range n.Items {\n\t\t\tn.Items[i] = Walk(item, fn).(*ObjectItem)\n\t\t}\n\tcase *ObjectKey:\n\t\t// nothing to do\n\tcase *ObjectItem:\n\t\tfor i, k := range n.Keys {\n\t\t\tn.Keys[i] = Walk(k, fn).(*ObjectKey)\n\t\t}\n\n\t\tif n.Val != nil {\n\t\t\tn.Val = Walk(n.Val, fn)\n\t\t}\n\tcase *LiteralType:\n\t\t// nothing to do\n\tcase *ListType:\n\t\tfor i, l := range n.List {\n\t\t\tn.List[i] = Walk(l, fn)\n\t\t}\n\tcase *ObjectType:\n\t\tn.List = Walk(n.List, fn).(*ObjectList)\n\tdefault:\n\t\t// should we panic here?\n\t\tfmt.Printf(\"unknown type: %T\\n\", n)\n\t}\n\n\tfn(nil)\n\treturn rewritten\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/hcl/parser/error.go",
    "content": "package parser\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/hashicorp/hcl/hcl/token\"\n)\n\n// PosError is a parse error that contains a position.\ntype PosError struct {\n\tPos token.Pos\n\tErr error\n}\n\nfunc (e *PosError) Error() string {\n\treturn fmt.Sprintf(\"At %s: %s\", e.Pos, e.Err)\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/hcl/parser/parser.go",
    "content": "// Package parser implements a parser for HCL (HashiCorp Configuration\n// Language)\npackage parser\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/hashicorp/hcl/hcl/ast\"\n\t\"github.com/hashicorp/hcl/hcl/scanner\"\n\t\"github.com/hashicorp/hcl/hcl/token\"\n)\n\ntype Parser struct {\n\tsc *scanner.Scanner\n\n\t// Last read token\n\ttok       token.Token\n\tcommaPrev token.Token\n\n\tcomments    []*ast.CommentGroup\n\tleadComment *ast.CommentGroup // last lead comment\n\tlineComment *ast.CommentGroup // last line comment\n\n\tenableTrace bool\n\tindent      int\n\tn           int // buffer size (max = 1)\n}\n\nfunc newParser(src []byte) *Parser {\n\treturn &Parser{\n\t\tsc: scanner.New(src),\n\t}\n}\n\n// Parse returns the fully parsed source and returns the abstract syntax tree.\nfunc Parse(src []byte) (*ast.File, error) {\n\tp := newParser(src)\n\treturn p.Parse()\n}\n\nvar errEofToken = errors.New(\"EOF token found\")\n\n// Parse returns the fully parsed source and returns the abstract syntax tree.\nfunc (p *Parser) Parse() (*ast.File, error) {\n\tf := &ast.File{}\n\tvar err, scerr error\n\tp.sc.Error = func(pos token.Pos, msg string) {\n\t\tscerr = &PosError{Pos: pos, Err: errors.New(msg)}\n\t}\n\n\tf.Node, err = p.objectList()\n\tif scerr != nil {\n\t\treturn nil, scerr\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tf.Comments = p.comments\n\treturn f, nil\n}\n\nfunc (p *Parser) objectList() (*ast.ObjectList, error) {\n\tdefer un(trace(p, \"ParseObjectList\"))\n\tnode := &ast.ObjectList{}\n\n\tfor {\n\t\tn, err := p.objectItem()\n\t\tif err == errEofToken {\n\t\t\tbreak // we are finished\n\t\t}\n\n\t\t// we don't return a nil node, because might want to use already\n\t\t// collected items.\n\t\tif err != nil {\n\t\t\treturn node, err\n\t\t}\n\n\t\tnode.Add(n)\n\n\t\t// object lists can be optionally comma-delimited e.g. when a list of maps\n\t\t// is being expressed, so a comma is allowed here - it's simply consumed\n\t\ttok := p.scan()\n\t\tif tok.Type != token.COMMA {\n\t\t\tp.unscan()\n\t\t}\n\t}\n\treturn node, nil\n}\n\nfunc (p *Parser) consumeComment() (comment *ast.Comment, endline int) {\n\tendline = p.tok.Pos.Line\n\n\t// count the endline if it's multiline comment, ie starting with /*\n\tif len(p.tok.Text) > 1 && p.tok.Text[1] == '*' {\n\t\t// don't use range here - no need to decode Unicode code points\n\t\tfor i := 0; i < len(p.tok.Text); i++ {\n\t\t\tif p.tok.Text[i] == '\\n' {\n\t\t\t\tendline++\n\t\t\t}\n\t\t}\n\t}\n\n\tcomment = &ast.Comment{Start: p.tok.Pos, Text: p.tok.Text}\n\tp.tok = p.sc.Scan()\n\treturn\n}\n\nfunc (p *Parser) consumeCommentGroup(n int) (comments *ast.CommentGroup, endline int) {\n\tvar list []*ast.Comment\n\tendline = p.tok.Pos.Line\n\n\tfor p.tok.Type == token.COMMENT && p.tok.Pos.Line <= endline+n {\n\t\tvar comment *ast.Comment\n\t\tcomment, endline = p.consumeComment()\n\t\tlist = append(list, comment)\n\t}\n\n\t// add comment group to the comments list\n\tcomments = &ast.CommentGroup{List: list}\n\tp.comments = append(p.comments, comments)\n\n\treturn\n}\n\n// objectItem parses a single object item\nfunc (p *Parser) objectItem() (*ast.ObjectItem, error) {\n\tdefer un(trace(p, \"ParseObjectItem\"))\n\n\tkeys, err := p.objectKey()\n\tif len(keys) > 0 && err == errEofToken {\n\t\t// We ignore eof token here since it is an error if we didn't\n\t\t// receive a value (but we did receive a key) for the item.\n\t\terr = nil\n\t}\n\tif len(keys) > 0 && err != nil && p.tok.Type == token.RBRACE {\n\t\t// This is a strange boolean statement, but what it means is:\n\t\t// We have keys with no value, and we're likely in an object\n\t\t// (since RBrace ends an object). For this, we set err to nil so\n\t\t// we continue and get the error below of having the wrong value\n\t\t// type.\n\t\terr = nil\n\n\t\t// Reset the token type so we don't think it completed fine. See\n\t\t// objectType which uses p.tok.Type to check if we're done with\n\t\t// the object.\n\t\tp.tok.Type = token.EOF\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\to := &ast.ObjectItem{\n\t\tKeys: keys,\n\t}\n\n\tif p.leadComment != nil {\n\t\to.LeadComment = p.leadComment\n\t\tp.leadComment = nil\n\t}\n\n\tswitch p.tok.Type {\n\tcase token.ASSIGN:\n\t\to.Assign = p.tok.Pos\n\t\to.Val, err = p.object()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tcase token.LBRACE:\n\t\to.Val, err = p.objectType()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tdefault:\n\t\tkeyStr := make([]string, 0, len(keys))\n\t\tfor _, k := range keys {\n\t\t\tkeyStr = append(keyStr, k.Token.Text)\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"key '%s' expected start of object ('{') or assignment ('=')\",\n\t\t\tstrings.Join(keyStr, \" \"))\n\t}\n\n\t// do a look-ahead for line comment\n\tp.scan()\n\tif len(keys) > 0 && o.Val.Pos().Line == keys[0].Pos().Line && p.lineComment != nil {\n\t\to.LineComment = p.lineComment\n\t\tp.lineComment = nil\n\t}\n\tp.unscan()\n\treturn o, nil\n}\n\n// objectKey parses an object key and returns a ObjectKey AST\nfunc (p *Parser) objectKey() ([]*ast.ObjectKey, error) {\n\tkeyCount := 0\n\tkeys := make([]*ast.ObjectKey, 0)\n\n\tfor {\n\t\ttok := p.scan()\n\t\tswitch tok.Type {\n\t\tcase token.EOF:\n\t\t\t// It is very important to also return the keys here as well as\n\t\t\t// the error. This is because we need to be able to tell if we\n\t\t\t// did parse keys prior to finding the EOF, or if we just found\n\t\t\t// a bare EOF.\n\t\t\treturn keys, errEofToken\n\t\tcase token.ASSIGN:\n\t\t\t// assignment or object only, but not nested objects. this is not\n\t\t\t// allowed: `foo bar = {}`\n\t\t\tif keyCount > 1 {\n\t\t\t\treturn nil, &PosError{\n\t\t\t\t\tPos: p.tok.Pos,\n\t\t\t\t\tErr: fmt.Errorf(\"nested object expected: LBRACE got: %s\", p.tok.Type),\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif keyCount == 0 {\n\t\t\t\treturn nil, &PosError{\n\t\t\t\t\tPos: p.tok.Pos,\n\t\t\t\t\tErr: errors.New(\"no object keys found!\"),\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn keys, nil\n\t\tcase token.LBRACE:\n\t\t\tvar err error\n\n\t\t\t// If we have no keys, then it is a syntax error. i.e. {{}} is not\n\t\t\t// allowed.\n\t\t\tif len(keys) == 0 {\n\t\t\t\terr = &PosError{\n\t\t\t\t\tPos: p.tok.Pos,\n\t\t\t\t\tErr: fmt.Errorf(\"expected: IDENT | STRING got: %s\", p.tok.Type),\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// object\n\t\t\treturn keys, err\n\t\tcase token.IDENT, token.STRING:\n\t\t\tkeyCount++\n\t\t\tkeys = append(keys, &ast.ObjectKey{Token: p.tok})\n\t\tcase token.ILLEGAL:\n\t\t\tfmt.Println(\"illegal\")\n\t\tdefault:\n\t\t\treturn keys, &PosError{\n\t\t\t\tPos: p.tok.Pos,\n\t\t\t\tErr: fmt.Errorf(\"expected: IDENT | STRING | ASSIGN | LBRACE got: %s\", p.tok.Type),\n\t\t\t}\n\t\t}\n\t}\n}\n\n// object parses any type of object, such as number, bool, string, object or\n// list.\nfunc (p *Parser) object() (ast.Node, error) {\n\tdefer un(trace(p, \"ParseType\"))\n\ttok := p.scan()\n\n\tswitch tok.Type {\n\tcase token.NUMBER, token.FLOAT, token.BOOL, token.STRING, token.HEREDOC:\n\t\treturn p.literalType()\n\tcase token.LBRACE:\n\t\treturn p.objectType()\n\tcase token.LBRACK:\n\t\treturn p.listType()\n\tcase token.COMMENT:\n\t\t// implement comment\n\tcase token.EOF:\n\t\treturn nil, errEofToken\n\t}\n\n\treturn nil, &PosError{\n\t\tPos: tok.Pos,\n\t\tErr: fmt.Errorf(\"Unknown token: %+v\", tok),\n\t}\n}\n\n// objectType parses an object type and returns a ObjectType AST\nfunc (p *Parser) objectType() (*ast.ObjectType, error) {\n\tdefer un(trace(p, \"ParseObjectType\"))\n\n\t// we assume that the currently scanned token is a LBRACE\n\to := &ast.ObjectType{\n\t\tLbrace: p.tok.Pos,\n\t}\n\n\tl, err := p.objectList()\n\n\t// if we hit RBRACE, we are good to go (means we parsed all Items), if it's\n\t// not a RBRACE, it's an syntax error and we just return it.\n\tif err != nil && p.tok.Type != token.RBRACE {\n\t\treturn nil, err\n\t}\n\n\t// If there is no error, we should be at a RBRACE to end the object\n\tif p.tok.Type != token.RBRACE {\n\t\treturn nil, fmt.Errorf(\"object expected closing RBRACE got: %s\", p.tok.Type)\n\t}\n\n\to.List = l\n\to.Rbrace = p.tok.Pos // advanced via parseObjectList\n\treturn o, nil\n}\n\n// listType parses a list type and returns a ListType AST\nfunc (p *Parser) listType() (*ast.ListType, error) {\n\tdefer un(trace(p, \"ParseListType\"))\n\n\t// we assume that the currently scanned token is a LBRACK\n\tl := &ast.ListType{\n\t\tLbrack: p.tok.Pos,\n\t}\n\n\tneedComma := false\n\tfor {\n\t\ttok := p.scan()\n\t\tif needComma {\n\t\t\tswitch tok.Type {\n\t\t\tcase token.COMMA, token.RBRACK:\n\t\t\tdefault:\n\t\t\t\treturn nil, &PosError{\n\t\t\t\t\tPos: tok.Pos,\n\t\t\t\t\tErr: fmt.Errorf(\n\t\t\t\t\t\t\"error parsing list, expected comma or list end, got: %s\",\n\t\t\t\t\t\ttok.Type),\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tswitch tok.Type {\n\t\tcase token.NUMBER, token.FLOAT, token.STRING, token.HEREDOC:\n\t\t\tnode, err := p.literalType()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tl.Add(node)\n\t\t\tneedComma = true\n\t\tcase token.COMMA:\n\t\t\t// get next list item or we are at the end\n\t\t\t// do a look-ahead for line comment\n\t\t\tp.scan()\n\t\t\tif p.lineComment != nil && len(l.List) > 0 {\n\t\t\t\tlit, ok := l.List[len(l.List)-1].(*ast.LiteralType)\n\t\t\t\tif ok {\n\t\t\t\t\tlit.LineComment = p.lineComment\n\t\t\t\t\tl.List[len(l.List)-1] = lit\n\t\t\t\t\tp.lineComment = nil\n\t\t\t\t}\n\t\t\t}\n\t\t\tp.unscan()\n\n\t\t\tneedComma = false\n\t\t\tcontinue\n\t\tcase token.LBRACE:\n\t\t\t// Looks like a nested object, so parse it out\n\t\t\tnode, err := p.objectType()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, &PosError{\n\t\t\t\t\tPos: tok.Pos,\n\t\t\t\t\tErr: fmt.Errorf(\n\t\t\t\t\t\t\"error while trying to parse object within list: %s\", err),\n\t\t\t\t}\n\t\t\t}\n\t\t\tl.Add(node)\n\t\t\tneedComma = true\n\t\tcase token.BOOL:\n\t\t\t// TODO(arslan) should we support? not supported by HCL yet\n\t\tcase token.LBRACK:\n\t\t\t// TODO(arslan) should we support nested lists? Even though it's\n\t\t\t// written in README of HCL, it's not a part of the grammar\n\t\t\t// (not defined in parse.y)\n\t\tcase token.RBRACK:\n\t\t\t// finished\n\t\t\tl.Rbrack = p.tok.Pos\n\t\t\treturn l, nil\n\t\tdefault:\n\t\t\treturn nil, &PosError{\n\t\t\t\tPos: tok.Pos,\n\t\t\t\tErr: fmt.Errorf(\"unexpected token while parsing list: %s\", tok.Type),\n\t\t\t}\n\t\t}\n\t}\n}\n\n// literalType parses a literal type and returns a LiteralType AST\nfunc (p *Parser) literalType() (*ast.LiteralType, error) {\n\tdefer un(trace(p, \"ParseLiteral\"))\n\n\treturn &ast.LiteralType{\n\t\tToken: p.tok,\n\t}, nil\n}\n\n// scan returns the next token from the underlying scanner. If a token has\n// been unscanned then read that instead. In the process, it collects any\n// comment groups encountered, and remembers the last lead and line comments.\nfunc (p *Parser) scan() token.Token {\n\t// If we have a token on the buffer, then return it.\n\tif p.n != 0 {\n\t\tp.n = 0\n\t\treturn p.tok\n\t}\n\n\t// Otherwise read the next token from the scanner and Save it to the buffer\n\t// in case we unscan later.\n\tprev := p.tok\n\tp.tok = p.sc.Scan()\n\n\tif p.tok.Type == token.COMMENT {\n\t\tvar comment *ast.CommentGroup\n\t\tvar endline int\n\n\t\t// fmt.Printf(\"p.tok.Pos.Line = %+v prev: %d endline %d \\n\",\n\t\t// p.tok.Pos.Line, prev.Pos.Line, endline)\n\t\tif p.tok.Pos.Line == prev.Pos.Line {\n\t\t\t// The comment is on same line as the previous token; it\n\t\t\t// cannot be a lead comment but may be a line comment.\n\t\t\tcomment, endline = p.consumeCommentGroup(0)\n\t\t\tif p.tok.Pos.Line != endline {\n\t\t\t\t// The next token is on a different line, thus\n\t\t\t\t// the last comment group is a line comment.\n\t\t\t\tp.lineComment = comment\n\t\t\t}\n\t\t}\n\n\t\t// consume successor comments, if any\n\t\tendline = -1\n\t\tfor p.tok.Type == token.COMMENT {\n\t\t\tcomment, endline = p.consumeCommentGroup(1)\n\t\t}\n\n\t\tif endline+1 == p.tok.Pos.Line && p.tok.Type != token.RBRACE {\n\t\t\tswitch p.tok.Type {\n\t\t\tcase token.RBRACE, token.RBRACK:\n\t\t\t\t// Do not count for these cases\n\t\t\tdefault:\n\t\t\t\t// The next token is following on the line immediately after the\n\t\t\t\t// comment group, thus the last comment group is a lead comment.\n\t\t\t\tp.leadComment = comment\n\t\t\t}\n\t\t}\n\n\t}\n\n\treturn p.tok\n}\n\n// unscan pushes the previously read token back onto the buffer.\nfunc (p *Parser) unscan() {\n\tp.n = 1\n}\n\n// ----------------------------------------------------------------------------\n// Parsing support\n\nfunc (p *Parser) printTrace(a ...interface{}) {\n\tif !p.enableTrace {\n\t\treturn\n\t}\n\n\tconst dots = \". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \"\n\tconst n = len(dots)\n\tfmt.Printf(\"%5d:%3d: \", p.tok.Pos.Line, p.tok.Pos.Column)\n\n\ti := 2 * p.indent\n\tfor i > n {\n\t\tfmt.Print(dots)\n\t\ti -= n\n\t}\n\t// i <= n\n\tfmt.Print(dots[0:i])\n\tfmt.Println(a...)\n}\n\nfunc trace(p *Parser, msg string) *Parser {\n\tp.printTrace(msg, \"(\")\n\tp.indent++\n\treturn p\n}\n\n// Usage pattern: defer un(trace(p, \"...\"))\nfunc un(p *Parser) {\n\tp.indent--\n\tp.printTrace(\")\")\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/hcl/scanner/scanner.go",
    "content": "// Package scanner implements a scanner for HCL (HashiCorp Configuration\n// Language) source text.\npackage scanner\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n\n\t\"github.com/hashicorp/hcl/hcl/token\"\n)\n\n// eof represents a marker rune for the end of the reader.\nconst eof = rune(0)\n\n// Scanner defines a lexical scanner\ntype Scanner struct {\n\tbuf *bytes.Buffer // Source buffer for advancing and scanning\n\tsrc []byte        // Source buffer for immutable access\n\n\t// Source Position\n\tsrcPos  token.Pos // current position\n\tprevPos token.Pos // previous position, used for peek() method\n\n\tlastCharLen int // length of last character in bytes\n\tlastLineLen int // length of last line in characters (for correct column reporting)\n\n\ttokStart int // token text start position\n\ttokEnd   int // token text end  position\n\n\t// Error is called for each error encountered. If no Error\n\t// function is set, the error is reported to os.Stderr.\n\tError func(pos token.Pos, msg string)\n\n\t// ErrorCount is incremented by one for each error encountered.\n\tErrorCount int\n\n\t// tokPos is the start position of most recently scanned token; set by\n\t// Scan. The Filename field is always left untouched by the Scanner.  If\n\t// an error is reported (via Error) and Position is invalid, the scanner is\n\t// not inside a token.\n\ttokPos token.Pos\n}\n\n// New creates and initializes a new instance of Scanner using src as\n// its source content.\nfunc New(src []byte) *Scanner {\n\t// even though we accept a src, we read from a io.Reader compatible type\n\t// (*bytes.Buffer). So in the future we might easily change it to streaming\n\t// read.\n\tb := bytes.NewBuffer(src)\n\ts := &Scanner{\n\t\tbuf: b,\n\t\tsrc: src,\n\t}\n\n\t// srcPosition always starts with 1\n\ts.srcPos.Line = 1\n\treturn s\n}\n\n// next reads the next rune from the bufferred reader. Returns the rune(0) if\n// an error occurs (or io.EOF is returned).\nfunc (s *Scanner) next() rune {\n\tch, size, err := s.buf.ReadRune()\n\tif err != nil {\n\t\t// advance for error reporting\n\t\ts.srcPos.Column++\n\t\ts.srcPos.Offset += size\n\t\ts.lastCharLen = size\n\t\treturn eof\n\t}\n\n\tif ch == utf8.RuneError && size == 1 {\n\t\ts.srcPos.Column++\n\t\ts.srcPos.Offset += size\n\t\ts.lastCharLen = size\n\t\ts.err(\"illegal UTF-8 encoding\")\n\t\treturn ch\n\t}\n\n\t// remember last position\n\ts.prevPos = s.srcPos\n\n\ts.srcPos.Column++\n\ts.lastCharLen = size\n\ts.srcPos.Offset += size\n\n\tif ch == '\\n' {\n\t\ts.srcPos.Line++\n\t\ts.lastLineLen = s.srcPos.Column\n\t\ts.srcPos.Column = 0\n\t}\n\n\t// debug\n\t// fmt.Printf(\"ch: %q, offset:column: %d:%d\\n\", ch, s.srcPos.Offset, s.srcPos.Column)\n\treturn ch\n}\n\n// unread unreads the previous read Rune and updates the source position\nfunc (s *Scanner) unread() {\n\tif err := s.buf.UnreadRune(); err != nil {\n\t\tpanic(err) // this is user fault, we should catch it\n\t}\n\ts.srcPos = s.prevPos // put back last position\n}\n\n// peek returns the next rune without advancing the reader.\nfunc (s *Scanner) peek() rune {\n\tpeek, _, err := s.buf.ReadRune()\n\tif err != nil {\n\t\treturn eof\n\t}\n\n\ts.buf.UnreadRune()\n\treturn peek\n}\n\n// Scan scans the next token and returns the token.\nfunc (s *Scanner) Scan() token.Token {\n\tch := s.next()\n\n\t// skip white space\n\tfor isWhitespace(ch) {\n\t\tch = s.next()\n\t}\n\n\tvar tok token.Type\n\n\t// token text markings\n\ts.tokStart = s.srcPos.Offset - s.lastCharLen\n\n\t// token position, initial next() is moving the offset by one(size of rune\n\t// actually), though we are interested with the starting point\n\ts.tokPos.Offset = s.srcPos.Offset - s.lastCharLen\n\tif s.srcPos.Column > 0 {\n\t\t// common case: last character was not a '\\n'\n\t\ts.tokPos.Line = s.srcPos.Line\n\t\ts.tokPos.Column = s.srcPos.Column\n\t} else {\n\t\t// last character was a '\\n'\n\t\t// (we cannot be at the beginning of the source\n\t\t// since we have called next() at least once)\n\t\ts.tokPos.Line = s.srcPos.Line - 1\n\t\ts.tokPos.Column = s.lastLineLen\n\t}\n\n\tswitch {\n\tcase isLetter(ch):\n\t\ttok = token.IDENT\n\t\tlit := s.scanIdentifier()\n\t\tif lit == \"true\" || lit == \"false\" {\n\t\t\ttok = token.BOOL\n\t\t}\n\tcase isDecimal(ch):\n\t\ttok = s.scanNumber(ch)\n\tdefault:\n\t\tswitch ch {\n\t\tcase eof:\n\t\t\ttok = token.EOF\n\t\tcase '\"':\n\t\t\ttok = token.STRING\n\t\t\ts.scanString()\n\t\tcase '#', '/':\n\t\t\ttok = token.COMMENT\n\t\t\ts.scanComment(ch)\n\t\tcase '.':\n\t\t\ttok = token.PERIOD\n\t\t\tch = s.peek()\n\t\t\tif isDecimal(ch) {\n\t\t\t\ttok = token.FLOAT\n\t\t\t\tch = s.scanMantissa(ch)\n\t\t\t\tch = s.scanExponent(ch)\n\t\t\t}\n\t\tcase '<':\n\t\t\ttok = token.HEREDOC\n\t\t\ts.scanHeredoc()\n\t\tcase '[':\n\t\t\ttok = token.LBRACK\n\t\tcase ']':\n\t\t\ttok = token.RBRACK\n\t\tcase '{':\n\t\t\ttok = token.LBRACE\n\t\tcase '}':\n\t\t\ttok = token.RBRACE\n\t\tcase ',':\n\t\t\ttok = token.COMMA\n\t\tcase '=':\n\t\t\ttok = token.ASSIGN\n\t\tcase '+':\n\t\t\ttok = token.ADD\n\t\tcase '-':\n\t\t\tif isDecimal(s.peek()) {\n\t\t\t\tch := s.next()\n\t\t\t\ttok = s.scanNumber(ch)\n\t\t\t} else {\n\t\t\t\ttok = token.SUB\n\t\t\t}\n\t\tdefault:\n\t\t\ts.err(\"illegal char\")\n\t\t}\n\t}\n\n\t// finish token ending\n\ts.tokEnd = s.srcPos.Offset\n\n\t// create token literal\n\tvar tokenText string\n\tif s.tokStart >= 0 {\n\t\ttokenText = string(s.src[s.tokStart:s.tokEnd])\n\t}\n\ts.tokStart = s.tokEnd // ensure idempotency of tokenText() call\n\n\treturn token.Token{\n\t\tType: tok,\n\t\tPos:  s.tokPos,\n\t\tText: tokenText,\n\t}\n}\n\nfunc (s *Scanner) scanComment(ch rune) {\n\t// single line comments\n\tif ch == '#' || (ch == '/' && s.peek() != '*') {\n\t\tif ch == '/' && s.peek() != '/' {\n\t\t\ts.err(\"expected '/' for comment\")\n\t\t\treturn\n\t\t}\n\n\t\tch = s.next()\n\t\tfor ch != '\\n' && ch >= 0 && ch != eof {\n\t\t\tch = s.next()\n\t\t}\n\t\tif ch != eof && ch >= 0 {\n\t\t\ts.unread()\n\t\t}\n\t\treturn\n\t}\n\n\t// be sure we get the character after /* This allows us to find comment's\n\t// that are not erminated\n\tif ch == '/' {\n\t\ts.next()\n\t\tch = s.next() // read character after \"/*\"\n\t}\n\n\t// look for /* - style comments\n\tfor {\n\t\tif ch < 0 || ch == eof {\n\t\t\ts.err(\"comment not terminated\")\n\t\t\tbreak\n\t\t}\n\n\t\tch0 := ch\n\t\tch = s.next()\n\t\tif ch0 == '*' && ch == '/' {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// scanNumber scans a HCL number definition starting with the given rune\nfunc (s *Scanner) scanNumber(ch rune) token.Type {\n\tif ch == '0' {\n\t\t// check for hexadecimal, octal or float\n\t\tch = s.next()\n\t\tif ch == 'x' || ch == 'X' {\n\t\t\t// hexadecimal\n\t\t\tch = s.next()\n\t\t\tfound := false\n\t\t\tfor isHexadecimal(ch) {\n\t\t\t\tch = s.next()\n\t\t\t\tfound = true\n\t\t\t}\n\n\t\t\tif !found {\n\t\t\t\ts.err(\"illegal hexadecimal number\")\n\t\t\t}\n\n\t\t\tif ch != eof {\n\t\t\t\ts.unread()\n\t\t\t}\n\n\t\t\treturn token.NUMBER\n\t\t}\n\n\t\t// now it's either something like: 0421(octal) or 0.1231(float)\n\t\tillegalOctal := false\n\t\tfor isDecimal(ch) {\n\t\t\tch = s.next()\n\t\t\tif ch == '8' || ch == '9' {\n\t\t\t\t// this is just a possibility. For example 0159 is illegal, but\n\t\t\t\t// 0159.23 is valid. So we mark a possible illegal octal. If\n\t\t\t\t// the next character is not a period, we'll print the error.\n\t\t\t\tillegalOctal = true\n\t\t\t}\n\t\t}\n\n\t\tif ch == 'e' || ch == 'E' {\n\t\t\tch = s.scanExponent(ch)\n\t\t\treturn token.FLOAT\n\t\t}\n\n\t\tif ch == '.' {\n\t\t\tch = s.scanFraction(ch)\n\n\t\t\tif ch == 'e' || ch == 'E' {\n\t\t\t\tch = s.next()\n\t\t\t\tch = s.scanExponent(ch)\n\t\t\t}\n\t\t\treturn token.FLOAT\n\t\t}\n\n\t\tif illegalOctal {\n\t\t\ts.err(\"illegal octal number\")\n\t\t}\n\n\t\tif ch != eof {\n\t\t\ts.unread()\n\t\t}\n\t\treturn token.NUMBER\n\t}\n\n\ts.scanMantissa(ch)\n\tch = s.next() // seek forward\n\tif ch == 'e' || ch == 'E' {\n\t\tch = s.scanExponent(ch)\n\t\treturn token.FLOAT\n\t}\n\n\tif ch == '.' {\n\t\tch = s.scanFraction(ch)\n\t\tif ch == 'e' || ch == 'E' {\n\t\t\tch = s.next()\n\t\t\tch = s.scanExponent(ch)\n\t\t}\n\t\treturn token.FLOAT\n\t}\n\n\tif ch != eof {\n\t\ts.unread()\n\t}\n\treturn token.NUMBER\n}\n\n// scanMantissa scans the mantissa begining from the rune. It returns the next\n// non decimal rune. It's used to determine wheter it's a fraction or exponent.\nfunc (s *Scanner) scanMantissa(ch rune) rune {\n\tscanned := false\n\tfor isDecimal(ch) {\n\t\tch = s.next()\n\t\tscanned = true\n\t}\n\n\tif scanned && ch != eof {\n\t\ts.unread()\n\t}\n\treturn ch\n}\n\n// scanFraction scans the fraction after the '.' rune\nfunc (s *Scanner) scanFraction(ch rune) rune {\n\tif ch == '.' {\n\t\tch = s.peek() // we peek just to see if we can move forward\n\t\tch = s.scanMantissa(ch)\n\t}\n\treturn ch\n}\n\n// scanExponent scans the remaining parts of an exponent after the 'e' or 'E'\n// rune.\nfunc (s *Scanner) scanExponent(ch rune) rune {\n\tif ch == 'e' || ch == 'E' {\n\t\tch = s.next()\n\t\tif ch == '-' || ch == '+' {\n\t\t\tch = s.next()\n\t\t}\n\t\tch = s.scanMantissa(ch)\n\t}\n\treturn ch\n}\n\n// scanHeredoc scans a heredoc string\nfunc (s *Scanner) scanHeredoc() {\n\t// Scan the second '<' in example: '<<EOF'\n\tif s.next() != '<' {\n\t\ts.err(\"heredoc expected second '<', didn't see it\")\n\t\treturn\n\t}\n\n\t// Get the original offset so we can read just the heredoc ident\n\toffs := s.srcPos.Offset\n\n\t// Scan the identifier\n\tch := s.next()\n\n\t// Indented heredoc syntax\n\tif ch == '-' {\n\t\tch = s.next()\n\t}\n\n\tfor isLetter(ch) || isDigit(ch) {\n\t\tch = s.next()\n\t}\n\n\t// If we reached an EOF then that is not good\n\tif ch == eof {\n\t\ts.err(\"heredoc not terminated\")\n\t\treturn\n\t}\n\n\t// Ignore the '\\r' in Windows line endings\n\tif ch == '\\r' {\n\t\tif s.peek() == '\\n' {\n\t\t\tch = s.next()\n\t\t}\n\t}\n\n\t// If we didn't reach a newline then that is also not good\n\tif ch != '\\n' {\n\t\ts.err(\"invalid characters in heredoc anchor\")\n\t\treturn\n\t}\n\n\t// Read the identifier\n\tidentBytes := s.src[offs : s.srcPos.Offset-s.lastCharLen]\n\tif len(identBytes) == 0 {\n\t\ts.err(\"zero-length heredoc anchor\")\n\t\treturn\n\t}\n\n\tvar identRegexp *regexp.Regexp\n\tif identBytes[0] == '-' {\n\t\tidentRegexp = regexp.MustCompile(fmt.Sprintf(`[[:space:]]*%s\\z`, identBytes[1:]))\n\t} else {\n\t\tidentRegexp = regexp.MustCompile(fmt.Sprintf(`[[:space:]]*%s\\z`, identBytes))\n\t}\n\n\t// Read the actual string value\n\tlineStart := s.srcPos.Offset\n\tfor {\n\t\tch := s.next()\n\n\t\t// Special newline handling.\n\t\tif ch == '\\n' {\n\t\t\t// Math is fast, so we first compare the byte counts to see if we have a chance\n\t\t\t// of seeing the same identifier - if the length is less than the number of bytes\n\t\t\t// in the identifier, this cannot be a valid terminator.\n\t\t\tlineBytesLen := s.srcPos.Offset - s.lastCharLen - lineStart\n\t\t\tif lineBytesLen >= len(identBytes) && identRegexp.Match(s.src[lineStart:s.srcPos.Offset-s.lastCharLen]) {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// Not an anchor match, record the start of a new line\n\t\t\tlineStart = s.srcPos.Offset\n\t\t}\n\n\t\tif ch == eof {\n\t\t\ts.err(\"heredoc not terminated\")\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}\n\n// scanString scans a quoted string\nfunc (s *Scanner) scanString() {\n\tbraces := 0\n\tfor {\n\t\t// '\"' opening already consumed\n\t\t// read character after quote\n\t\tch := s.next()\n\n\t\tif ch < 0 || ch == eof {\n\t\t\ts.err(\"literal not terminated\")\n\t\t\treturn\n\t\t}\n\n\t\tif ch == '\"' && braces == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\t// If we're going into a ${} then we can ignore quotes for awhile\n\t\tif braces == 0 && ch == '$' && s.peek() == '{' {\n\t\t\tbraces++\n\t\t\ts.next()\n\t\t} else if braces > 0 && ch == '{' {\n\t\t\tbraces++\n\t\t}\n\t\tif braces > 0 && ch == '}' {\n\t\t\tbraces--\n\t\t}\n\n\t\tif ch == '\\\\' {\n\t\t\ts.scanEscape()\n\t\t}\n\t}\n\n\treturn\n}\n\n// scanEscape scans an escape sequence\nfunc (s *Scanner) scanEscape() rune {\n\t// http://en.cppreference.com/w/cpp/language/escape\n\tch := s.next() // read character after '/'\n\tswitch ch {\n\tcase 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\\\', '\"':\n\t\t// nothing to do\n\tcase '0', '1', '2', '3', '4', '5', '6', '7':\n\t\t// octal notation\n\t\tch = s.scanDigits(ch, 8, 3)\n\tcase 'x':\n\t\t// hexademical notation\n\t\tch = s.scanDigits(s.next(), 16, 2)\n\tcase 'u':\n\t\t// universal character name\n\t\tch = s.scanDigits(s.next(), 16, 4)\n\tcase 'U':\n\t\t// universal character name\n\t\tch = s.scanDigits(s.next(), 16, 8)\n\tdefault:\n\t\ts.err(\"illegal char escape\")\n\t}\n\treturn ch\n}\n\n// scanDigits scans a rune with the given base for n times. For example an\n// octal notation \\184 would yield in scanDigits(ch, 8, 3)\nfunc (s *Scanner) scanDigits(ch rune, base, n int) rune {\n\tstart := n\n\tfor n > 0 && digitVal(ch) < base {\n\t\tch = s.next()\n\t\tif ch == eof {\n\t\t\t// If we see an EOF, we halt any more scanning of digits\n\t\t\t// immediately.\n\t\t\tbreak\n\t\t}\n\n\t\tn--\n\t}\n\tif n > 0 {\n\t\ts.err(\"illegal char escape\")\n\t}\n\n\tif n != start {\n\t\t// we scanned all digits, put the last non digit char back,\n\t\t// only if we read anything at all\n\t\ts.unread()\n\t}\n\n\treturn ch\n}\n\n// scanIdentifier scans an identifier and returns the literal string\nfunc (s *Scanner) scanIdentifier() string {\n\toffs := s.srcPos.Offset - s.lastCharLen\n\tch := s.next()\n\tfor isLetter(ch) || isDigit(ch) || ch == '-' || ch == '.' {\n\t\tch = s.next()\n\t}\n\n\tif ch != eof {\n\t\ts.unread() // we got identifier, put back latest char\n\t}\n\n\treturn string(s.src[offs:s.srcPos.Offset])\n}\n\n// recentPosition returns the position of the character immediately after the\n// character or token returned by the last call to Scan.\nfunc (s *Scanner) recentPosition() (pos token.Pos) {\n\tpos.Offset = s.srcPos.Offset - s.lastCharLen\n\tswitch {\n\tcase s.srcPos.Column > 0:\n\t\t// common case: last character was not a '\\n'\n\t\tpos.Line = s.srcPos.Line\n\t\tpos.Column = s.srcPos.Column\n\tcase s.lastLineLen > 0:\n\t\t// last character was a '\\n'\n\t\t// (we cannot be at the beginning of the source\n\t\t// since we have called next() at least once)\n\t\tpos.Line = s.srcPos.Line - 1\n\t\tpos.Column = s.lastLineLen\n\tdefault:\n\t\t// at the beginning of the source\n\t\tpos.Line = 1\n\t\tpos.Column = 1\n\t}\n\treturn\n}\n\n// err prints the error of any scanning to s.Error function. If the function is\n// not defined, by default it prints them to os.Stderr\nfunc (s *Scanner) err(msg string) {\n\ts.ErrorCount++\n\tpos := s.recentPosition()\n\n\tif s.Error != nil {\n\t\ts.Error(pos, msg)\n\t\treturn\n\t}\n\n\tfmt.Fprintf(os.Stderr, \"%s: %s\\n\", pos, msg)\n}\n\n// isHexadecimal returns true if the given rune is a letter\nfunc isLetter(ch rune) bool {\n\treturn 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= 0x80 && unicode.IsLetter(ch)\n}\n\n// isDigit returns true if the given rune is a decimal digit\nfunc isDigit(ch rune) bool {\n\treturn '0' <= ch && ch <= '9' || ch >= 0x80 && unicode.IsDigit(ch)\n}\n\n// isDecimal returns true if the given rune is a decimal number\nfunc isDecimal(ch rune) bool {\n\treturn '0' <= ch && ch <= '9'\n}\n\n// isHexadecimal returns true if the given rune is an hexadecimal number\nfunc isHexadecimal(ch rune) bool {\n\treturn '0' <= ch && ch <= '9' || 'a' <= ch && ch <= 'f' || 'A' <= ch && ch <= 'F'\n}\n\n// isWhitespace returns true if the rune is a space, tab, newline or carriage return\nfunc isWhitespace(ch rune) bool {\n\treturn ch == ' ' || ch == '\\t' || ch == '\\n' || ch == '\\r'\n}\n\n// digitVal returns the integer value of a given octal,decimal or hexadecimal rune\nfunc digitVal(ch rune) int {\n\tswitch {\n\tcase '0' <= ch && ch <= '9':\n\t\treturn int(ch - '0')\n\tcase 'a' <= ch && ch <= 'f':\n\t\treturn int(ch - 'a' + 10)\n\tcase 'A' <= ch && ch <= 'F':\n\t\treturn int(ch - 'A' + 10)\n\t}\n\treturn 16 // larger than any legal digit val\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/hcl/strconv/quote.go",
    "content": "package strconv\n\nimport (\n\t\"errors\"\n\t\"unicode/utf8\"\n)\n\n// ErrSyntax indicates that a value does not have the right syntax for the target type.\nvar ErrSyntax = errors.New(\"invalid syntax\")\n\n// Unquote interprets s as a single-quoted, double-quoted,\n// or backquoted Go string literal, returning the string value\n// that s quotes.  (If s is single-quoted, it would be a Go\n// character literal; Unquote returns the corresponding\n// one-character string.)\nfunc Unquote(s string) (t string, err error) {\n\tn := len(s)\n\tif n < 2 {\n\t\treturn \"\", ErrSyntax\n\t}\n\tquote := s[0]\n\tif quote != s[n-1] {\n\t\treturn \"\", ErrSyntax\n\t}\n\ts = s[1 : n-1]\n\n\tif quote != '\"' {\n\t\treturn \"\", ErrSyntax\n\t}\n\n\t// Is it trivial?  Avoid allocation.\n\tif !contains(s, '\\\\') && !contains(s, quote) && !contains(s, '$') {\n\t\tswitch quote {\n\t\tcase '\"':\n\t\t\treturn s, nil\n\t\tcase '\\'':\n\t\t\tr, size := utf8.DecodeRuneInString(s)\n\t\t\tif size == len(s) && (r != utf8.RuneError || size != 1) {\n\t\t\t\treturn s, nil\n\t\t\t}\n\t\t}\n\t}\n\n\tvar runeTmp [utf8.UTFMax]byte\n\tbuf := make([]byte, 0, 3*len(s)/2) // Try to avoid more allocations.\n\tfor len(s) > 0 {\n\t\t// If we're starting a '${}' then let it through un-unquoted.\n\t\t// Specifically: we don't unquote any characters within the `${}`\n\t\t// section, except for escaped backslashes, which we handle specifically.\n\t\tif s[0] == '$' && len(s) > 1 && s[1] == '{' {\n\t\t\tbuf = append(buf, '$', '{')\n\t\t\ts = s[2:]\n\n\t\t\t// Continue reading until we find the closing brace, copying as-is\n\t\t\tbraces := 1\n\t\t\tfor len(s) > 0 && braces > 0 {\n\t\t\t\tr, size := utf8.DecodeRuneInString(s)\n\t\t\t\tif r == utf8.RuneError {\n\t\t\t\t\treturn \"\", ErrSyntax\n\t\t\t\t}\n\n\t\t\t\ts = s[size:]\n\n\t\t\t\t// We special case escaped backslashes in interpolations, converting\n\t\t\t\t// them to their unescaped equivalents.\n\t\t\t\tif r == '\\\\' {\n\t\t\t\t\tq, _ := utf8.DecodeRuneInString(s)\n\t\t\t\t\tswitch q {\n\t\t\t\t\tcase '\\\\':\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tn := utf8.EncodeRune(runeTmp[:], r)\n\t\t\t\tbuf = append(buf, runeTmp[:n]...)\n\n\t\t\t\tswitch r {\n\t\t\t\tcase '{':\n\t\t\t\t\tbraces++\n\t\t\t\tcase '}':\n\t\t\t\t\tbraces--\n\t\t\t\t}\n\t\t\t}\n\t\t\tif braces != 0 {\n\t\t\t\treturn \"\", ErrSyntax\n\t\t\t}\n\t\t\tif len(s) == 0 {\n\t\t\t\t// If there's no string left, we're done!\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\t// If there's more left, we need to pop back up to the top of the loop\n\t\t\t\t// in case there's another interpolation in this string.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tc, multibyte, ss, err := unquoteChar(s, quote)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\ts = ss\n\t\tif c < utf8.RuneSelf || !multibyte {\n\t\t\tbuf = append(buf, byte(c))\n\t\t} else {\n\t\t\tn := utf8.EncodeRune(runeTmp[:], c)\n\t\t\tbuf = append(buf, runeTmp[:n]...)\n\t\t}\n\t\tif quote == '\\'' && len(s) != 0 {\n\t\t\t// single-quoted must be single character\n\t\t\treturn \"\", ErrSyntax\n\t\t}\n\t}\n\treturn string(buf), nil\n}\n\n// contains reports whether the string contains the byte c.\nfunc contains(s string, c byte) bool {\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == c {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc unhex(b byte) (v rune, ok bool) {\n\tc := rune(b)\n\tswitch {\n\tcase '0' <= c && c <= '9':\n\t\treturn c - '0', true\n\tcase 'a' <= c && c <= 'f':\n\t\treturn c - 'a' + 10, true\n\tcase 'A' <= c && c <= 'F':\n\t\treturn c - 'A' + 10, true\n\t}\n\treturn\n}\n\nfunc unquoteChar(s string, quote byte) (value rune, multibyte bool, tail string, err error) {\n\t// easy cases\n\tswitch c := s[0]; {\n\tcase c == quote && (quote == '\\'' || quote == '\"'):\n\t\terr = ErrSyntax\n\t\treturn\n\tcase c >= utf8.RuneSelf:\n\t\tr, size := utf8.DecodeRuneInString(s)\n\t\treturn r, true, s[size:], nil\n\tcase c != '\\\\':\n\t\treturn rune(s[0]), false, s[1:], nil\n\t}\n\n\t// hard case: c is backslash\n\tif len(s) <= 1 {\n\t\terr = ErrSyntax\n\t\treturn\n\t}\n\tc := s[1]\n\ts = s[2:]\n\n\tswitch c {\n\tcase 'a':\n\t\tvalue = '\\a'\n\tcase 'b':\n\t\tvalue = '\\b'\n\tcase 'f':\n\t\tvalue = '\\f'\n\tcase 'n':\n\t\tvalue = '\\n'\n\tcase 'r':\n\t\tvalue = '\\r'\n\tcase 't':\n\t\tvalue = '\\t'\n\tcase 'v':\n\t\tvalue = '\\v'\n\tcase 'x', 'u', 'U':\n\t\tn := 0\n\t\tswitch c {\n\t\tcase 'x':\n\t\t\tn = 2\n\t\tcase 'u':\n\t\t\tn = 4\n\t\tcase 'U':\n\t\t\tn = 8\n\t\t}\n\t\tvar v rune\n\t\tif len(s) < n {\n\t\t\terr = ErrSyntax\n\t\t\treturn\n\t\t}\n\t\tfor j := 0; j < n; j++ {\n\t\t\tx, ok := unhex(s[j])\n\t\t\tif !ok {\n\t\t\t\terr = ErrSyntax\n\t\t\t\treturn\n\t\t\t}\n\t\t\tv = v<<4 | x\n\t\t}\n\t\ts = s[n:]\n\t\tif c == 'x' {\n\t\t\t// single-byte string, possibly not UTF-8\n\t\t\tvalue = v\n\t\t\tbreak\n\t\t}\n\t\tif v > utf8.MaxRune {\n\t\t\terr = ErrSyntax\n\t\t\treturn\n\t\t}\n\t\tvalue = v\n\t\tmultibyte = true\n\tcase '0', '1', '2', '3', '4', '5', '6', '7':\n\t\tv := rune(c) - '0'\n\t\tif len(s) < 2 {\n\t\t\terr = ErrSyntax\n\t\t\treturn\n\t\t}\n\t\tfor j := 0; j < 2; j++ { // one digit already; two more\n\t\t\tx := rune(s[j]) - '0'\n\t\t\tif x < 0 || x > 7 {\n\t\t\t\terr = ErrSyntax\n\t\t\t\treturn\n\t\t\t}\n\t\t\tv = (v << 3) | x\n\t\t}\n\t\ts = s[2:]\n\t\tif v > 255 {\n\t\t\terr = ErrSyntax\n\t\t\treturn\n\t\t}\n\t\tvalue = v\n\tcase '\\\\':\n\t\tvalue = '\\\\'\n\tcase '\\'', '\"':\n\t\tif c != quote {\n\t\t\terr = ErrSyntax\n\t\t\treturn\n\t\t}\n\t\tvalue = rune(c)\n\tdefault:\n\t\terr = ErrSyntax\n\t\treturn\n\t}\n\ttail = s\n\treturn\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/hcl/token/position.go",
    "content": "package token\n\nimport \"fmt\"\n\n// Pos describes an arbitrary source position\n// including the file, line, and column location.\n// A Position is valid if the line number is > 0.\ntype Pos struct {\n\tFilename string // filename, if any\n\tOffset   int    // offset, starting at 0\n\tLine     int    // line number, starting at 1\n\tColumn   int    // column number, starting at 1 (character count)\n}\n\n// IsValid returns true if the position is valid.\nfunc (p *Pos) IsValid() bool { return p.Line > 0 }\n\n// String returns a string in one of several forms:\n//\n//\tfile:line:column    valid position with file name\n//\tline:column         valid position without file name\n//\tfile                invalid position with file name\n//\t-                   invalid position without file name\nfunc (p Pos) String() string {\n\ts := p.Filename\n\tif p.IsValid() {\n\t\tif s != \"\" {\n\t\t\ts += \":\"\n\t\t}\n\t\ts += fmt.Sprintf(\"%d:%d\", p.Line, p.Column)\n\t}\n\tif s == \"\" {\n\t\ts = \"-\"\n\t}\n\treturn s\n}\n\n// Before reports whether the position p is before u.\nfunc (p Pos) Before(u Pos) bool {\n\treturn u.Offset > p.Offset || u.Line > p.Line\n}\n\n// After reports whether the position p is after u.\nfunc (p Pos) After(u Pos) bool {\n\treturn u.Offset < p.Offset || u.Line < p.Line\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/hcl/token/token.go",
    "content": "// Package token defines constants representing the lexical tokens for HCL\n// (HashiCorp Configuration Language)\npackage token\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\thclstrconv \"github.com/hashicorp/hcl/hcl/strconv\"\n)\n\n// Token defines a single HCL token which can be obtained via the Scanner\ntype Token struct {\n\tType Type\n\tPos  Pos\n\tText string\n\tJSON bool\n}\n\n// Type is the set of lexical tokens of the HCL (HashiCorp Configuration Language)\ntype Type int\n\nconst (\n\t// Special tokens\n\tILLEGAL Type = iota\n\tEOF\n\tCOMMENT\n\n\tidentifier_beg\n\tIDENT // literals\n\tliteral_beg\n\tNUMBER  // 12345\n\tFLOAT   // 123.45\n\tBOOL    // true,false\n\tSTRING  // \"abc\"\n\tHEREDOC // <<FOO\\nbar\\nFOO\n\tliteral_end\n\tidentifier_end\n\n\toperator_beg\n\tLBRACK // [\n\tLBRACE // {\n\tCOMMA  // ,\n\tPERIOD // .\n\n\tRBRACK // ]\n\tRBRACE // }\n\n\tASSIGN // =\n\tADD    // +\n\tSUB    // -\n\toperator_end\n)\n\nvar tokens = [...]string{\n\tILLEGAL: \"ILLEGAL\",\n\n\tEOF:     \"EOF\",\n\tCOMMENT: \"COMMENT\",\n\n\tIDENT:  \"IDENT\",\n\tNUMBER: \"NUMBER\",\n\tFLOAT:  \"FLOAT\",\n\tBOOL:   \"BOOL\",\n\tSTRING: \"STRING\",\n\n\tLBRACK:  \"LBRACK\",\n\tLBRACE:  \"LBRACE\",\n\tCOMMA:   \"COMMA\",\n\tPERIOD:  \"PERIOD\",\n\tHEREDOC: \"HEREDOC\",\n\n\tRBRACK: \"RBRACK\",\n\tRBRACE: \"RBRACE\",\n\n\tASSIGN: \"ASSIGN\",\n\tADD:    \"ADD\",\n\tSUB:    \"SUB\",\n}\n\n// String returns the string corresponding to the token tok.\nfunc (t Type) String() string {\n\ts := \"\"\n\tif 0 <= t && t < Type(len(tokens)) {\n\t\ts = tokens[t]\n\t}\n\tif s == \"\" {\n\t\ts = \"token(\" + strconv.Itoa(int(t)) + \")\"\n\t}\n\treturn s\n}\n\n// IsIdentifier returns true for tokens corresponding to identifiers and basic\n// type literals; it returns false otherwise.\nfunc (t Type) IsIdentifier() bool { return identifier_beg < t && t < identifier_end }\n\n// IsLiteral returns true for tokens corresponding to basic type literals; it\n// returns false otherwise.\nfunc (t Type) IsLiteral() bool { return literal_beg < t && t < literal_end }\n\n// IsOperator returns true for tokens corresponding to operators and\n// delimiters; it returns false otherwise.\nfunc (t Type) IsOperator() bool { return operator_beg < t && t < operator_end }\n\n// String returns the token's literal text. Note that this is only\n// applicable for certain token types, such as token.IDENT,\n// token.STRING, etc..\nfunc (t Token) String() string {\n\treturn fmt.Sprintf(\"%s %s %s\", t.Pos.String(), t.Type.String(), t.Text)\n}\n\n// Value returns the properly typed value for this token. The type of\n// the returned interface{} is guaranteed based on the Type field.\n//\n// This can only be called for literal types. If it is called for any other\n// type, this will panic.\nfunc (t Token) Value() interface{} {\n\tswitch t.Type {\n\tcase BOOL:\n\t\tif t.Text == \"true\" {\n\t\t\treturn true\n\t\t} else if t.Text == \"false\" {\n\t\t\treturn false\n\t\t}\n\n\t\tpanic(\"unknown bool value: \" + t.Text)\n\tcase FLOAT:\n\t\tv, err := strconv.ParseFloat(t.Text, 64)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\treturn float64(v)\n\tcase NUMBER:\n\t\tv, err := strconv.ParseInt(t.Text, 0, 64)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\treturn int64(v)\n\tcase IDENT:\n\t\treturn t.Text\n\tcase HEREDOC:\n\t\treturn unindentHeredoc(t.Text)\n\tcase STRING:\n\t\t// Determine the Unquote method to use. If it came from JSON,\n\t\t// then we need to use the built-in unquote since we have to\n\t\t// escape interpolations there.\n\t\tf := hclstrconv.Unquote\n\t\tif t.JSON {\n\t\t\tf = strconv.Unquote\n\t\t}\n\n\t\t// This case occurs if json null is used\n\t\tif t.Text == \"\" {\n\t\t\treturn \"\"\n\t\t}\n\n\t\tv, err := f(t.Text)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"unquote %s err: %s\", t.Text, err))\n\t\t}\n\n\t\treturn v\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"unimplemented Value for type: %s\", t.Type))\n\t}\n}\n\n// unindentHeredoc returns the string content of a HEREDOC if it is started with <<\n// and the content of a HEREDOC with the hanging indent removed if it is started with\n// a <<-, and the terminating line is at least as indented as the least indented line.\nfunc unindentHeredoc(heredoc string) string {\n\t// We need to find the end of the marker\n\tidx := strings.IndexByte(heredoc, '\\n')\n\tif idx == -1 {\n\t\tpanic(\"heredoc doesn't contain newline\")\n\t}\n\n\tunindent := heredoc[2] == '-'\n\n\t// We can optimize if the heredoc isn't marked for indentation\n\tif !unindent {\n\t\treturn string(heredoc[idx+1 : len(heredoc)-idx+1])\n\t}\n\n\t// We need to unindent each line based on the indentation level of the marker\n\tlines := strings.Split(string(heredoc[idx+1:len(heredoc)-idx+2]), \"\\n\")\n\twhitespacePrefix := lines[len(lines)-1]\n\n\tisIndented := true\n\tfor _, v := range lines {\n\t\tif strings.HasPrefix(v, whitespacePrefix) {\n\t\t\tcontinue\n\t\t}\n\n\t\tisIndented = false\n\t\tbreak\n\t}\n\n\t// If all lines are not at least as indented as the terminating mark, return the\n\t// heredoc as is, but trim the leading space from the marker on the final line.\n\tif !isIndented {\n\t\treturn strings.TrimRight(string(heredoc[idx+1:len(heredoc)-idx+1]), \" \\t\")\n\t}\n\n\tunindentedLines := make([]string, len(lines))\n\tfor k, v := range lines {\n\t\tif k == len(lines)-1 {\n\t\t\tunindentedLines[k] = \"\"\n\t\t\tbreak\n\t\t}\n\n\t\tunindentedLines[k] = strings.TrimPrefix(v, whitespacePrefix)\n\t}\n\n\treturn strings.Join(unindentedLines, \"\\n\")\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/hcl.go",
    "content": "// Package hcl decodes HCL into usable Go structures.\n//\n// hcl input can come in either pure HCL format or JSON format.\n// It can be parsed into an AST, and then decoded into a structure,\n// or it can be decoded directly from a string into a structure.\n//\n// If you choose to parse HCL into a raw AST, the benefit is that you\n// can write custom visitor implementations to implement custom\n// semantic checks. By default, HCL does not perform any semantic\n// checks.\npackage hcl\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/json/parser/flatten.go",
    "content": "package parser\n\nimport \"github.com/hashicorp/hcl/hcl/ast\"\n\n// flattenObjects takes an AST node, walks it, and flattens\nfunc flattenObjects(node ast.Node) {\n\tast.Walk(node, func(n ast.Node) (ast.Node, bool) {\n\t\t// We only care about lists, because this is what we modify\n\t\tlist, ok := n.(*ast.ObjectList)\n\t\tif !ok {\n\t\t\treturn n, true\n\t\t}\n\n\t\t// Rebuild the item list\n\t\titems := make([]*ast.ObjectItem, 0, len(list.Items))\n\t\tfrontier := make([]*ast.ObjectItem, len(list.Items))\n\t\tcopy(frontier, list.Items)\n\t\tfor len(frontier) > 0 {\n\t\t\t// Pop the current item\n\t\t\tn := len(frontier)\n\t\t\titem := frontier[n-1]\n\t\t\tfrontier = frontier[:n-1]\n\n\t\t\tswitch v := item.Val.(type) {\n\t\t\tcase *ast.ObjectType:\n\t\t\t\titems, frontier = flattenObjectType(v, item, items, frontier)\n\t\t\tcase *ast.ListType:\n\t\t\t\titems, frontier = flattenListType(v, item, items, frontier)\n\t\t\tdefault:\n\t\t\t\titems = append(items, item)\n\t\t\t}\n\t\t}\n\n\t\t// Reverse the list since the frontier model runs things backwards\n\t\tfor i := len(items)/2 - 1; i >= 0; i-- {\n\t\t\topp := len(items) - 1 - i\n\t\t\titems[i], items[opp] = items[opp], items[i]\n\t\t}\n\n\t\t// Done! Set the original items\n\t\tlist.Items = items\n\t\treturn n, true\n\t})\n}\n\nfunc flattenListType(\n\tot *ast.ListType,\n\titem *ast.ObjectItem,\n\titems []*ast.ObjectItem,\n\tfrontier []*ast.ObjectItem) ([]*ast.ObjectItem, []*ast.ObjectItem) {\n\t// All the elements of this object must also be objects!\n\tfor _, subitem := range ot.List {\n\t\tif _, ok := subitem.(*ast.ObjectType); !ok {\n\t\t\titems = append(items, item)\n\t\t\treturn items, frontier\n\t\t}\n\t}\n\n\t// Great! We have a match go through all the items and flatten\n\tfor _, elem := range ot.List {\n\t\t// Add it to the frontier so that we can recurse\n\t\tfrontier = append(frontier, &ast.ObjectItem{\n\t\t\tKeys:        item.Keys,\n\t\t\tAssign:      item.Assign,\n\t\t\tVal:         elem,\n\t\t\tLeadComment: item.LeadComment,\n\t\t\tLineComment: item.LineComment,\n\t\t})\n\t}\n\n\treturn items, frontier\n}\n\nfunc flattenObjectType(\n\tot *ast.ObjectType,\n\titem *ast.ObjectItem,\n\titems []*ast.ObjectItem,\n\tfrontier []*ast.ObjectItem) ([]*ast.ObjectItem, []*ast.ObjectItem) {\n\t// If the list has no items we do not have to flatten anything\n\tif ot.List.Items == nil {\n\t\titems = append(items, item)\n\t\treturn items, frontier\n\t}\n\n\t// All the elements of this object must also be objects!\n\tfor _, subitem := range ot.List.Items {\n\t\tif _, ok := subitem.Val.(*ast.ObjectType); !ok {\n\t\t\titems = append(items, item)\n\t\t\treturn items, frontier\n\t\t}\n\t}\n\n\t// Great! We have a match go through all the items and flatten\n\tfor _, subitem := range ot.List.Items {\n\t\t// Copy the new key\n\t\tkeys := make([]*ast.ObjectKey, len(item.Keys)+len(subitem.Keys))\n\t\tcopy(keys, item.Keys)\n\t\tcopy(keys[len(item.Keys):], subitem.Keys)\n\n\t\t// Add it to the frontier so that we can recurse\n\t\tfrontier = append(frontier, &ast.ObjectItem{\n\t\t\tKeys:        keys,\n\t\t\tAssign:      item.Assign,\n\t\t\tVal:         subitem.Val,\n\t\t\tLeadComment: item.LeadComment,\n\t\t\tLineComment: item.LineComment,\n\t\t})\n\t}\n\n\treturn items, frontier\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/json/parser/parser.go",
    "content": "package parser\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/hashicorp/hcl/hcl/ast\"\n\t\"github.com/hashicorp/hcl/json/scanner\"\n\t\"github.com/hashicorp/hcl/json/token\"\n)\n\ntype Parser struct {\n\tsc *scanner.Scanner\n\n\t// Last read token\n\ttok       token.Token\n\tcommaPrev token.Token\n\n\tenableTrace bool\n\tindent      int\n\tn           int // buffer size (max = 1)\n}\n\nfunc newParser(src []byte) *Parser {\n\treturn &Parser{\n\t\tsc: scanner.New(src),\n\t}\n}\n\n// Parse returns the fully parsed source and returns the abstract syntax tree.\nfunc Parse(src []byte) (*ast.File, error) {\n\tp := newParser(src)\n\treturn p.Parse()\n}\n\nvar errEofToken = errors.New(\"EOF token found\")\n\n// Parse returns the fully parsed source and returns the abstract syntax tree.\nfunc (p *Parser) Parse() (*ast.File, error) {\n\tf := &ast.File{}\n\tvar err, scerr error\n\tp.sc.Error = func(pos token.Pos, msg string) {\n\t\tscerr = fmt.Errorf(\"%s: %s\", pos, msg)\n\t}\n\n\t// The root must be an object in JSON\n\tobject, err := p.object()\n\tif scerr != nil {\n\t\treturn nil, scerr\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// We make our final node an object list so it is more HCL compatible\n\tf.Node = object.List\n\n\t// Flatten it, which finds patterns and turns them into more HCL-like\n\t// AST trees.\n\tflattenObjects(f.Node)\n\n\treturn f, nil\n}\n\nfunc (p *Parser) objectList() (*ast.ObjectList, error) {\n\tdefer un(trace(p, \"ParseObjectList\"))\n\tnode := &ast.ObjectList{}\n\n\tfor {\n\t\tn, err := p.objectItem()\n\t\tif err == errEofToken {\n\t\t\tbreak // we are finished\n\t\t}\n\n\t\t// we don't return a nil node, because might want to use already\n\t\t// collected items.\n\t\tif err != nil {\n\t\t\treturn node, err\n\t\t}\n\n\t\tnode.Add(n)\n\n\t\t// Check for a followup comma. If it isn't a comma, then we're done\n\t\tif tok := p.scan(); tok.Type != token.COMMA {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn node, nil\n}\n\n// objectItem parses a single object item\nfunc (p *Parser) objectItem() (*ast.ObjectItem, error) {\n\tdefer un(trace(p, \"ParseObjectItem\"))\n\n\tkeys, err := p.objectKey()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\to := &ast.ObjectItem{\n\t\tKeys: keys,\n\t}\n\n\tswitch p.tok.Type {\n\tcase token.COLON:\n\t\to.Val, err = p.objectValue()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn o, nil\n}\n\n// objectKey parses an object key and returns a ObjectKey AST\nfunc (p *Parser) objectKey() ([]*ast.ObjectKey, error) {\n\tkeyCount := 0\n\tkeys := make([]*ast.ObjectKey, 0)\n\n\tfor {\n\t\ttok := p.scan()\n\t\tswitch tok.Type {\n\t\tcase token.EOF:\n\t\t\treturn nil, errEofToken\n\t\tcase token.STRING:\n\t\t\tkeyCount++\n\t\t\tkeys = append(keys, &ast.ObjectKey{\n\t\t\t\tToken: p.tok.HCLToken(),\n\t\t\t})\n\t\tcase token.COLON:\n\t\t\t// If we have a zero keycount it means that we never got\n\t\t\t// an object key, i.e. `{ :`. This is a syntax error.\n\t\t\tif keyCount == 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"expected: STRING got: %s\", p.tok.Type)\n\t\t\t}\n\n\t\t\t// Done\n\t\t\treturn keys, nil\n\t\tcase token.ILLEGAL:\n\t\t\tfmt.Println(\"illegal\")\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"expected: STRING got: %s\", p.tok.Type)\n\t\t}\n\t}\n}\n\n// object parses any type of object, such as number, bool, string, object or\n// list.\nfunc (p *Parser) objectValue() (ast.Node, error) {\n\tdefer un(trace(p, \"ParseObjectValue\"))\n\ttok := p.scan()\n\n\tswitch tok.Type {\n\tcase token.NUMBER, token.FLOAT, token.BOOL, token.NULL, token.STRING:\n\t\treturn p.literalType()\n\tcase token.LBRACE:\n\t\treturn p.objectType()\n\tcase token.LBRACK:\n\t\treturn p.listType()\n\tcase token.EOF:\n\t\treturn nil, errEofToken\n\t}\n\n\treturn nil, fmt.Errorf(\"Expected object value, got unknown token: %+v\", tok)\n}\n\n// object parses any type of object, such as number, bool, string, object or\n// list.\nfunc (p *Parser) object() (*ast.ObjectType, error) {\n\tdefer un(trace(p, \"ParseType\"))\n\ttok := p.scan()\n\n\tswitch tok.Type {\n\tcase token.LBRACE:\n\t\treturn p.objectType()\n\tcase token.EOF:\n\t\treturn nil, errEofToken\n\t}\n\n\treturn nil, fmt.Errorf(\"Expected object, got unknown token: %+v\", tok)\n}\n\n// objectType parses an object type and returns a ObjectType AST\nfunc (p *Parser) objectType() (*ast.ObjectType, error) {\n\tdefer un(trace(p, \"ParseObjectType\"))\n\n\t// we assume that the currently scanned token is a LBRACE\n\to := &ast.ObjectType{}\n\n\tl, err := p.objectList()\n\n\t// if we hit RBRACE, we are good to go (means we parsed all Items), if it's\n\t// not a RBRACE, it's an syntax error and we just return it.\n\tif err != nil && p.tok.Type != token.RBRACE {\n\t\treturn nil, err\n\t}\n\n\to.List = l\n\treturn o, nil\n}\n\n// listType parses a list type and returns a ListType AST\nfunc (p *Parser) listType() (*ast.ListType, error) {\n\tdefer un(trace(p, \"ParseListType\"))\n\n\t// we assume that the currently scanned token is a LBRACK\n\tl := &ast.ListType{}\n\n\tfor {\n\t\ttok := p.scan()\n\t\tswitch tok.Type {\n\t\tcase token.NUMBER, token.FLOAT, token.STRING:\n\t\t\tnode, err := p.literalType()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tl.Add(node)\n\t\tcase token.COMMA:\n\t\t\tcontinue\n\t\tcase token.LBRACE:\n\t\t\tnode, err := p.objectType()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tl.Add(node)\n\t\tcase token.BOOL:\n\t\t\t// TODO(arslan) should we support? not supported by HCL yet\n\t\tcase token.LBRACK:\n\t\t\t// TODO(arslan) should we support nested lists? Even though it's\n\t\t\t// written in README of HCL, it's not a part of the grammar\n\t\t\t// (not defined in parse.y)\n\t\tcase token.RBRACK:\n\t\t\t// finished\n\t\t\treturn l, nil\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unexpected token while parsing list: %s\", tok.Type)\n\t\t}\n\n\t}\n}\n\n// literalType parses a literal type and returns a LiteralType AST\nfunc (p *Parser) literalType() (*ast.LiteralType, error) {\n\tdefer un(trace(p, \"ParseLiteral\"))\n\n\treturn &ast.LiteralType{\n\t\tToken: p.tok.HCLToken(),\n\t}, nil\n}\n\n// scan returns the next token from the underlying scanner. If a token has\n// been unscanned then read that instead.\nfunc (p *Parser) scan() token.Token {\n\t// If we have a token on the buffer, then return it.\n\tif p.n != 0 {\n\t\tp.n = 0\n\t\treturn p.tok\n\t}\n\n\tp.tok = p.sc.Scan()\n\treturn p.tok\n}\n\n// unscan pushes the previously read token back onto the buffer.\nfunc (p *Parser) unscan() {\n\tp.n = 1\n}\n\n// ----------------------------------------------------------------------------\n// Parsing support\n\nfunc (p *Parser) printTrace(a ...interface{}) {\n\tif !p.enableTrace {\n\t\treturn\n\t}\n\n\tconst dots = \". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \"\n\tconst n = len(dots)\n\tfmt.Printf(\"%5d:%3d: \", p.tok.Pos.Line, p.tok.Pos.Column)\n\n\ti := 2 * p.indent\n\tfor i > n {\n\t\tfmt.Print(dots)\n\t\ti -= n\n\t}\n\t// i <= n\n\tfmt.Print(dots[0:i])\n\tfmt.Println(a...)\n}\n\nfunc trace(p *Parser, msg string) *Parser {\n\tp.printTrace(msg, \"(\")\n\tp.indent++\n\treturn p\n}\n\n// Usage pattern: defer un(trace(p, \"...\"))\nfunc un(p *Parser) {\n\tp.indent--\n\tp.printTrace(\")\")\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/json/scanner/scanner.go",
    "content": "package scanner\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n\n\t\"github.com/hashicorp/hcl/json/token\"\n)\n\n// eof represents a marker rune for the end of the reader.\nconst eof = rune(0)\n\n// Scanner defines a lexical scanner\ntype Scanner struct {\n\tbuf *bytes.Buffer // Source buffer for advancing and scanning\n\tsrc []byte        // Source buffer for immutable access\n\n\t// Source Position\n\tsrcPos  token.Pos // current position\n\tprevPos token.Pos // previous position, used for peek() method\n\n\tlastCharLen int // length of last character in bytes\n\tlastLineLen int // length of last line in characters (for correct column reporting)\n\n\ttokStart int // token text start position\n\ttokEnd   int // token text end  position\n\n\t// Error is called for each error encountered. If no Error\n\t// function is set, the error is reported to os.Stderr.\n\tError func(pos token.Pos, msg string)\n\n\t// ErrorCount is incremented by one for each error encountered.\n\tErrorCount int\n\n\t// tokPos is the start position of most recently scanned token; set by\n\t// Scan. The Filename field is always left untouched by the Scanner.  If\n\t// an error is reported (via Error) and Position is invalid, the scanner is\n\t// not inside a token.\n\ttokPos token.Pos\n}\n\n// New creates and initializes a new instance of Scanner using src as\n// its source content.\nfunc New(src []byte) *Scanner {\n\t// even though we accept a src, we read from a io.Reader compatible type\n\t// (*bytes.Buffer). So in the future we might easily change it to streaming\n\t// read.\n\tb := bytes.NewBuffer(src)\n\ts := &Scanner{\n\t\tbuf: b,\n\t\tsrc: src,\n\t}\n\n\t// srcPosition always starts with 1\n\ts.srcPos.Line = 1\n\treturn s\n}\n\n// next reads the next rune from the bufferred reader. Returns the rune(0) if\n// an error occurs (or io.EOF is returned).\nfunc (s *Scanner) next() rune {\n\tch, size, err := s.buf.ReadRune()\n\tif err != nil {\n\t\t// advance for error reporting\n\t\ts.srcPos.Column++\n\t\ts.srcPos.Offset += size\n\t\ts.lastCharLen = size\n\t\treturn eof\n\t}\n\n\tif ch == utf8.RuneError && size == 1 {\n\t\ts.srcPos.Column++\n\t\ts.srcPos.Offset += size\n\t\ts.lastCharLen = size\n\t\ts.err(\"illegal UTF-8 encoding\")\n\t\treturn ch\n\t}\n\n\t// remember last position\n\ts.prevPos = s.srcPos\n\n\ts.srcPos.Column++\n\ts.lastCharLen = size\n\ts.srcPos.Offset += size\n\n\tif ch == '\\n' {\n\t\ts.srcPos.Line++\n\t\ts.lastLineLen = s.srcPos.Column\n\t\ts.srcPos.Column = 0\n\t}\n\n\t// debug\n\t// fmt.Printf(\"ch: %q, offset:column: %d:%d\\n\", ch, s.srcPos.Offset, s.srcPos.Column)\n\treturn ch\n}\n\n// unread unreads the previous read Rune and updates the source position\nfunc (s *Scanner) unread() {\n\tif err := s.buf.UnreadRune(); err != nil {\n\t\tpanic(err) // this is user fault, we should catch it\n\t}\n\ts.srcPos = s.prevPos // put back last position\n}\n\n// peek returns the next rune without advancing the reader.\nfunc (s *Scanner) peek() rune {\n\tpeek, _, err := s.buf.ReadRune()\n\tif err != nil {\n\t\treturn eof\n\t}\n\n\ts.buf.UnreadRune()\n\treturn peek\n}\n\n// Scan scans the next token and returns the token.\nfunc (s *Scanner) Scan() token.Token {\n\tch := s.next()\n\n\t// skip white space\n\tfor isWhitespace(ch) {\n\t\tch = s.next()\n\t}\n\n\tvar tok token.Type\n\n\t// token text markings\n\ts.tokStart = s.srcPos.Offset - s.lastCharLen\n\n\t// token position, initial next() is moving the offset by one(size of rune\n\t// actually), though we are interested with the starting point\n\ts.tokPos.Offset = s.srcPos.Offset - s.lastCharLen\n\tif s.srcPos.Column > 0 {\n\t\t// common case: last character was not a '\\n'\n\t\ts.tokPos.Line = s.srcPos.Line\n\t\ts.tokPos.Column = s.srcPos.Column\n\t} else {\n\t\t// last character was a '\\n'\n\t\t// (we cannot be at the beginning of the source\n\t\t// since we have called next() at least once)\n\t\ts.tokPos.Line = s.srcPos.Line - 1\n\t\ts.tokPos.Column = s.lastLineLen\n\t}\n\n\tswitch {\n\tcase isLetter(ch):\n\t\tlit := s.scanIdentifier()\n\t\tif lit == \"true\" || lit == \"false\" {\n\t\t\ttok = token.BOOL\n\t\t} else if lit == \"null\" {\n\t\t\ttok = token.NULL\n\t\t} else {\n\t\t\ts.err(\"illegal char\")\n\t\t}\n\tcase isDecimal(ch):\n\t\ttok = s.scanNumber(ch)\n\tdefault:\n\t\tswitch ch {\n\t\tcase eof:\n\t\t\ttok = token.EOF\n\t\tcase '\"':\n\t\t\ttok = token.STRING\n\t\t\ts.scanString()\n\t\tcase '.':\n\t\t\ttok = token.PERIOD\n\t\t\tch = s.peek()\n\t\t\tif isDecimal(ch) {\n\t\t\t\ttok = token.FLOAT\n\t\t\t\tch = s.scanMantissa(ch)\n\t\t\t\tch = s.scanExponent(ch)\n\t\t\t}\n\t\tcase '[':\n\t\t\ttok = token.LBRACK\n\t\tcase ']':\n\t\t\ttok = token.RBRACK\n\t\tcase '{':\n\t\t\ttok = token.LBRACE\n\t\tcase '}':\n\t\t\ttok = token.RBRACE\n\t\tcase ',':\n\t\t\ttok = token.COMMA\n\t\tcase ':':\n\t\t\ttok = token.COLON\n\t\tcase '-':\n\t\t\tif isDecimal(s.peek()) {\n\t\t\t\tch := s.next()\n\t\t\t\ttok = s.scanNumber(ch)\n\t\t\t} else {\n\t\t\t\ts.err(\"illegal char\")\n\t\t\t}\n\t\tdefault:\n\t\t\ts.err(\"illegal char: \" + string(ch))\n\t\t}\n\t}\n\n\t// finish token ending\n\ts.tokEnd = s.srcPos.Offset\n\n\t// create token literal\n\tvar tokenText string\n\tif s.tokStart >= 0 {\n\t\ttokenText = string(s.src[s.tokStart:s.tokEnd])\n\t}\n\ts.tokStart = s.tokEnd // ensure idempotency of tokenText() call\n\n\treturn token.Token{\n\t\tType: tok,\n\t\tPos:  s.tokPos,\n\t\tText: tokenText,\n\t}\n}\n\n// scanNumber scans a HCL number definition starting with the given rune\nfunc (s *Scanner) scanNumber(ch rune) token.Type {\n\tzero := ch == '0'\n\tpos := s.srcPos\n\n\ts.scanMantissa(ch)\n\tch = s.next() // seek forward\n\tif ch == 'e' || ch == 'E' {\n\t\tch = s.scanExponent(ch)\n\t\treturn token.FLOAT\n\t}\n\n\tif ch == '.' {\n\t\tch = s.scanFraction(ch)\n\t\tif ch == 'e' || ch == 'E' {\n\t\t\tch = s.next()\n\t\t\tch = s.scanExponent(ch)\n\t\t}\n\t\treturn token.FLOAT\n\t}\n\n\tif ch != eof {\n\t\ts.unread()\n\t}\n\n\t// If we have a larger number and this is zero, error\n\tif zero && pos != s.srcPos {\n\t\ts.err(\"numbers cannot start with 0\")\n\t}\n\n\treturn token.NUMBER\n}\n\n// scanMantissa scans the mantissa begining from the rune. It returns the next\n// non decimal rune. It's used to determine wheter it's a fraction or exponent.\nfunc (s *Scanner) scanMantissa(ch rune) rune {\n\tscanned := false\n\tfor isDecimal(ch) {\n\t\tch = s.next()\n\t\tscanned = true\n\t}\n\n\tif scanned && ch != eof {\n\t\ts.unread()\n\t}\n\treturn ch\n}\n\n// scanFraction scans the fraction after the '.' rune\nfunc (s *Scanner) scanFraction(ch rune) rune {\n\tif ch == '.' {\n\t\tch = s.peek() // we peek just to see if we can move forward\n\t\tch = s.scanMantissa(ch)\n\t}\n\treturn ch\n}\n\n// scanExponent scans the remaining parts of an exponent after the 'e' or 'E'\n// rune.\nfunc (s *Scanner) scanExponent(ch rune) rune {\n\tif ch == 'e' || ch == 'E' {\n\t\tch = s.next()\n\t\tif ch == '-' || ch == '+' {\n\t\t\tch = s.next()\n\t\t}\n\t\tch = s.scanMantissa(ch)\n\t}\n\treturn ch\n}\n\n// scanString scans a quoted string\nfunc (s *Scanner) scanString() {\n\tbraces := 0\n\tfor {\n\t\t// '\"' opening already consumed\n\t\t// read character after quote\n\t\tch := s.next()\n\n\t\tif ch == '\\n' || ch < 0 || ch == eof {\n\t\t\ts.err(\"literal not terminated\")\n\t\t\treturn\n\t\t}\n\n\t\tif ch == '\"' {\n\t\t\tbreak\n\t\t}\n\n\t\t// If we're going into a ${} then we can ignore quotes for awhile\n\t\tif braces == 0 && ch == '$' && s.peek() == '{' {\n\t\t\tbraces++\n\t\t\ts.next()\n\t\t} else if braces > 0 && ch == '{' {\n\t\t\tbraces++\n\t\t}\n\t\tif braces > 0 && ch == '}' {\n\t\t\tbraces--\n\t\t}\n\n\t\tif ch == '\\\\' {\n\t\t\ts.scanEscape()\n\t\t}\n\t}\n\n\treturn\n}\n\n// scanEscape scans an escape sequence\nfunc (s *Scanner) scanEscape() rune {\n\t// http://en.cppreference.com/w/cpp/language/escape\n\tch := s.next() // read character after '/'\n\tswitch ch {\n\tcase 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\\\', '\"':\n\t\t// nothing to do\n\tcase '0', '1', '2', '3', '4', '5', '6', '7':\n\t\t// octal notation\n\t\tch = s.scanDigits(ch, 8, 3)\n\tcase 'x':\n\t\t// hexademical notation\n\t\tch = s.scanDigits(s.next(), 16, 2)\n\tcase 'u':\n\t\t// universal character name\n\t\tch = s.scanDigits(s.next(), 16, 4)\n\tcase 'U':\n\t\t// universal character name\n\t\tch = s.scanDigits(s.next(), 16, 8)\n\tdefault:\n\t\ts.err(\"illegal char escape\")\n\t}\n\treturn ch\n}\n\n// scanDigits scans a rune with the given base for n times. For example an\n// octal notation \\184 would yield in scanDigits(ch, 8, 3)\nfunc (s *Scanner) scanDigits(ch rune, base, n int) rune {\n\tfor n > 0 && digitVal(ch) < base {\n\t\tch = s.next()\n\t\tn--\n\t}\n\tif n > 0 {\n\t\ts.err(\"illegal char escape\")\n\t}\n\n\t// we scanned all digits, put the last non digit char back\n\ts.unread()\n\treturn ch\n}\n\n// scanIdentifier scans an identifier and returns the literal string\nfunc (s *Scanner) scanIdentifier() string {\n\toffs := s.srcPos.Offset - s.lastCharLen\n\tch := s.next()\n\tfor isLetter(ch) || isDigit(ch) || ch == '-' {\n\t\tch = s.next()\n\t}\n\n\tif ch != eof {\n\t\ts.unread() // we got identifier, put back latest char\n\t}\n\n\treturn string(s.src[offs:s.srcPos.Offset])\n}\n\n// recentPosition returns the position of the character immediately after the\n// character or token returned by the last call to Scan.\nfunc (s *Scanner) recentPosition() (pos token.Pos) {\n\tpos.Offset = s.srcPos.Offset - s.lastCharLen\n\tswitch {\n\tcase s.srcPos.Column > 0:\n\t\t// common case: last character was not a '\\n'\n\t\tpos.Line = s.srcPos.Line\n\t\tpos.Column = s.srcPos.Column\n\tcase s.lastLineLen > 0:\n\t\t// last character was a '\\n'\n\t\t// (we cannot be at the beginning of the source\n\t\t// since we have called next() at least once)\n\t\tpos.Line = s.srcPos.Line - 1\n\t\tpos.Column = s.lastLineLen\n\tdefault:\n\t\t// at the beginning of the source\n\t\tpos.Line = 1\n\t\tpos.Column = 1\n\t}\n\treturn\n}\n\n// err prints the error of any scanning to s.Error function. If the function is\n// not defined, by default it prints them to os.Stderr\nfunc (s *Scanner) err(msg string) {\n\ts.ErrorCount++\n\tpos := s.recentPosition()\n\n\tif s.Error != nil {\n\t\ts.Error(pos, msg)\n\t\treturn\n\t}\n\n\tfmt.Fprintf(os.Stderr, \"%s: %s\\n\", pos, msg)\n}\n\n// isHexadecimal returns true if the given rune is a letter\nfunc isLetter(ch rune) bool {\n\treturn 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= 0x80 && unicode.IsLetter(ch)\n}\n\n// isHexadecimal returns true if the given rune is a decimal digit\nfunc isDigit(ch rune) bool {\n\treturn '0' <= ch && ch <= '9' || ch >= 0x80 && unicode.IsDigit(ch)\n}\n\n// isHexadecimal returns true if the given rune is a decimal number\nfunc isDecimal(ch rune) bool {\n\treturn '0' <= ch && ch <= '9'\n}\n\n// isHexadecimal returns true if the given rune is an hexadecimal number\nfunc isHexadecimal(ch rune) bool {\n\treturn '0' <= ch && ch <= '9' || 'a' <= ch && ch <= 'f' || 'A' <= ch && ch <= 'F'\n}\n\n// isWhitespace returns true if the rune is a space, tab, newline or carriage return\nfunc isWhitespace(ch rune) bool {\n\treturn ch == ' ' || ch == '\\t' || ch == '\\n' || ch == '\\r'\n}\n\n// digitVal returns the integer value of a given octal,decimal or hexadecimal rune\nfunc digitVal(ch rune) int {\n\tswitch {\n\tcase '0' <= ch && ch <= '9':\n\t\treturn int(ch - '0')\n\tcase 'a' <= ch && ch <= 'f':\n\t\treturn int(ch - 'a' + 10)\n\tcase 'A' <= ch && ch <= 'F':\n\t\treturn int(ch - 'A' + 10)\n\t}\n\treturn 16 // larger than any legal digit val\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/json/token/position.go",
    "content": "package token\n\nimport \"fmt\"\n\n// Pos describes an arbitrary source position\n// including the file, line, and column location.\n// A Position is valid if the line number is > 0.\ntype Pos struct {\n\tFilename string // filename, if any\n\tOffset   int    // offset, starting at 0\n\tLine     int    // line number, starting at 1\n\tColumn   int    // column number, starting at 1 (character count)\n}\n\n// IsValid returns true if the position is valid.\nfunc (p *Pos) IsValid() bool { return p.Line > 0 }\n\n// String returns a string in one of several forms:\n//\n//\tfile:line:column    valid position with file name\n//\tline:column         valid position without file name\n//\tfile                invalid position with file name\n//\t-                   invalid position without file name\nfunc (p Pos) String() string {\n\ts := p.Filename\n\tif p.IsValid() {\n\t\tif s != \"\" {\n\t\t\ts += \":\"\n\t\t}\n\t\ts += fmt.Sprintf(\"%d:%d\", p.Line, p.Column)\n\t}\n\tif s == \"\" {\n\t\ts = \"-\"\n\t}\n\treturn s\n}\n\n// Before reports whether the position p is before u.\nfunc (p Pos) Before(u Pos) bool {\n\treturn u.Offset > p.Offset || u.Line > p.Line\n}\n\n// After reports whether the position p is after u.\nfunc (p Pos) After(u Pos) bool {\n\treturn u.Offset < p.Offset || u.Line < p.Line\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/json/token/token.go",
    "content": "package token\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\n\thcltoken \"github.com/hashicorp/hcl/hcl/token\"\n)\n\n// Token defines a single HCL token which can be obtained via the Scanner\ntype Token struct {\n\tType Type\n\tPos  Pos\n\tText string\n}\n\n// Type is the set of lexical tokens of the HCL (HashiCorp Configuration Language)\ntype Type int\n\nconst (\n\t// Special tokens\n\tILLEGAL Type = iota\n\tEOF\n\n\tidentifier_beg\n\tliteral_beg\n\tNUMBER // 12345\n\tFLOAT  // 123.45\n\tBOOL   // true,false\n\tSTRING // \"abc\"\n\tNULL   // null\n\tliteral_end\n\tidentifier_end\n\n\toperator_beg\n\tLBRACK // [\n\tLBRACE // {\n\tCOMMA  // ,\n\tPERIOD // .\n\tCOLON  // :\n\n\tRBRACK // ]\n\tRBRACE // }\n\n\toperator_end\n)\n\nvar tokens = [...]string{\n\tILLEGAL: \"ILLEGAL\",\n\n\tEOF: \"EOF\",\n\n\tNUMBER: \"NUMBER\",\n\tFLOAT:  \"FLOAT\",\n\tBOOL:   \"BOOL\",\n\tSTRING: \"STRING\",\n\tNULL:   \"NULL\",\n\n\tLBRACK: \"LBRACK\",\n\tLBRACE: \"LBRACE\",\n\tCOMMA:  \"COMMA\",\n\tPERIOD: \"PERIOD\",\n\tCOLON:  \"COLON\",\n\n\tRBRACK: \"RBRACK\",\n\tRBRACE: \"RBRACE\",\n}\n\n// String returns the string corresponding to the token tok.\nfunc (t Type) String() string {\n\ts := \"\"\n\tif 0 <= t && t < Type(len(tokens)) {\n\t\ts = tokens[t]\n\t}\n\tif s == \"\" {\n\t\ts = \"token(\" + strconv.Itoa(int(t)) + \")\"\n\t}\n\treturn s\n}\n\n// IsIdentifier returns true for tokens corresponding to identifiers and basic\n// type literals; it returns false otherwise.\nfunc (t Type) IsIdentifier() bool { return identifier_beg < t && t < identifier_end }\n\n// IsLiteral returns true for tokens corresponding to basic type literals; it\n// returns false otherwise.\nfunc (t Type) IsLiteral() bool { return literal_beg < t && t < literal_end }\n\n// IsOperator returns true for tokens corresponding to operators and\n// delimiters; it returns false otherwise.\nfunc (t Type) IsOperator() bool { return operator_beg < t && t < operator_end }\n\n// String returns the token's literal text. Note that this is only\n// applicable for certain token types, such as token.IDENT,\n// token.STRING, etc..\nfunc (t Token) String() string {\n\treturn fmt.Sprintf(\"%s %s %s\", t.Pos.String(), t.Type.String(), t.Text)\n}\n\n// HCLToken converts this token to an HCL token.\n//\n// The token type must be a literal type or this will panic.\nfunc (t Token) HCLToken() hcltoken.Token {\n\tswitch t.Type {\n\tcase BOOL:\n\t\treturn hcltoken.Token{Type: hcltoken.BOOL, Text: t.Text}\n\tcase FLOAT:\n\t\treturn hcltoken.Token{Type: hcltoken.FLOAT, Text: t.Text}\n\tcase NULL:\n\t\treturn hcltoken.Token{Type: hcltoken.STRING, Text: \"\"}\n\tcase NUMBER:\n\t\treturn hcltoken.Token{Type: hcltoken.NUMBER, Text: t.Text}\n\tcase STRING:\n\t\treturn hcltoken.Token{Type: hcltoken.STRING, Text: t.Text, JSON: true}\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"unimplemented HCLToken for type: %s\", t.Type))\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/lex.go",
    "content": "package hcl\n\nimport (\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\ntype lexModeValue byte\n\nconst (\n\tlexModeUnknown lexModeValue = iota\n\tlexModeHcl\n\tlexModeJson\n)\n\n// lexMode returns whether we're going to be parsing in JSON\n// mode or HCL mode.\nfunc lexMode(v []byte) lexModeValue {\n\tvar (\n\t\tr      rune\n\t\tw      int\n\t\toffset int\n\t)\n\n\tfor {\n\t\tr, w = utf8.DecodeRune(v[offset:])\n\t\toffset += w\n\t\tif unicode.IsSpace(r) {\n\t\t\tcontinue\n\t\t}\n\t\tif r == '{' {\n\t\t\treturn lexModeJson\n\t\t}\n\t\tbreak\n\t}\n\n\treturn lexModeHcl\n}\n"
  },
  {
    "path": "vendor/github.com/hashicorp/hcl/parse.go",
    "content": "package hcl\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/hashicorp/hcl/hcl/ast\"\n\thclParser \"github.com/hashicorp/hcl/hcl/parser\"\n\tjsonParser \"github.com/hashicorp/hcl/json/parser\"\n)\n\n// ParseBytes accepts as input byte slice and returns ast tree.\n//\n// Input can be either JSON or HCL\nfunc ParseBytes(in []byte) (*ast.File, error) {\n\treturn parse(in)\n}\n\n// ParseString accepts input as a string and returns ast tree.\nfunc ParseString(input string) (*ast.File, error) {\n\treturn parse([]byte(input))\n}\n\nfunc parse(in []byte) (*ast.File, error) {\n\tswitch lexMode(in) {\n\tcase lexModeHcl:\n\t\treturn hclParser.Parse(in)\n\tcase lexModeJson:\n\t\treturn jsonParser.Parse(in)\n\t}\n\n\treturn nil, fmt.Errorf(\"unknown config format\")\n}\n\n// Parse parses the given input and returns the root object.\n//\n// The input format can be either HCL or JSON.\nfunc Parse(input string) (*ast.File, error) {\n\treturn parse([]byte(input))\n}\n"
  },
  {
    "path": "vendor/github.com/jmespath/go-jmespath/LICENSE",
    "content": "Copyright 2015 James Saryerwinnie\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": "vendor/github.com/jmespath/go-jmespath/Makefile",
    "content": "\nCMD = jpgo\n\nhelp:\n\t@echo \"Please use \\`make <target>' where <target> is one of\"\n\t@echo \"  test                    to run all the tests\"\n\t@echo \"  build                   to build the library and jp executable\"\n\t@echo \"  generate                to run codegen\"\n\n\ngenerate:\n\tgo generate ./...\n\nbuild:\n\trm -f $(CMD)\n\tgo build ./...\n\trm -f cmd/$(CMD)/$(CMD) && cd cmd/$(CMD)/ && go build ./...\n\tmv cmd/$(CMD)/$(CMD) .\n\ntest:\n\tgo test -v ./...\n\ncheck:\n\tgo vet ./...\n\t@echo \"golint ./...\"\n\t@lint=`golint ./...`; \\\n\tlint=`echo \"$$lint\" | grep -v \"astnodetype_string.go\" | grep -v \"toktype_string.go\"`; \\\n\techo \"$$lint\"; \\\n\tif [ \"$$lint\" != \"\" ]; then exit 1; fi\n\nhtmlc:\n\tgo test -coverprofile=\"/tmp/jpcov\"  && go tool cover -html=\"/tmp/jpcov\" && unlink /tmp/jpcov\n\nbuildfuzz:\n\tgo-fuzz-build github.com/jmespath/go-jmespath/fuzz\n\nfuzz: buildfuzz\n\tgo-fuzz -bin=./jmespath-fuzz.zip -workdir=fuzz/testdata\n\nbench:\n\tgo test -bench . -cpuprofile cpu.out\n\npprof-cpu:\n\tgo tool pprof ./go-jmespath.test ./cpu.out\n"
  },
  {
    "path": "vendor/github.com/jmespath/go-jmespath/README.md",
    "content": "# go-jmespath - A JMESPath implementation in Go\n\n[![Build Status](https://img.shields.io/travis/jmespath/go-jmespath.svg)](https://travis-ci.org/jmespath/go-jmespath)\n\n\n\nSee http://jmespath.org for more info.\n"
  },
  {
    "path": "vendor/github.com/jmespath/go-jmespath/api.go",
    "content": "package jmespath\n\nimport \"strconv\"\n\n// JmesPath is the epresentation of a compiled JMES path query. A JmesPath is\n// safe for concurrent use by multiple goroutines.\ntype JMESPath struct {\n\tast  ASTNode\n\tintr *treeInterpreter\n}\n\n// Compile parses a JMESPath expression and returns, if successful, a JMESPath\n// object that can be used to match against data.\nfunc Compile(expression string) (*JMESPath, error) {\n\tparser := NewParser()\n\tast, err := parser.Parse(expression)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tjmespath := &JMESPath{ast: ast, intr: newInterpreter()}\n\treturn jmespath, nil\n}\n\n// MustCompile is like Compile but panics if the expression cannot be parsed.\n// It simplifies safe initialization of global variables holding compiled\n// JMESPaths.\nfunc MustCompile(expression string) *JMESPath {\n\tjmespath, err := Compile(expression)\n\tif err != nil {\n\t\tpanic(`jmespath: Compile(` + strconv.Quote(expression) + `): ` + err.Error())\n\t}\n\treturn jmespath\n}\n\n// Search evaluates a JMESPath expression against input data and returns the result.\nfunc (jp *JMESPath) Search(data interface{}) (interface{}, error) {\n\treturn jp.intr.Execute(jp.ast, data)\n}\n\n// Search evaluates a JMESPath expression against input data and returns the result.\nfunc Search(expression string, data interface{}) (interface{}, error) {\n\tintr := newInterpreter()\n\tparser := NewParser()\n\tast, err := parser.Parse(expression)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn intr.Execute(ast, data)\n}\n"
  },
  {
    "path": "vendor/github.com/jmespath/go-jmespath/astnodetype_string.go",
    "content": "// generated by stringer -type astNodeType; DO NOT EDIT\n\npackage jmespath\n\nimport \"fmt\"\n\nconst _astNodeType_name = \"ASTEmptyASTComparatorASTCurrentNodeASTExpRefASTFunctionExpressionASTFieldASTFilterProjectionASTFlattenASTIdentityASTIndexASTIndexExpressionASTKeyValPairASTLiteralASTMultiSelectHashASTMultiSelectListASTOrExpressionASTAndExpressionASTNotExpressionASTPipeASTProjectionASTSubexpressionASTSliceASTValueProjection\"\n\nvar _astNodeType_index = [...]uint16{0, 8, 21, 35, 44, 65, 73, 92, 102, 113, 121, 139, 152, 162, 180, 198, 213, 229, 245, 252, 265, 281, 289, 307}\n\nfunc (i astNodeType) String() string {\n\tif i < 0 || i >= astNodeType(len(_astNodeType_index)-1) {\n\t\treturn fmt.Sprintf(\"astNodeType(%d)\", i)\n\t}\n\treturn _astNodeType_name[_astNodeType_index[i]:_astNodeType_index[i+1]]\n}\n"
  },
  {
    "path": "vendor/github.com/jmespath/go-jmespath/functions.go",
    "content": "package jmespath\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\ntype jpFunction func(arguments []interface{}) (interface{}, error)\n\ntype jpType string\n\nconst (\n\tjpUnknown     jpType = \"unknown\"\n\tjpNumber      jpType = \"number\"\n\tjpString      jpType = \"string\"\n\tjpArray       jpType = \"array\"\n\tjpObject      jpType = \"object\"\n\tjpArrayNumber jpType = \"array[number]\"\n\tjpArrayString jpType = \"array[string]\"\n\tjpExpref      jpType = \"expref\"\n\tjpAny         jpType = \"any\"\n)\n\ntype functionEntry struct {\n\tname      string\n\targuments []argSpec\n\thandler   jpFunction\n\thasExpRef bool\n}\n\ntype argSpec struct {\n\ttypes    []jpType\n\tvariadic bool\n}\n\ntype byExprString struct {\n\tintr     *treeInterpreter\n\tnode     ASTNode\n\titems    []interface{}\n\thasError bool\n}\n\nfunc (a *byExprString) Len() int {\n\treturn len(a.items)\n}\nfunc (a *byExprString) Swap(i, j int) {\n\ta.items[i], a.items[j] = a.items[j], a.items[i]\n}\nfunc (a *byExprString) Less(i, j int) bool {\n\tfirst, err := a.intr.Execute(a.node, a.items[i])\n\tif err != nil {\n\t\ta.hasError = true\n\t\t// Return a dummy value.\n\t\treturn true\n\t}\n\tith, ok := first.(string)\n\tif !ok {\n\t\ta.hasError = true\n\t\treturn true\n\t}\n\tsecond, err := a.intr.Execute(a.node, a.items[j])\n\tif err != nil {\n\t\ta.hasError = true\n\t\t// Return a dummy value.\n\t\treturn true\n\t}\n\tjth, ok := second.(string)\n\tif !ok {\n\t\ta.hasError = true\n\t\treturn true\n\t}\n\treturn ith < jth\n}\n\ntype byExprFloat struct {\n\tintr     *treeInterpreter\n\tnode     ASTNode\n\titems    []interface{}\n\thasError bool\n}\n\nfunc (a *byExprFloat) Len() int {\n\treturn len(a.items)\n}\nfunc (a *byExprFloat) Swap(i, j int) {\n\ta.items[i], a.items[j] = a.items[j], a.items[i]\n}\nfunc (a *byExprFloat) Less(i, j int) bool {\n\tfirst, err := a.intr.Execute(a.node, a.items[i])\n\tif err != nil {\n\t\ta.hasError = true\n\t\t// Return a dummy value.\n\t\treturn true\n\t}\n\tith, ok := first.(float64)\n\tif !ok {\n\t\ta.hasError = true\n\t\treturn true\n\t}\n\tsecond, err := a.intr.Execute(a.node, a.items[j])\n\tif err != nil {\n\t\ta.hasError = true\n\t\t// Return a dummy value.\n\t\treturn true\n\t}\n\tjth, ok := second.(float64)\n\tif !ok {\n\t\ta.hasError = true\n\t\treturn true\n\t}\n\treturn ith < jth\n}\n\ntype functionCaller struct {\n\tfunctionTable map[string]functionEntry\n}\n\nfunc newFunctionCaller() *functionCaller {\n\tcaller := &functionCaller{}\n\tcaller.functionTable = map[string]functionEntry{\n\t\t\"length\": {\n\t\t\tname: \"length\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpString, jpArray, jpObject}},\n\t\t\t},\n\t\t\thandler: jpfLength,\n\t\t},\n\t\t\"starts_with\": {\n\t\t\tname: \"starts_with\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpString}},\n\t\t\t\t{types: []jpType{jpString}},\n\t\t\t},\n\t\t\thandler: jpfStartsWith,\n\t\t},\n\t\t\"abs\": {\n\t\t\tname: \"abs\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpNumber}},\n\t\t\t},\n\t\t\thandler: jpfAbs,\n\t\t},\n\t\t\"avg\": {\n\t\t\tname: \"avg\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpArrayNumber}},\n\t\t\t},\n\t\t\thandler: jpfAvg,\n\t\t},\n\t\t\"ceil\": {\n\t\t\tname: \"ceil\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpNumber}},\n\t\t\t},\n\t\t\thandler: jpfCeil,\n\t\t},\n\t\t\"contains\": {\n\t\t\tname: \"contains\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpArray, jpString}},\n\t\t\t\t{types: []jpType{jpAny}},\n\t\t\t},\n\t\t\thandler: jpfContains,\n\t\t},\n\t\t\"ends_with\": {\n\t\t\tname: \"ends_with\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpString}},\n\t\t\t\t{types: []jpType{jpString}},\n\t\t\t},\n\t\t\thandler: jpfEndsWith,\n\t\t},\n\t\t\"floor\": {\n\t\t\tname: \"floor\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpNumber}},\n\t\t\t},\n\t\t\thandler: jpfFloor,\n\t\t},\n\t\t\"map\": {\n\t\t\tname: \"amp\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpExpref}},\n\t\t\t\t{types: []jpType{jpArray}},\n\t\t\t},\n\t\t\thandler:   jpfMap,\n\t\t\thasExpRef: true,\n\t\t},\n\t\t\"max\": {\n\t\t\tname: \"max\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpArrayNumber, jpArrayString}},\n\t\t\t},\n\t\t\thandler: jpfMax,\n\t\t},\n\t\t\"merge\": {\n\t\t\tname: \"merge\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpObject}, variadic: true},\n\t\t\t},\n\t\t\thandler: jpfMerge,\n\t\t},\n\t\t\"max_by\": {\n\t\t\tname: \"max_by\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpArray}},\n\t\t\t\t{types: []jpType{jpExpref}},\n\t\t\t},\n\t\t\thandler:   jpfMaxBy,\n\t\t\thasExpRef: true,\n\t\t},\n\t\t\"sum\": {\n\t\t\tname: \"sum\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpArrayNumber}},\n\t\t\t},\n\t\t\thandler: jpfSum,\n\t\t},\n\t\t\"min\": {\n\t\t\tname: \"min\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpArrayNumber, jpArrayString}},\n\t\t\t},\n\t\t\thandler: jpfMin,\n\t\t},\n\t\t\"min_by\": {\n\t\t\tname: \"min_by\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpArray}},\n\t\t\t\t{types: []jpType{jpExpref}},\n\t\t\t},\n\t\t\thandler:   jpfMinBy,\n\t\t\thasExpRef: true,\n\t\t},\n\t\t\"type\": {\n\t\t\tname: \"type\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpAny}},\n\t\t\t},\n\t\t\thandler: jpfType,\n\t\t},\n\t\t\"keys\": {\n\t\t\tname: \"keys\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpObject}},\n\t\t\t},\n\t\t\thandler: jpfKeys,\n\t\t},\n\t\t\"values\": {\n\t\t\tname: \"values\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpObject}},\n\t\t\t},\n\t\t\thandler: jpfValues,\n\t\t},\n\t\t\"sort\": {\n\t\t\tname: \"sort\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpArrayString, jpArrayNumber}},\n\t\t\t},\n\t\t\thandler: jpfSort,\n\t\t},\n\t\t\"sort_by\": {\n\t\t\tname: \"sort_by\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpArray}},\n\t\t\t\t{types: []jpType{jpExpref}},\n\t\t\t},\n\t\t\thandler:   jpfSortBy,\n\t\t\thasExpRef: true,\n\t\t},\n\t\t\"join\": {\n\t\t\tname: \"join\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpString}},\n\t\t\t\t{types: []jpType{jpArrayString}},\n\t\t\t},\n\t\t\thandler: jpfJoin,\n\t\t},\n\t\t\"reverse\": {\n\t\t\tname: \"reverse\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpArray, jpString}},\n\t\t\t},\n\t\t\thandler: jpfReverse,\n\t\t},\n\t\t\"to_array\": {\n\t\t\tname: \"to_array\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpAny}},\n\t\t\t},\n\t\t\thandler: jpfToArray,\n\t\t},\n\t\t\"to_string\": {\n\t\t\tname: \"to_string\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpAny}},\n\t\t\t},\n\t\t\thandler: jpfToString,\n\t\t},\n\t\t\"to_number\": {\n\t\t\tname: \"to_number\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpAny}},\n\t\t\t},\n\t\t\thandler: jpfToNumber,\n\t\t},\n\t\t\"not_null\": {\n\t\t\tname: \"not_null\",\n\t\t\targuments: []argSpec{\n\t\t\t\t{types: []jpType{jpAny}, variadic: true},\n\t\t\t},\n\t\t\thandler: jpfNotNull,\n\t\t},\n\t}\n\treturn caller\n}\n\nfunc (e *functionEntry) resolveArgs(arguments []interface{}) ([]interface{}, error) {\n\tif len(e.arguments) == 0 {\n\t\treturn arguments, nil\n\t}\n\tif !e.arguments[len(e.arguments)-1].variadic {\n\t\tif len(e.arguments) != len(arguments) {\n\t\t\treturn nil, errors.New(\"incorrect number of args\")\n\t\t}\n\t\tfor i, spec := range e.arguments {\n\t\t\tuserArg := arguments[i]\n\t\t\terr := spec.typeCheck(userArg)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\treturn arguments, nil\n\t}\n\tif len(arguments) < len(e.arguments) {\n\t\treturn nil, errors.New(\"Invalid arity.\")\n\t}\n\treturn arguments, nil\n}\n\nfunc (a *argSpec) typeCheck(arg interface{}) error {\n\tfor _, t := range a.types {\n\t\tswitch t {\n\t\tcase jpNumber:\n\t\t\tif _, ok := arg.(float64); ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\tcase jpString:\n\t\t\tif _, ok := arg.(string); ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\tcase jpArray:\n\t\t\tif isSliceType(arg) {\n\t\t\t\treturn nil\n\t\t\t}\n\t\tcase jpObject:\n\t\t\tif _, ok := arg.(map[string]interface{}); ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\tcase jpArrayNumber:\n\t\t\tif _, ok := toArrayNum(arg); ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\tcase jpArrayString:\n\t\t\tif _, ok := toArrayStr(arg); ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\tcase jpAny:\n\t\t\treturn nil\n\t\tcase jpExpref:\n\t\t\tif _, ok := arg.(expRef); ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\treturn fmt.Errorf(\"Invalid type for: %v, expected: %#v\", arg, a.types)\n}\n\nfunc (f *functionCaller) CallFunction(name string, arguments []interface{}, intr *treeInterpreter) (interface{}, error) {\n\tentry, ok := f.functionTable[name]\n\tif !ok {\n\t\treturn nil, errors.New(\"unknown function: \" + name)\n\t}\n\tresolvedArgs, err := entry.resolveArgs(arguments)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif entry.hasExpRef {\n\t\tvar extra []interface{}\n\t\textra = append(extra, intr)\n\t\tresolvedArgs = append(extra, resolvedArgs...)\n\t}\n\treturn entry.handler(resolvedArgs)\n}\n\nfunc jpfAbs(arguments []interface{}) (interface{}, error) {\n\tnum := arguments[0].(float64)\n\treturn math.Abs(num), nil\n}\n\nfunc jpfLength(arguments []interface{}) (interface{}, error) {\n\targ := arguments[0]\n\tif c, ok := arg.(string); ok {\n\t\treturn float64(utf8.RuneCountInString(c)), nil\n\t} else if isSliceType(arg) {\n\t\tv := reflect.ValueOf(arg)\n\t\treturn float64(v.Len()), nil\n\t} else if c, ok := arg.(map[string]interface{}); ok {\n\t\treturn float64(len(c)), nil\n\t}\n\treturn nil, errors.New(\"could not compute length()\")\n}\n\nfunc jpfStartsWith(arguments []interface{}) (interface{}, error) {\n\tsearch := arguments[0].(string)\n\tprefix := arguments[1].(string)\n\treturn strings.HasPrefix(search, prefix), nil\n}\n\nfunc jpfAvg(arguments []interface{}) (interface{}, error) {\n\t// We've already type checked the value so we can safely use\n\t// type assertions.\n\targs := arguments[0].([]interface{})\n\tlength := float64(len(args))\n\tnumerator := 0.0\n\tfor _, n := range args {\n\t\tnumerator += n.(float64)\n\t}\n\treturn numerator / length, nil\n}\nfunc jpfCeil(arguments []interface{}) (interface{}, error) {\n\tval := arguments[0].(float64)\n\treturn math.Ceil(val), nil\n}\nfunc jpfContains(arguments []interface{}) (interface{}, error) {\n\tsearch := arguments[0]\n\tel := arguments[1]\n\tif searchStr, ok := search.(string); ok {\n\t\tif elStr, ok := el.(string); ok {\n\t\t\treturn strings.Index(searchStr, elStr) != -1, nil\n\t\t}\n\t\treturn false, nil\n\t}\n\t// Otherwise this is a generic contains for []interface{}\n\tgeneral := search.([]interface{})\n\tfor _, item := range general {\n\t\tif item == el {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}\nfunc jpfEndsWith(arguments []interface{}) (interface{}, error) {\n\tsearch := arguments[0].(string)\n\tsuffix := arguments[1].(string)\n\treturn strings.HasSuffix(search, suffix), nil\n}\nfunc jpfFloor(arguments []interface{}) (interface{}, error) {\n\tval := arguments[0].(float64)\n\treturn math.Floor(val), nil\n}\nfunc jpfMap(arguments []interface{}) (interface{}, error) {\n\tintr := arguments[0].(*treeInterpreter)\n\texp := arguments[1].(expRef)\n\tnode := exp.ref\n\tarr := arguments[2].([]interface{})\n\tmapped := make([]interface{}, 0, len(arr))\n\tfor _, value := range arr {\n\t\tcurrent, err := intr.Execute(node, value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmapped = append(mapped, current)\n\t}\n\treturn mapped, nil\n}\nfunc jpfMax(arguments []interface{}) (interface{}, error) {\n\tif items, ok := toArrayNum(arguments[0]); ok {\n\t\tif len(items) == 0 {\n\t\t\treturn nil, nil\n\t\t}\n\t\tif len(items) == 1 {\n\t\t\treturn items[0], nil\n\t\t}\n\t\tbest := items[0]\n\t\tfor _, item := range items[1:] {\n\t\t\tif item > best {\n\t\t\t\tbest = item\n\t\t\t}\n\t\t}\n\t\treturn best, nil\n\t}\n\t// Otherwise we're dealing with a max() of strings.\n\titems, _ := toArrayStr(arguments[0])\n\tif len(items) == 0 {\n\t\treturn nil, nil\n\t}\n\tif len(items) == 1 {\n\t\treturn items[0], nil\n\t}\n\tbest := items[0]\n\tfor _, item := range items[1:] {\n\t\tif item > best {\n\t\t\tbest = item\n\t\t}\n\t}\n\treturn best, nil\n}\nfunc jpfMerge(arguments []interface{}) (interface{}, error) {\n\tfinal := make(map[string]interface{})\n\tfor _, m := range arguments {\n\t\tmapped := m.(map[string]interface{})\n\t\tfor key, value := range mapped {\n\t\t\tfinal[key] = value\n\t\t}\n\t}\n\treturn final, nil\n}\nfunc jpfMaxBy(arguments []interface{}) (interface{}, error) {\n\tintr := arguments[0].(*treeInterpreter)\n\tarr := arguments[1].([]interface{})\n\texp := arguments[2].(expRef)\n\tnode := exp.ref\n\tif len(arr) == 0 {\n\t\treturn nil, nil\n\t} else if len(arr) == 1 {\n\t\treturn arr[0], nil\n\t}\n\tstart, err := intr.Execute(node, arr[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch t := start.(type) {\n\tcase float64:\n\t\tbestVal := t\n\t\tbestItem := arr[0]\n\t\tfor _, item := range arr[1:] {\n\t\t\tresult, err := intr.Execute(node, item)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tcurrent, ok := result.(float64)\n\t\t\tif !ok {\n\t\t\t\treturn nil, errors.New(\"invalid type, must be number\")\n\t\t\t}\n\t\t\tif current > bestVal {\n\t\t\t\tbestVal = current\n\t\t\t\tbestItem = item\n\t\t\t}\n\t\t}\n\t\treturn bestItem, nil\n\tcase string:\n\t\tbestVal := t\n\t\tbestItem := arr[0]\n\t\tfor _, item := range arr[1:] {\n\t\t\tresult, err := intr.Execute(node, item)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tcurrent, ok := result.(string)\n\t\t\tif !ok {\n\t\t\t\treturn nil, errors.New(\"invalid type, must be string\")\n\t\t\t}\n\t\t\tif current > bestVal {\n\t\t\t\tbestVal = current\n\t\t\t\tbestItem = item\n\t\t\t}\n\t\t}\n\t\treturn bestItem, nil\n\tdefault:\n\t\treturn nil, errors.New(\"invalid type, must be number of string\")\n\t}\n}\nfunc jpfSum(arguments []interface{}) (interface{}, error) {\n\titems, _ := toArrayNum(arguments[0])\n\tsum := 0.0\n\tfor _, item := range items {\n\t\tsum += item\n\t}\n\treturn sum, nil\n}\n\nfunc jpfMin(arguments []interface{}) (interface{}, error) {\n\tif items, ok := toArrayNum(arguments[0]); ok {\n\t\tif len(items) == 0 {\n\t\t\treturn nil, nil\n\t\t}\n\t\tif len(items) == 1 {\n\t\t\treturn items[0], nil\n\t\t}\n\t\tbest := items[0]\n\t\tfor _, item := range items[1:] {\n\t\t\tif item < best {\n\t\t\t\tbest = item\n\t\t\t}\n\t\t}\n\t\treturn best, nil\n\t}\n\titems, _ := toArrayStr(arguments[0])\n\tif len(items) == 0 {\n\t\treturn nil, nil\n\t}\n\tif len(items) == 1 {\n\t\treturn items[0], nil\n\t}\n\tbest := items[0]\n\tfor _, item := range items[1:] {\n\t\tif item < best {\n\t\t\tbest = item\n\t\t}\n\t}\n\treturn best, nil\n}\n\nfunc jpfMinBy(arguments []interface{}) (interface{}, error) {\n\tintr := arguments[0].(*treeInterpreter)\n\tarr := arguments[1].([]interface{})\n\texp := arguments[2].(expRef)\n\tnode := exp.ref\n\tif len(arr) == 0 {\n\t\treturn nil, nil\n\t} else if len(arr) == 1 {\n\t\treturn arr[0], nil\n\t}\n\tstart, err := intr.Execute(node, arr[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif t, ok := start.(float64); ok {\n\t\tbestVal := t\n\t\tbestItem := arr[0]\n\t\tfor _, item := range arr[1:] {\n\t\t\tresult, err := intr.Execute(node, item)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tcurrent, ok := result.(float64)\n\t\t\tif !ok {\n\t\t\t\treturn nil, errors.New(\"invalid type, must be number\")\n\t\t\t}\n\t\t\tif current < bestVal {\n\t\t\t\tbestVal = current\n\t\t\t\tbestItem = item\n\t\t\t}\n\t\t}\n\t\treturn bestItem, nil\n\t} else if t, ok := start.(string); ok {\n\t\tbestVal := t\n\t\tbestItem := arr[0]\n\t\tfor _, item := range arr[1:] {\n\t\t\tresult, err := intr.Execute(node, item)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tcurrent, ok := result.(string)\n\t\t\tif !ok {\n\t\t\t\treturn nil, errors.New(\"invalid type, must be string\")\n\t\t\t}\n\t\t\tif current < bestVal {\n\t\t\t\tbestVal = current\n\t\t\t\tbestItem = item\n\t\t\t}\n\t\t}\n\t\treturn bestItem, nil\n\t} else {\n\t\treturn nil, errors.New(\"invalid type, must be number of string\")\n\t}\n}\nfunc jpfType(arguments []interface{}) (interface{}, error) {\n\targ := arguments[0]\n\tif _, ok := arg.(float64); ok {\n\t\treturn \"number\", nil\n\t}\n\tif _, ok := arg.(string); ok {\n\t\treturn \"string\", nil\n\t}\n\tif _, ok := arg.([]interface{}); ok {\n\t\treturn \"array\", nil\n\t}\n\tif _, ok := arg.(map[string]interface{}); ok {\n\t\treturn \"object\", nil\n\t}\n\tif arg == nil {\n\t\treturn \"null\", nil\n\t}\n\tif arg == true || arg == false {\n\t\treturn \"boolean\", nil\n\t}\n\treturn nil, errors.New(\"unknown type\")\n}\nfunc jpfKeys(arguments []interface{}) (interface{}, error) {\n\targ := arguments[0].(map[string]interface{})\n\tcollected := make([]interface{}, 0, len(arg))\n\tfor key := range arg {\n\t\tcollected = append(collected, key)\n\t}\n\treturn collected, nil\n}\nfunc jpfValues(arguments []interface{}) (interface{}, error) {\n\targ := arguments[0].(map[string]interface{})\n\tcollected := make([]interface{}, 0, len(arg))\n\tfor _, value := range arg {\n\t\tcollected = append(collected, value)\n\t}\n\treturn collected, nil\n}\nfunc jpfSort(arguments []interface{}) (interface{}, error) {\n\tif items, ok := toArrayNum(arguments[0]); ok {\n\t\td := sort.Float64Slice(items)\n\t\tsort.Stable(d)\n\t\tfinal := make([]interface{}, len(d))\n\t\tfor i, val := range d {\n\t\t\tfinal[i] = val\n\t\t}\n\t\treturn final, nil\n\t}\n\t// Otherwise we're dealing with sort()'ing strings.\n\titems, _ := toArrayStr(arguments[0])\n\td := sort.StringSlice(items)\n\tsort.Stable(d)\n\tfinal := make([]interface{}, len(d))\n\tfor i, val := range d {\n\t\tfinal[i] = val\n\t}\n\treturn final, nil\n}\nfunc jpfSortBy(arguments []interface{}) (interface{}, error) {\n\tintr := arguments[0].(*treeInterpreter)\n\tarr := arguments[1].([]interface{})\n\texp := arguments[2].(expRef)\n\tnode := exp.ref\n\tif len(arr) == 0 {\n\t\treturn arr, nil\n\t} else if len(arr) == 1 {\n\t\treturn arr, nil\n\t}\n\tstart, err := intr.Execute(node, arr[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif _, ok := start.(float64); ok {\n\t\tsortable := &byExprFloat{intr, node, arr, false}\n\t\tsort.Stable(sortable)\n\t\tif sortable.hasError {\n\t\t\treturn nil, errors.New(\"error in sort_by comparison\")\n\t\t}\n\t\treturn arr, nil\n\t} else if _, ok := start.(string); ok {\n\t\tsortable := &byExprString{intr, node, arr, false}\n\t\tsort.Stable(sortable)\n\t\tif sortable.hasError {\n\t\t\treturn nil, errors.New(\"error in sort_by comparison\")\n\t\t}\n\t\treturn arr, nil\n\t} else {\n\t\treturn nil, errors.New(\"invalid type, must be number of string\")\n\t}\n}\nfunc jpfJoin(arguments []interface{}) (interface{}, error) {\n\tsep := arguments[0].(string)\n\t// We can't just do arguments[1].([]string), we have to\n\t// manually convert each item to a string.\n\tarrayStr := []string{}\n\tfor _, item := range arguments[1].([]interface{}) {\n\t\tarrayStr = append(arrayStr, item.(string))\n\t}\n\treturn strings.Join(arrayStr, sep), nil\n}\nfunc jpfReverse(arguments []interface{}) (interface{}, error) {\n\tif s, ok := arguments[0].(string); ok {\n\t\tr := []rune(s)\n\t\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\t\tr[i], r[j] = r[j], r[i]\n\t\t}\n\t\treturn string(r), nil\n\t}\n\titems := arguments[0].([]interface{})\n\tlength := len(items)\n\treversed := make([]interface{}, length)\n\tfor i, item := range items {\n\t\treversed[length-(i+1)] = item\n\t}\n\treturn reversed, nil\n}\nfunc jpfToArray(arguments []interface{}) (interface{}, error) {\n\tif _, ok := arguments[0].([]interface{}); ok {\n\t\treturn arguments[0], nil\n\t}\n\treturn arguments[:1:1], nil\n}\nfunc jpfToString(arguments []interface{}) (interface{}, error) {\n\tif v, ok := arguments[0].(string); ok {\n\t\treturn v, nil\n\t}\n\tresult, err := json.Marshal(arguments[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn string(result), nil\n}\nfunc jpfToNumber(arguments []interface{}) (interface{}, error) {\n\targ := arguments[0]\n\tif v, ok := arg.(float64); ok {\n\t\treturn v, nil\n\t}\n\tif v, ok := arg.(string); ok {\n\t\tconv, err := strconv.ParseFloat(v, 64)\n\t\tif err != nil {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn conv, nil\n\t}\n\tif _, ok := arg.([]interface{}); ok {\n\t\treturn nil, nil\n\t}\n\tif _, ok := arg.(map[string]interface{}); ok {\n\t\treturn nil, nil\n\t}\n\tif arg == nil {\n\t\treturn nil, nil\n\t}\n\tif arg == true || arg == false {\n\t\treturn nil, nil\n\t}\n\treturn nil, errors.New(\"unknown type\")\n}\nfunc jpfNotNull(arguments []interface{}) (interface{}, error) {\n\tfor _, arg := range arguments {\n\t\tif arg != nil {\n\t\t\treturn arg, nil\n\t\t}\n\t}\n\treturn nil, nil\n}\n"
  },
  {
    "path": "vendor/github.com/jmespath/go-jmespath/interpreter.go",
    "content": "package jmespath\n\nimport (\n\t\"errors\"\n\t\"reflect\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\n/* This is a tree based interpreter.  It walks the AST and directly\n   interprets the AST to search through a JSON document.\n*/\n\ntype treeInterpreter struct {\n\tfCall *functionCaller\n}\n\nfunc newInterpreter() *treeInterpreter {\n\tinterpreter := treeInterpreter{}\n\tinterpreter.fCall = newFunctionCaller()\n\treturn &interpreter\n}\n\ntype expRef struct {\n\tref ASTNode\n}\n\n// Execute takes an ASTNode and input data and interprets the AST directly.\n// It will produce the result of applying the JMESPath expression associated\n// with the ASTNode to the input data \"value\".\nfunc (intr *treeInterpreter) Execute(node ASTNode, value interface{}) (interface{}, error) {\n\tswitch node.nodeType {\n\tcase ASTComparator:\n\t\tleft, err := intr.Execute(node.children[0], value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tright, err := intr.Execute(node.children[1], value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tswitch node.value {\n\t\tcase tEQ:\n\t\t\treturn objsEqual(left, right), nil\n\t\tcase tNE:\n\t\t\treturn !objsEqual(left, right), nil\n\t\t}\n\t\tleftNum, ok := left.(float64)\n\t\tif !ok {\n\t\t\treturn nil, nil\n\t\t}\n\t\trightNum, ok := right.(float64)\n\t\tif !ok {\n\t\t\treturn nil, nil\n\t\t}\n\t\tswitch node.value {\n\t\tcase tGT:\n\t\t\treturn leftNum > rightNum, nil\n\t\tcase tGTE:\n\t\t\treturn leftNum >= rightNum, nil\n\t\tcase tLT:\n\t\t\treturn leftNum < rightNum, nil\n\t\tcase tLTE:\n\t\t\treturn leftNum <= rightNum, nil\n\t\t}\n\tcase ASTExpRef:\n\t\treturn expRef{ref: node.children[0]}, nil\n\tcase ASTFunctionExpression:\n\t\tresolvedArgs := []interface{}{}\n\t\tfor _, arg := range node.children {\n\t\t\tcurrent, err := intr.Execute(arg, value)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tresolvedArgs = append(resolvedArgs, current)\n\t\t}\n\t\treturn intr.fCall.CallFunction(node.value.(string), resolvedArgs, intr)\n\tcase ASTField:\n\t\tif m, ok := value.(map[string]interface{}); ok {\n\t\t\tkey := node.value.(string)\n\t\t\treturn m[key], nil\n\t\t}\n\t\treturn intr.fieldFromStruct(node.value.(string), value)\n\tcase ASTFilterProjection:\n\t\tleft, err := intr.Execute(node.children[0], value)\n\t\tif err != nil {\n\t\t\treturn nil, nil\n\t\t}\n\t\tsliceType, ok := left.([]interface{})\n\t\tif !ok {\n\t\t\tif isSliceType(left) {\n\t\t\t\treturn intr.filterProjectionWithReflection(node, left)\n\t\t\t}\n\t\t\treturn nil, nil\n\t\t}\n\t\tcompareNode := node.children[2]\n\t\tcollected := []interface{}{}\n\t\tfor _, element := range sliceType {\n\t\t\tresult, err := intr.Execute(compareNode, element)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif !isFalse(result) {\n\t\t\t\tcurrent, err := intr.Execute(node.children[1], element)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tif current != nil {\n\t\t\t\t\tcollected = append(collected, current)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn collected, nil\n\tcase ASTFlatten:\n\t\tleft, err := intr.Execute(node.children[0], value)\n\t\tif err != nil {\n\t\t\treturn nil, nil\n\t\t}\n\t\tsliceType, ok := left.([]interface{})\n\t\tif !ok {\n\t\t\t// If we can't type convert to []interface{}, there's\n\t\t\t// a chance this could still work via reflection if we're\n\t\t\t// dealing with user provided types.\n\t\t\tif isSliceType(left) {\n\t\t\t\treturn intr.flattenWithReflection(left)\n\t\t\t}\n\t\t\treturn nil, nil\n\t\t}\n\t\tflattened := []interface{}{}\n\t\tfor _, element := range sliceType {\n\t\t\tif elementSlice, ok := element.([]interface{}); ok {\n\t\t\t\tflattened = append(flattened, elementSlice...)\n\t\t\t} else if isSliceType(element) {\n\t\t\t\treflectFlat := []interface{}{}\n\t\t\t\tv := reflect.ValueOf(element)\n\t\t\t\tfor i := 0; i < v.Len(); i++ {\n\t\t\t\t\treflectFlat = append(reflectFlat, v.Index(i).Interface())\n\t\t\t\t}\n\t\t\t\tflattened = append(flattened, reflectFlat...)\n\t\t\t} else {\n\t\t\t\tflattened = append(flattened, element)\n\t\t\t}\n\t\t}\n\t\treturn flattened, nil\n\tcase ASTIdentity, ASTCurrentNode:\n\t\treturn value, nil\n\tcase ASTIndex:\n\t\tif sliceType, ok := value.([]interface{}); ok {\n\t\t\tindex := node.value.(int)\n\t\t\tif index < 0 {\n\t\t\t\tindex += len(sliceType)\n\t\t\t}\n\t\t\tif index < len(sliceType) && index >= 0 {\n\t\t\t\treturn sliceType[index], nil\n\t\t\t}\n\t\t\treturn nil, nil\n\t\t}\n\t\t// Otherwise try via reflection.\n\t\trv := reflect.ValueOf(value)\n\t\tif rv.Kind() == reflect.Slice {\n\t\t\tindex := node.value.(int)\n\t\t\tif index < 0 {\n\t\t\t\tindex += rv.Len()\n\t\t\t}\n\t\t\tif index < rv.Len() && index >= 0 {\n\t\t\t\tv := rv.Index(index)\n\t\t\t\treturn v.Interface(), nil\n\t\t\t}\n\t\t}\n\t\treturn nil, nil\n\tcase ASTKeyValPair:\n\t\treturn intr.Execute(node.children[0], value)\n\tcase ASTLiteral:\n\t\treturn node.value, nil\n\tcase ASTMultiSelectHash:\n\t\tif value == nil {\n\t\t\treturn nil, nil\n\t\t}\n\t\tcollected := make(map[string]interface{})\n\t\tfor _, child := range node.children {\n\t\t\tcurrent, err := intr.Execute(child, value)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tkey := child.value.(string)\n\t\t\tcollected[key] = current\n\t\t}\n\t\treturn collected, nil\n\tcase ASTMultiSelectList:\n\t\tif value == nil {\n\t\t\treturn nil, nil\n\t\t}\n\t\tcollected := []interface{}{}\n\t\tfor _, child := range node.children {\n\t\t\tcurrent, err := intr.Execute(child, value)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tcollected = append(collected, current)\n\t\t}\n\t\treturn collected, nil\n\tcase ASTOrExpression:\n\t\tmatched, err := intr.Execute(node.children[0], value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif isFalse(matched) {\n\t\t\tmatched, err = intr.Execute(node.children[1], value)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\treturn matched, nil\n\tcase ASTAndExpression:\n\t\tmatched, err := intr.Execute(node.children[0], value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif isFalse(matched) {\n\t\t\treturn matched, nil\n\t\t}\n\t\treturn intr.Execute(node.children[1], value)\n\tcase ASTNotExpression:\n\t\tmatched, err := intr.Execute(node.children[0], value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif isFalse(matched) {\n\t\t\treturn true, nil\n\t\t}\n\t\treturn false, nil\n\tcase ASTPipe:\n\t\tresult := value\n\t\tvar err error\n\t\tfor _, child := range node.children {\n\t\t\tresult, err = intr.Execute(child, result)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\treturn result, nil\n\tcase ASTProjection:\n\t\tleft, err := intr.Execute(node.children[0], value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsliceType, ok := left.([]interface{})\n\t\tif !ok {\n\t\t\tif isSliceType(left) {\n\t\t\t\treturn intr.projectWithReflection(node, left)\n\t\t\t}\n\t\t\treturn nil, nil\n\t\t}\n\t\tcollected := []interface{}{}\n\t\tvar current interface{}\n\t\tfor _, element := range sliceType {\n\t\t\tcurrent, err = intr.Execute(node.children[1], element)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif current != nil {\n\t\t\t\tcollected = append(collected, current)\n\t\t\t}\n\t\t}\n\t\treturn collected, nil\n\tcase ASTSubexpression, ASTIndexExpression:\n\t\tleft, err := intr.Execute(node.children[0], value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn intr.Execute(node.children[1], left)\n\tcase ASTSlice:\n\t\tsliceType, ok := value.([]interface{})\n\t\tif !ok {\n\t\t\tif isSliceType(value) {\n\t\t\t\treturn intr.sliceWithReflection(node, value)\n\t\t\t}\n\t\t\treturn nil, nil\n\t\t}\n\t\tparts := node.value.([]*int)\n\t\tsliceParams := make([]sliceParam, 3)\n\t\tfor i, part := range parts {\n\t\t\tif part != nil {\n\t\t\t\tsliceParams[i].Specified = true\n\t\t\t\tsliceParams[i].N = *part\n\t\t\t}\n\t\t}\n\t\treturn slice(sliceType, sliceParams)\n\tcase ASTValueProjection:\n\t\tleft, err := intr.Execute(node.children[0], value)\n\t\tif err != nil {\n\t\t\treturn nil, nil\n\t\t}\n\t\tmapType, ok := left.(map[string]interface{})\n\t\tif !ok {\n\t\t\treturn nil, nil\n\t\t}\n\t\tvalues := make([]interface{}, len(mapType))\n\t\tfor _, value := range mapType {\n\t\t\tvalues = append(values, value)\n\t\t}\n\t\tcollected := []interface{}{}\n\t\tfor _, element := range values {\n\t\t\tcurrent, err := intr.Execute(node.children[1], element)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif current != nil {\n\t\t\t\tcollected = append(collected, current)\n\t\t\t}\n\t\t}\n\t\treturn collected, nil\n\t}\n\treturn nil, errors.New(\"Unknown AST node: \" + node.nodeType.String())\n}\n\nfunc (intr *treeInterpreter) fieldFromStruct(key string, value interface{}) (interface{}, error) {\n\trv := reflect.ValueOf(value)\n\tfirst, n := utf8.DecodeRuneInString(key)\n\tfieldName := string(unicode.ToUpper(first)) + key[n:]\n\tif rv.Kind() == reflect.Struct {\n\t\tv := rv.FieldByName(fieldName)\n\t\tif !v.IsValid() {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn v.Interface(), nil\n\t} else if rv.Kind() == reflect.Ptr {\n\t\t// Handle multiple levels of indirection?\n\t\tif rv.IsNil() {\n\t\t\treturn nil, nil\n\t\t}\n\t\trv = rv.Elem()\n\t\tv := rv.FieldByName(fieldName)\n\t\tif !v.IsValid() {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn v.Interface(), nil\n\t}\n\treturn nil, nil\n}\n\nfunc (intr *treeInterpreter) flattenWithReflection(value interface{}) (interface{}, error) {\n\tv := reflect.ValueOf(value)\n\tflattened := []interface{}{}\n\tfor i := 0; i < v.Len(); i++ {\n\t\telement := v.Index(i).Interface()\n\t\tif reflect.TypeOf(element).Kind() == reflect.Slice {\n\t\t\t// Then insert the contents of the element\n\t\t\t// slice into the flattened slice,\n\t\t\t// i.e flattened = append(flattened, mySlice...)\n\t\t\telementV := reflect.ValueOf(element)\n\t\t\tfor j := 0; j < elementV.Len(); j++ {\n\t\t\t\tflattened = append(\n\t\t\t\t\tflattened, elementV.Index(j).Interface())\n\t\t\t}\n\t\t} else {\n\t\t\tflattened = append(flattened, element)\n\t\t}\n\t}\n\treturn flattened, nil\n}\n\nfunc (intr *treeInterpreter) sliceWithReflection(node ASTNode, value interface{}) (interface{}, error) {\n\tv := reflect.ValueOf(value)\n\tparts := node.value.([]*int)\n\tsliceParams := make([]sliceParam, 3)\n\tfor i, part := range parts {\n\t\tif part != nil {\n\t\t\tsliceParams[i].Specified = true\n\t\t\tsliceParams[i].N = *part\n\t\t}\n\t}\n\tfinal := []interface{}{}\n\tfor i := 0; i < v.Len(); i++ {\n\t\telement := v.Index(i).Interface()\n\t\tfinal = append(final, element)\n\t}\n\treturn slice(final, sliceParams)\n}\n\nfunc (intr *treeInterpreter) filterProjectionWithReflection(node ASTNode, value interface{}) (interface{}, error) {\n\tcompareNode := node.children[2]\n\tcollected := []interface{}{}\n\tv := reflect.ValueOf(value)\n\tfor i := 0; i < v.Len(); i++ {\n\t\telement := v.Index(i).Interface()\n\t\tresult, err := intr.Execute(compareNode, element)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif !isFalse(result) {\n\t\t\tcurrent, err := intr.Execute(node.children[1], element)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif current != nil {\n\t\t\t\tcollected = append(collected, current)\n\t\t\t}\n\t\t}\n\t}\n\treturn collected, nil\n}\n\nfunc (intr *treeInterpreter) projectWithReflection(node ASTNode, value interface{}) (interface{}, error) {\n\tcollected := []interface{}{}\n\tv := reflect.ValueOf(value)\n\tfor i := 0; i < v.Len(); i++ {\n\t\telement := v.Index(i).Interface()\n\t\tresult, err := intr.Execute(node.children[1], element)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif result != nil {\n\t\t\tcollected = append(collected, result)\n\t\t}\n\t}\n\treturn collected, nil\n}\n"
  },
  {
    "path": "vendor/github.com/jmespath/go-jmespath/lexer.go",
    "content": "package jmespath\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\ntype token struct {\n\ttokenType tokType\n\tvalue     string\n\tposition  int\n\tlength    int\n}\n\ntype tokType int\n\nconst eof = -1\n\n// Lexer contains information about the expression being tokenized.\ntype Lexer struct {\n\texpression string       // The expression provided by the user.\n\tcurrentPos int          // The current position in the string.\n\tlastWidth  int          // The width of the current rune.  This\n\tbuf        bytes.Buffer // Internal buffer used for building up values.\n}\n\n// SyntaxError is the main error used whenever a lexing or parsing error occurs.\ntype SyntaxError struct {\n\tmsg        string // Error message displayed to user\n\tExpression string // Expression that generated a SyntaxError\n\tOffset     int    // The location in the string where the error occurred\n}\n\nfunc (e SyntaxError) Error() string {\n\t// In the future, it would be good to underline the specific\n\t// location where the error occurred.\n\treturn \"SyntaxError: \" + e.msg\n}\n\n// HighlightLocation will show where the syntax error occurred.\n// It will place a \"^\" character on a line below the expression\n// at the point where the syntax error occurred.\nfunc (e SyntaxError) HighlightLocation() string {\n\treturn e.Expression + \"\\n\" + strings.Repeat(\" \", e.Offset) + \"^\"\n}\n\n//go:generate stringer -type=tokType\nconst (\n\ttUnknown tokType = iota\n\ttStar\n\ttDot\n\ttFilter\n\ttFlatten\n\ttLparen\n\ttRparen\n\ttLbracket\n\ttRbracket\n\ttLbrace\n\ttRbrace\n\ttOr\n\ttPipe\n\ttNumber\n\ttUnquotedIdentifier\n\ttQuotedIdentifier\n\ttComma\n\ttColon\n\ttLT\n\ttLTE\n\ttGT\n\ttGTE\n\ttEQ\n\ttNE\n\ttJSONLiteral\n\ttStringLiteral\n\ttCurrent\n\ttExpref\n\ttAnd\n\ttNot\n\ttEOF\n)\n\nvar basicTokens = map[rune]tokType{\n\t'.': tDot,\n\t'*': tStar,\n\t',': tComma,\n\t':': tColon,\n\t'{': tLbrace,\n\t'}': tRbrace,\n\t']': tRbracket, // tLbracket not included because it could be \"[]\"\n\t'(': tLparen,\n\t')': tRparen,\n\t'@': tCurrent,\n}\n\n// Bit mask for [a-zA-Z_] shifted down 64 bits to fit in a single uint64.\n// When using this bitmask just be sure to shift the rune down 64 bits\n// before checking against identifierStartBits.\nconst identifierStartBits uint64 = 576460745995190270\n\n// Bit mask for [a-zA-Z0-9], 128 bits -> 2 uint64s.\nvar identifierTrailingBits = [2]uint64{287948901175001088, 576460745995190270}\n\nvar whiteSpace = map[rune]bool{\n\t' ': true, '\\t': true, '\\n': true, '\\r': true,\n}\n\nfunc (t token) String() string {\n\treturn fmt.Sprintf(\"Token{%+v, %s, %d, %d}\",\n\t\tt.tokenType, t.value, t.position, t.length)\n}\n\n// NewLexer creates a new JMESPath lexer.\nfunc NewLexer() *Lexer {\n\tlexer := Lexer{}\n\treturn &lexer\n}\n\nfunc (lexer *Lexer) next() rune {\n\tif lexer.currentPos >= len(lexer.expression) {\n\t\tlexer.lastWidth = 0\n\t\treturn eof\n\t}\n\tr, w := utf8.DecodeRuneInString(lexer.expression[lexer.currentPos:])\n\tlexer.lastWidth = w\n\tlexer.currentPos += w\n\treturn r\n}\n\nfunc (lexer *Lexer) back() {\n\tlexer.currentPos -= lexer.lastWidth\n}\n\nfunc (lexer *Lexer) peek() rune {\n\tt := lexer.next()\n\tlexer.back()\n\treturn t\n}\n\n// tokenize takes an expression and returns corresponding tokens.\nfunc (lexer *Lexer) tokenize(expression string) ([]token, error) {\n\tvar tokens []token\n\tlexer.expression = expression\n\tlexer.currentPos = 0\n\tlexer.lastWidth = 0\nloop:\n\tfor {\n\t\tr := lexer.next()\n\t\tif identifierStartBits&(1<<(uint64(r)-64)) > 0 {\n\t\t\tt := lexer.consumeUnquotedIdentifier()\n\t\t\ttokens = append(tokens, t)\n\t\t} else if val, ok := basicTokens[r]; ok {\n\t\t\t// Basic single char token.\n\t\t\tt := token{\n\t\t\t\ttokenType: val,\n\t\t\t\tvalue:     string(r),\n\t\t\t\tposition:  lexer.currentPos - lexer.lastWidth,\n\t\t\t\tlength:    1,\n\t\t\t}\n\t\t\ttokens = append(tokens, t)\n\t\t} else if r == '-' || (r >= '0' && r <= '9') {\n\t\t\tt := lexer.consumeNumber()\n\t\t\ttokens = append(tokens, t)\n\t\t} else if r == '[' {\n\t\t\tt := lexer.consumeLBracket()\n\t\t\ttokens = append(tokens, t)\n\t\t} else if r == '\"' {\n\t\t\tt, err := lexer.consumeQuotedIdentifier()\n\t\t\tif err != nil {\n\t\t\t\treturn tokens, err\n\t\t\t}\n\t\t\ttokens = append(tokens, t)\n\t\t} else if r == '\\'' {\n\t\t\tt, err := lexer.consumeRawStringLiteral()\n\t\t\tif err != nil {\n\t\t\t\treturn tokens, err\n\t\t\t}\n\t\t\ttokens = append(tokens, t)\n\t\t} else if r == '`' {\n\t\t\tt, err := lexer.consumeLiteral()\n\t\t\tif err != nil {\n\t\t\t\treturn tokens, err\n\t\t\t}\n\t\t\ttokens = append(tokens, t)\n\t\t} else if r == '|' {\n\t\t\tt := lexer.matchOrElse(r, '|', tOr, tPipe)\n\t\t\ttokens = append(tokens, t)\n\t\t} else if r == '<' {\n\t\t\tt := lexer.matchOrElse(r, '=', tLTE, tLT)\n\t\t\ttokens = append(tokens, t)\n\t\t} else if r == '>' {\n\t\t\tt := lexer.matchOrElse(r, '=', tGTE, tGT)\n\t\t\ttokens = append(tokens, t)\n\t\t} else if r == '!' {\n\t\t\tt := lexer.matchOrElse(r, '=', tNE, tNot)\n\t\t\ttokens = append(tokens, t)\n\t\t} else if r == '=' {\n\t\t\tt := lexer.matchOrElse(r, '=', tEQ, tUnknown)\n\t\t\ttokens = append(tokens, t)\n\t\t} else if r == '&' {\n\t\t\tt := lexer.matchOrElse(r, '&', tAnd, tExpref)\n\t\t\ttokens = append(tokens, t)\n\t\t} else if r == eof {\n\t\t\tbreak loop\n\t\t} else if _, ok := whiteSpace[r]; ok {\n\t\t\t// Ignore whitespace\n\t\t} else {\n\t\t\treturn tokens, lexer.syntaxError(fmt.Sprintf(\"Unknown char: %s\", strconv.QuoteRuneToASCII(r)))\n\t\t}\n\t}\n\ttokens = append(tokens, token{tEOF, \"\", len(lexer.expression), 0})\n\treturn tokens, nil\n}\n\n// Consume characters until the ending rune \"r\" is reached.\n// If the end of the expression is reached before seeing the\n// terminating rune \"r\", then an error is returned.\n// If no error occurs then the matching substring is returned.\n// The returned string will not include the ending rune.\nfunc (lexer *Lexer) consumeUntil(end rune) (string, error) {\n\tstart := lexer.currentPos\n\tcurrent := lexer.next()\n\tfor current != end && current != eof {\n\t\tif current == '\\\\' && lexer.peek() != eof {\n\t\t\tlexer.next()\n\t\t}\n\t\tcurrent = lexer.next()\n\t}\n\tif lexer.lastWidth == 0 {\n\t\t// Then we hit an EOF so we never reached the closing\n\t\t// delimiter.\n\t\treturn \"\", SyntaxError{\n\t\t\tmsg:        \"Unclosed delimiter: \" + string(end),\n\t\t\tExpression: lexer.expression,\n\t\t\tOffset:     len(lexer.expression),\n\t\t}\n\t}\n\treturn lexer.expression[start : lexer.currentPos-lexer.lastWidth], nil\n}\n\nfunc (lexer *Lexer) consumeLiteral() (token, error) {\n\tstart := lexer.currentPos\n\tvalue, err := lexer.consumeUntil('`')\n\tif err != nil {\n\t\treturn token{}, err\n\t}\n\tvalue = strings.Replace(value, \"\\\\`\", \"`\", -1)\n\treturn token{\n\t\ttokenType: tJSONLiteral,\n\t\tvalue:     value,\n\t\tposition:  start,\n\t\tlength:    len(value),\n\t}, nil\n}\n\nfunc (lexer *Lexer) consumeRawStringLiteral() (token, error) {\n\tstart := lexer.currentPos\n\tcurrentIndex := start\n\tcurrent := lexer.next()\n\tfor current != '\\'' && lexer.peek() != eof {\n\t\tif current == '\\\\' && lexer.peek() == '\\'' {\n\t\t\tchunk := lexer.expression[currentIndex : lexer.currentPos-1]\n\t\t\tlexer.buf.WriteString(chunk)\n\t\t\tlexer.buf.WriteString(\"'\")\n\t\t\tlexer.next()\n\t\t\tcurrentIndex = lexer.currentPos\n\t\t}\n\t\tcurrent = lexer.next()\n\t}\n\tif lexer.lastWidth == 0 {\n\t\t// Then we hit an EOF so we never reached the closing\n\t\t// delimiter.\n\t\treturn token{}, SyntaxError{\n\t\t\tmsg:        \"Unclosed delimiter: '\",\n\t\t\tExpression: lexer.expression,\n\t\t\tOffset:     len(lexer.expression),\n\t\t}\n\t}\n\tif currentIndex < lexer.currentPos {\n\t\tlexer.buf.WriteString(lexer.expression[currentIndex : lexer.currentPos-1])\n\t}\n\tvalue := lexer.buf.String()\n\t// Reset the buffer so it can reused again.\n\tlexer.buf.Reset()\n\treturn token{\n\t\ttokenType: tStringLiteral,\n\t\tvalue:     value,\n\t\tposition:  start,\n\t\tlength:    len(value),\n\t}, nil\n}\n\nfunc (lexer *Lexer) syntaxError(msg string) SyntaxError {\n\treturn SyntaxError{\n\t\tmsg:        msg,\n\t\tExpression: lexer.expression,\n\t\tOffset:     lexer.currentPos - 1,\n\t}\n}\n\n// Checks for a two char token, otherwise matches a single character\n// token. This is used whenever a two char token overlaps a single\n// char token, e.g. \"||\" -> tPipe, \"|\" -> tOr.\nfunc (lexer *Lexer) matchOrElse(first rune, second rune, matchedType tokType, singleCharType tokType) token {\n\tstart := lexer.currentPos - lexer.lastWidth\n\tnextRune := lexer.next()\n\tvar t token\n\tif nextRune == second {\n\t\tt = token{\n\t\t\ttokenType: matchedType,\n\t\t\tvalue:     string(first) + string(second),\n\t\t\tposition:  start,\n\t\t\tlength:    2,\n\t\t}\n\t} else {\n\t\tlexer.back()\n\t\tt = token{\n\t\t\ttokenType: singleCharType,\n\t\t\tvalue:     string(first),\n\t\t\tposition:  start,\n\t\t\tlength:    1,\n\t\t}\n\t}\n\treturn t\n}\n\nfunc (lexer *Lexer) consumeLBracket() token {\n\t// There's three options here:\n\t// 1. A filter expression \"[?\"\n\t// 2. A flatten operator \"[]\"\n\t// 3. A bare rbracket \"[\"\n\tstart := lexer.currentPos - lexer.lastWidth\n\tnextRune := lexer.next()\n\tvar t token\n\tif nextRune == '?' {\n\t\tt = token{\n\t\t\ttokenType: tFilter,\n\t\t\tvalue:     \"[?\",\n\t\t\tposition:  start,\n\t\t\tlength:    2,\n\t\t}\n\t} else if nextRune == ']' {\n\t\tt = token{\n\t\t\ttokenType: tFlatten,\n\t\t\tvalue:     \"[]\",\n\t\t\tposition:  start,\n\t\t\tlength:    2,\n\t\t}\n\t} else {\n\t\tt = token{\n\t\t\ttokenType: tLbracket,\n\t\t\tvalue:     \"[\",\n\t\t\tposition:  start,\n\t\t\tlength:    1,\n\t\t}\n\t\tlexer.back()\n\t}\n\treturn t\n}\n\nfunc (lexer *Lexer) consumeQuotedIdentifier() (token, error) {\n\tstart := lexer.currentPos\n\tvalue, err := lexer.consumeUntil('\"')\n\tif err != nil {\n\t\treturn token{}, err\n\t}\n\tvar decoded string\n\tasJSON := []byte(\"\\\"\" + value + \"\\\"\")\n\tif err := json.Unmarshal([]byte(asJSON), &decoded); err != nil {\n\t\treturn token{}, err\n\t}\n\treturn token{\n\t\ttokenType: tQuotedIdentifier,\n\t\tvalue:     decoded,\n\t\tposition:  start - 1,\n\t\tlength:    len(decoded),\n\t}, nil\n}\n\nfunc (lexer *Lexer) consumeUnquotedIdentifier() token {\n\t// Consume runes until we reach the end of an unquoted\n\t// identifier.\n\tstart := lexer.currentPos - lexer.lastWidth\n\tfor {\n\t\tr := lexer.next()\n\t\tif r < 0 || r > 128 || identifierTrailingBits[uint64(r)/64]&(1<<(uint64(r)%64)) == 0 {\n\t\t\tlexer.back()\n\t\t\tbreak\n\t\t}\n\t}\n\tvalue := lexer.expression[start:lexer.currentPos]\n\treturn token{\n\t\ttokenType: tUnquotedIdentifier,\n\t\tvalue:     value,\n\t\tposition:  start,\n\t\tlength:    lexer.currentPos - start,\n\t}\n}\n\nfunc (lexer *Lexer) consumeNumber() token {\n\t// Consume runes until we reach something that's not a number.\n\tstart := lexer.currentPos - lexer.lastWidth\n\tfor {\n\t\tr := lexer.next()\n\t\tif r < '0' || r > '9' {\n\t\t\tlexer.back()\n\t\t\tbreak\n\t\t}\n\t}\n\tvalue := lexer.expression[start:lexer.currentPos]\n\treturn token{\n\t\ttokenType: tNumber,\n\t\tvalue:     value,\n\t\tposition:  start,\n\t\tlength:    lexer.currentPos - start,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/jmespath/go-jmespath/parser.go",
    "content": "package jmespath\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype astNodeType int\n\n//go:generate stringer -type astNodeType\nconst (\n\tASTEmpty astNodeType = iota\n\tASTComparator\n\tASTCurrentNode\n\tASTExpRef\n\tASTFunctionExpression\n\tASTField\n\tASTFilterProjection\n\tASTFlatten\n\tASTIdentity\n\tASTIndex\n\tASTIndexExpression\n\tASTKeyValPair\n\tASTLiteral\n\tASTMultiSelectHash\n\tASTMultiSelectList\n\tASTOrExpression\n\tASTAndExpression\n\tASTNotExpression\n\tASTPipe\n\tASTProjection\n\tASTSubexpression\n\tASTSlice\n\tASTValueProjection\n)\n\n// ASTNode represents the abstract syntax tree of a JMESPath expression.\ntype ASTNode struct {\n\tnodeType astNodeType\n\tvalue    interface{}\n\tchildren []ASTNode\n}\n\nfunc (node ASTNode) String() string {\n\treturn node.PrettyPrint(0)\n}\n\n// PrettyPrint will pretty print the parsed AST.\n// The AST is an implementation detail and this pretty print\n// function is provided as a convenience method to help with\n// debugging.  You should not rely on its output as the internal\n// structure of the AST may change at any time.\nfunc (node ASTNode) PrettyPrint(indent int) string {\n\tspaces := strings.Repeat(\" \", indent)\n\toutput := fmt.Sprintf(\"%s%s {\\n\", spaces, node.nodeType)\n\tnextIndent := indent + 2\n\tif node.value != nil {\n\t\tif converted, ok := node.value.(fmt.Stringer); ok {\n\t\t\t// Account for things like comparator nodes\n\t\t\t// that are enums with a String() method.\n\t\t\toutput += fmt.Sprintf(\"%svalue: %s\\n\", strings.Repeat(\" \", nextIndent), converted.String())\n\t\t} else {\n\t\t\toutput += fmt.Sprintf(\"%svalue: %#v\\n\", strings.Repeat(\" \", nextIndent), node.value)\n\t\t}\n\t}\n\tlastIndex := len(node.children)\n\tif lastIndex > 0 {\n\t\toutput += fmt.Sprintf(\"%schildren: {\\n\", strings.Repeat(\" \", nextIndent))\n\t\tchildIndent := nextIndent + 2\n\t\tfor _, elem := range node.children {\n\t\t\toutput += elem.PrettyPrint(childIndent)\n\t\t}\n\t}\n\toutput += fmt.Sprintf(\"%s}\\n\", spaces)\n\treturn output\n}\n\nvar bindingPowers = map[tokType]int{\n\ttEOF:                0,\n\ttUnquotedIdentifier: 0,\n\ttQuotedIdentifier:   0,\n\ttRbracket:           0,\n\ttRparen:             0,\n\ttComma:              0,\n\ttRbrace:             0,\n\ttNumber:             0,\n\ttCurrent:            0,\n\ttExpref:             0,\n\ttColon:              0,\n\ttPipe:               1,\n\ttOr:                 2,\n\ttAnd:                3,\n\ttEQ:                 5,\n\ttLT:                 5,\n\ttLTE:                5,\n\ttGT:                 5,\n\ttGTE:                5,\n\ttNE:                 5,\n\ttFlatten:            9,\n\ttStar:               20,\n\ttFilter:             21,\n\ttDot:                40,\n\ttNot:                45,\n\ttLbrace:             50,\n\ttLbracket:           55,\n\ttLparen:             60,\n}\n\n// Parser holds state about the current expression being parsed.\ntype Parser struct {\n\texpression string\n\ttokens     []token\n\tindex      int\n}\n\n// NewParser creates a new JMESPath parser.\nfunc NewParser() *Parser {\n\tp := Parser{}\n\treturn &p\n}\n\n// Parse will compile a JMESPath expression.\nfunc (p *Parser) Parse(expression string) (ASTNode, error) {\n\tlexer := NewLexer()\n\tp.expression = expression\n\tp.index = 0\n\ttokens, err := lexer.tokenize(expression)\n\tif err != nil {\n\t\treturn ASTNode{}, err\n\t}\n\tp.tokens = tokens\n\tparsed, err := p.parseExpression(0)\n\tif err != nil {\n\t\treturn ASTNode{}, err\n\t}\n\tif p.current() != tEOF {\n\t\treturn ASTNode{}, p.syntaxError(fmt.Sprintf(\n\t\t\t\"Unexpected token at the end of the expresssion: %s\", p.current()))\n\t}\n\treturn parsed, nil\n}\n\nfunc (p *Parser) parseExpression(bindingPower int) (ASTNode, error) {\n\tvar err error\n\tleftToken := p.lookaheadToken(0)\n\tp.advance()\n\tleftNode, err := p.nud(leftToken)\n\tif err != nil {\n\t\treturn ASTNode{}, err\n\t}\n\tcurrentToken := p.current()\n\tfor bindingPower < bindingPowers[currentToken] {\n\t\tp.advance()\n\t\tleftNode, err = p.led(currentToken, leftNode)\n\t\tif err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\tcurrentToken = p.current()\n\t}\n\treturn leftNode, nil\n}\n\nfunc (p *Parser) parseIndexExpression() (ASTNode, error) {\n\tif p.lookahead(0) == tColon || p.lookahead(1) == tColon {\n\t\treturn p.parseSliceExpression()\n\t}\n\tindexStr := p.lookaheadToken(0).value\n\tparsedInt, err := strconv.Atoi(indexStr)\n\tif err != nil {\n\t\treturn ASTNode{}, err\n\t}\n\tindexNode := ASTNode{nodeType: ASTIndex, value: parsedInt}\n\tp.advance()\n\tif err := p.match(tRbracket); err != nil {\n\t\treturn ASTNode{}, err\n\t}\n\treturn indexNode, nil\n}\n\nfunc (p *Parser) parseSliceExpression() (ASTNode, error) {\n\tparts := []*int{nil, nil, nil}\n\tindex := 0\n\tcurrent := p.current()\n\tfor current != tRbracket && index < 3 {\n\t\tif current == tColon {\n\t\t\tindex++\n\t\t\tp.advance()\n\t\t} else if current == tNumber {\n\t\t\tparsedInt, err := strconv.Atoi(p.lookaheadToken(0).value)\n\t\t\tif err != nil {\n\t\t\t\treturn ASTNode{}, err\n\t\t\t}\n\t\t\tparts[index] = &parsedInt\n\t\t\tp.advance()\n\t\t} else {\n\t\t\treturn ASTNode{}, p.syntaxError(\n\t\t\t\t\"Expected tColon or tNumber\" + \", received: \" + p.current().String())\n\t\t}\n\t\tcurrent = p.current()\n\t}\n\tif err := p.match(tRbracket); err != nil {\n\t\treturn ASTNode{}, err\n\t}\n\treturn ASTNode{\n\t\tnodeType: ASTSlice,\n\t\tvalue:    parts,\n\t}, nil\n}\n\nfunc (p *Parser) match(tokenType tokType) error {\n\tif p.current() == tokenType {\n\t\tp.advance()\n\t\treturn nil\n\t}\n\treturn p.syntaxError(\"Expected \" + tokenType.String() + \", received: \" + p.current().String())\n}\n\nfunc (p *Parser) led(tokenType tokType, node ASTNode) (ASTNode, error) {\n\tswitch tokenType {\n\tcase tDot:\n\t\tif p.current() != tStar {\n\t\t\tright, err := p.parseDotRHS(bindingPowers[tDot])\n\t\t\treturn ASTNode{\n\t\t\t\tnodeType: ASTSubexpression,\n\t\t\t\tchildren: []ASTNode{node, right},\n\t\t\t}, err\n\t\t}\n\t\tp.advance()\n\t\tright, err := p.parseProjectionRHS(bindingPowers[tDot])\n\t\treturn ASTNode{\n\t\t\tnodeType: ASTValueProjection,\n\t\t\tchildren: []ASTNode{node, right},\n\t\t}, err\n\tcase tPipe:\n\t\tright, err := p.parseExpression(bindingPowers[tPipe])\n\t\treturn ASTNode{nodeType: ASTPipe, children: []ASTNode{node, right}}, err\n\tcase tOr:\n\t\tright, err := p.parseExpression(bindingPowers[tOr])\n\t\treturn ASTNode{nodeType: ASTOrExpression, children: []ASTNode{node, right}}, err\n\tcase tAnd:\n\t\tright, err := p.parseExpression(bindingPowers[tAnd])\n\t\treturn ASTNode{nodeType: ASTAndExpression, children: []ASTNode{node, right}}, err\n\tcase tLparen:\n\t\tname := node.value\n\t\tvar args []ASTNode\n\t\tfor p.current() != tRparen {\n\t\t\texpression, err := p.parseExpression(0)\n\t\t\tif err != nil {\n\t\t\t\treturn ASTNode{}, err\n\t\t\t}\n\t\t\tif p.current() == tComma {\n\t\t\t\tif err := p.match(tComma); err != nil {\n\t\t\t\t\treturn ASTNode{}, err\n\t\t\t\t}\n\t\t\t}\n\t\t\targs = append(args, expression)\n\t\t}\n\t\tif err := p.match(tRparen); err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\treturn ASTNode{\n\t\t\tnodeType: ASTFunctionExpression,\n\t\t\tvalue:    name,\n\t\t\tchildren: args,\n\t\t}, nil\n\tcase tFilter:\n\t\treturn p.parseFilter(node)\n\tcase tFlatten:\n\t\tleft := ASTNode{nodeType: ASTFlatten, children: []ASTNode{node}}\n\t\tright, err := p.parseProjectionRHS(bindingPowers[tFlatten])\n\t\treturn ASTNode{\n\t\t\tnodeType: ASTProjection,\n\t\t\tchildren: []ASTNode{left, right},\n\t\t}, err\n\tcase tEQ, tNE, tGT, tGTE, tLT, tLTE:\n\t\tright, err := p.parseExpression(bindingPowers[tokenType])\n\t\tif err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\treturn ASTNode{\n\t\t\tnodeType: ASTComparator,\n\t\t\tvalue:    tokenType,\n\t\t\tchildren: []ASTNode{node, right},\n\t\t}, nil\n\tcase tLbracket:\n\t\ttokenType := p.current()\n\t\tvar right ASTNode\n\t\tvar err error\n\t\tif tokenType == tNumber || tokenType == tColon {\n\t\t\tright, err = p.parseIndexExpression()\n\t\t\tif err != nil {\n\t\t\t\treturn ASTNode{}, err\n\t\t\t}\n\t\t\treturn p.projectIfSlice(node, right)\n\t\t}\n\t\t// Otherwise this is a projection.\n\t\tif err := p.match(tStar); err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\tif err := p.match(tRbracket); err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\tright, err = p.parseProjectionRHS(bindingPowers[tStar])\n\t\tif err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\treturn ASTNode{\n\t\t\tnodeType: ASTProjection,\n\t\t\tchildren: []ASTNode{node, right},\n\t\t}, nil\n\t}\n\treturn ASTNode{}, p.syntaxError(\"Unexpected token: \" + tokenType.String())\n}\n\nfunc (p *Parser) nud(token token) (ASTNode, error) {\n\tswitch token.tokenType {\n\tcase tJSONLiteral:\n\t\tvar parsed interface{}\n\t\terr := json.Unmarshal([]byte(token.value), &parsed)\n\t\tif err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\treturn ASTNode{nodeType: ASTLiteral, value: parsed}, nil\n\tcase tStringLiteral:\n\t\treturn ASTNode{nodeType: ASTLiteral, value: token.value}, nil\n\tcase tUnquotedIdentifier:\n\t\treturn ASTNode{\n\t\t\tnodeType: ASTField,\n\t\t\tvalue:    token.value,\n\t\t}, nil\n\tcase tQuotedIdentifier:\n\t\tnode := ASTNode{nodeType: ASTField, value: token.value}\n\t\tif p.current() == tLparen {\n\t\t\treturn ASTNode{}, p.syntaxErrorToken(\"Can't have quoted identifier as function name.\", token)\n\t\t}\n\t\treturn node, nil\n\tcase tStar:\n\t\tleft := ASTNode{nodeType: ASTIdentity}\n\t\tvar right ASTNode\n\t\tvar err error\n\t\tif p.current() == tRbracket {\n\t\t\tright = ASTNode{nodeType: ASTIdentity}\n\t\t} else {\n\t\t\tright, err = p.parseProjectionRHS(bindingPowers[tStar])\n\t\t}\n\t\treturn ASTNode{nodeType: ASTValueProjection, children: []ASTNode{left, right}}, err\n\tcase tFilter:\n\t\treturn p.parseFilter(ASTNode{nodeType: ASTIdentity})\n\tcase tLbrace:\n\t\treturn p.parseMultiSelectHash()\n\tcase tFlatten:\n\t\tleft := ASTNode{\n\t\t\tnodeType: ASTFlatten,\n\t\t\tchildren: []ASTNode{{nodeType: ASTIdentity}},\n\t\t}\n\t\tright, err := p.parseProjectionRHS(bindingPowers[tFlatten])\n\t\tif err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\treturn ASTNode{nodeType: ASTProjection, children: []ASTNode{left, right}}, nil\n\tcase tLbracket:\n\t\ttokenType := p.current()\n\t\t//var right ASTNode\n\t\tif tokenType == tNumber || tokenType == tColon {\n\t\t\tright, err := p.parseIndexExpression()\n\t\t\tif err != nil {\n\t\t\t\treturn ASTNode{}, nil\n\t\t\t}\n\t\t\treturn p.projectIfSlice(ASTNode{nodeType: ASTIdentity}, right)\n\t\t} else if tokenType == tStar && p.lookahead(1) == tRbracket {\n\t\t\tp.advance()\n\t\t\tp.advance()\n\t\t\tright, err := p.parseProjectionRHS(bindingPowers[tStar])\n\t\t\tif err != nil {\n\t\t\t\treturn ASTNode{}, err\n\t\t\t}\n\t\t\treturn ASTNode{\n\t\t\t\tnodeType: ASTProjection,\n\t\t\t\tchildren: []ASTNode{{nodeType: ASTIdentity}, right},\n\t\t\t}, nil\n\t\t} else {\n\t\t\treturn p.parseMultiSelectList()\n\t\t}\n\tcase tCurrent:\n\t\treturn ASTNode{nodeType: ASTCurrentNode}, nil\n\tcase tExpref:\n\t\texpression, err := p.parseExpression(bindingPowers[tExpref])\n\t\tif err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\treturn ASTNode{nodeType: ASTExpRef, children: []ASTNode{expression}}, nil\n\tcase tNot:\n\t\texpression, err := p.parseExpression(bindingPowers[tNot])\n\t\tif err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\treturn ASTNode{nodeType: ASTNotExpression, children: []ASTNode{expression}}, nil\n\tcase tLparen:\n\t\texpression, err := p.parseExpression(0)\n\t\tif err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\tif err := p.match(tRparen); err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\treturn expression, nil\n\tcase tEOF:\n\t\treturn ASTNode{}, p.syntaxErrorToken(\"Incomplete expression\", token)\n\t}\n\n\treturn ASTNode{}, p.syntaxErrorToken(\"Invalid token: \"+token.tokenType.String(), token)\n}\n\nfunc (p *Parser) parseMultiSelectList() (ASTNode, error) {\n\tvar expressions []ASTNode\n\tfor {\n\t\texpression, err := p.parseExpression(0)\n\t\tif err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\texpressions = append(expressions, expression)\n\t\tif p.current() == tRbracket {\n\t\t\tbreak\n\t\t}\n\t\terr = p.match(tComma)\n\t\tif err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t}\n\terr := p.match(tRbracket)\n\tif err != nil {\n\t\treturn ASTNode{}, err\n\t}\n\treturn ASTNode{\n\t\tnodeType: ASTMultiSelectList,\n\t\tchildren: expressions,\n\t}, nil\n}\n\nfunc (p *Parser) parseMultiSelectHash() (ASTNode, error) {\n\tvar children []ASTNode\n\tfor {\n\t\tkeyToken := p.lookaheadToken(0)\n\t\tif err := p.match(tUnquotedIdentifier); err != nil {\n\t\t\tif err := p.match(tQuotedIdentifier); err != nil {\n\t\t\t\treturn ASTNode{}, p.syntaxError(\"Expected tQuotedIdentifier or tUnquotedIdentifier\")\n\t\t\t}\n\t\t}\n\t\tkeyName := keyToken.value\n\t\terr := p.match(tColon)\n\t\tif err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\tvalue, err := p.parseExpression(0)\n\t\tif err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\tnode := ASTNode{\n\t\t\tnodeType: ASTKeyValPair,\n\t\t\tvalue:    keyName,\n\t\t\tchildren: []ASTNode{value},\n\t\t}\n\t\tchildren = append(children, node)\n\t\tif p.current() == tComma {\n\t\t\terr := p.match(tComma)\n\t\t\tif err != nil {\n\t\t\t\treturn ASTNode{}, nil\n\t\t\t}\n\t\t} else if p.current() == tRbrace {\n\t\t\terr := p.match(tRbrace)\n\t\t\tif err != nil {\n\t\t\t\treturn ASTNode{}, nil\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\treturn ASTNode{\n\t\tnodeType: ASTMultiSelectHash,\n\t\tchildren: children,\n\t}, nil\n}\n\nfunc (p *Parser) projectIfSlice(left ASTNode, right ASTNode) (ASTNode, error) {\n\tindexExpr := ASTNode{\n\t\tnodeType: ASTIndexExpression,\n\t\tchildren: []ASTNode{left, right},\n\t}\n\tif right.nodeType == ASTSlice {\n\t\tright, err := p.parseProjectionRHS(bindingPowers[tStar])\n\t\treturn ASTNode{\n\t\t\tnodeType: ASTProjection,\n\t\t\tchildren: []ASTNode{indexExpr, right},\n\t\t}, err\n\t}\n\treturn indexExpr, nil\n}\nfunc (p *Parser) parseFilter(node ASTNode) (ASTNode, error) {\n\tvar right, condition ASTNode\n\tvar err error\n\tcondition, err = p.parseExpression(0)\n\tif err != nil {\n\t\treturn ASTNode{}, err\n\t}\n\tif err := p.match(tRbracket); err != nil {\n\t\treturn ASTNode{}, err\n\t}\n\tif p.current() == tFlatten {\n\t\tright = ASTNode{nodeType: ASTIdentity}\n\t} else {\n\t\tright, err = p.parseProjectionRHS(bindingPowers[tFilter])\n\t\tif err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t}\n\n\treturn ASTNode{\n\t\tnodeType: ASTFilterProjection,\n\t\tchildren: []ASTNode{node, right, condition},\n\t}, nil\n}\n\nfunc (p *Parser) parseDotRHS(bindingPower int) (ASTNode, error) {\n\tlookahead := p.current()\n\tif tokensOneOf([]tokType{tQuotedIdentifier, tUnquotedIdentifier, tStar}, lookahead) {\n\t\treturn p.parseExpression(bindingPower)\n\t} else if lookahead == tLbracket {\n\t\tif err := p.match(tLbracket); err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\treturn p.parseMultiSelectList()\n\t} else if lookahead == tLbrace {\n\t\tif err := p.match(tLbrace); err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\treturn p.parseMultiSelectHash()\n\t}\n\treturn ASTNode{}, p.syntaxError(\"Expected identifier, lbracket, or lbrace\")\n}\n\nfunc (p *Parser) parseProjectionRHS(bindingPower int) (ASTNode, error) {\n\tcurrent := p.current()\n\tif bindingPowers[current] < 10 {\n\t\treturn ASTNode{nodeType: ASTIdentity}, nil\n\t} else if current == tLbracket {\n\t\treturn p.parseExpression(bindingPower)\n\t} else if current == tFilter {\n\t\treturn p.parseExpression(bindingPower)\n\t} else if current == tDot {\n\t\terr := p.match(tDot)\n\t\tif err != nil {\n\t\t\treturn ASTNode{}, err\n\t\t}\n\t\treturn p.parseDotRHS(bindingPower)\n\t} else {\n\t\treturn ASTNode{}, p.syntaxError(\"Error\")\n\t}\n}\n\nfunc (p *Parser) lookahead(number int) tokType {\n\treturn p.lookaheadToken(number).tokenType\n}\n\nfunc (p *Parser) current() tokType {\n\treturn p.lookahead(0)\n}\n\nfunc (p *Parser) lookaheadToken(number int) token {\n\treturn p.tokens[p.index+number]\n}\n\nfunc (p *Parser) advance() {\n\tp.index++\n}\n\nfunc tokensOneOf(elements []tokType, token tokType) bool {\n\tfor _, elem := range elements {\n\t\tif elem == token {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (p *Parser) syntaxError(msg string) SyntaxError {\n\treturn SyntaxError{\n\t\tmsg:        msg,\n\t\tExpression: p.expression,\n\t\tOffset:     p.lookaheadToken(0).position,\n\t}\n}\n\n// Create a SyntaxError based on the provided token.\n// This differs from syntaxError() which creates a SyntaxError\n// based on the current lookahead token.\nfunc (p *Parser) syntaxErrorToken(msg string, t token) SyntaxError {\n\treturn SyntaxError{\n\t\tmsg:        msg,\n\t\tExpression: p.expression,\n\t\tOffset:     t.position,\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/jmespath/go-jmespath/toktype_string.go",
    "content": "// generated by stringer -type=tokType; DO NOT EDIT\n\npackage jmespath\n\nimport \"fmt\"\n\nconst _tokType_name = \"tUnknowntStartDottFiltertFlattentLparentRparentLbrackettRbrackettLbracetRbracetOrtPipetNumbertUnquotedIdentifiertQuotedIdentifiertCommatColontLTtLTEtGTtGTEtEQtNEtJSONLiteraltStringLiteraltCurrenttExpreftAndtNottEOF\"\n\nvar _tokType_index = [...]uint8{0, 8, 13, 17, 24, 32, 39, 46, 55, 64, 71, 78, 81, 86, 93, 112, 129, 135, 141, 144, 148, 151, 155, 158, 161, 173, 187, 195, 202, 206, 210, 214}\n\nfunc (i tokType) String() string {\n\tif i < 0 || i >= tokType(len(_tokType_index)-1) {\n\t\treturn fmt.Sprintf(\"tokType(%d)\", i)\n\t}\n\treturn _tokType_name[_tokType_index[i]:_tokType_index[i+1]]\n}\n"
  },
  {
    "path": "vendor/github.com/jmespath/go-jmespath/util.go",
    "content": "package jmespath\n\nimport (\n\t\"errors\"\n\t\"reflect\"\n)\n\n// IsFalse determines if an object is false based on the JMESPath spec.\n// JMESPath defines false values to be any of:\n// - An empty string array, or hash.\n// - The boolean value false.\n// - nil\nfunc isFalse(value interface{}) bool {\n\tswitch v := value.(type) {\n\tcase bool:\n\t\treturn !v\n\tcase []interface{}:\n\t\treturn len(v) == 0\n\tcase map[string]interface{}:\n\t\treturn len(v) == 0\n\tcase string:\n\t\treturn len(v) == 0\n\tcase nil:\n\t\treturn true\n\t}\n\t// Try the reflection cases before returning false.\n\trv := reflect.ValueOf(value)\n\tswitch rv.Kind() {\n\tcase reflect.Struct:\n\t\t// A struct type will never be false, even if\n\t\t// all of its values are the zero type.\n\t\treturn false\n\tcase reflect.Slice, reflect.Map:\n\t\treturn rv.Len() == 0\n\tcase reflect.Ptr:\n\t\tif rv.IsNil() {\n\t\t\treturn true\n\t\t}\n\t\t// If it's a pointer type, we'll try to deref the pointer\n\t\t// and evaluate the pointer value for isFalse.\n\t\telement := rv.Elem()\n\t\treturn isFalse(element.Interface())\n\t}\n\treturn false\n}\n\n// ObjsEqual is a generic object equality check.\n// It will take two arbitrary objects and recursively determine\n// if they are equal.\nfunc objsEqual(left interface{}, right interface{}) bool {\n\treturn reflect.DeepEqual(left, right)\n}\n\n// SliceParam refers to a single part of a slice.\n// A slice consists of a start, a stop, and a step, similar to\n// python slices.\ntype sliceParam struct {\n\tN         int\n\tSpecified bool\n}\n\n// Slice supports [start:stop:step] style slicing that's supported in JMESPath.\nfunc slice(slice []interface{}, parts []sliceParam) ([]interface{}, error) {\n\tcomputed, err := computeSliceParams(len(slice), parts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstart, stop, step := computed[0], computed[1], computed[2]\n\tresult := []interface{}{}\n\tif step > 0 {\n\t\tfor i := start; i < stop; i += step {\n\t\t\tresult = append(result, slice[i])\n\t\t}\n\t} else {\n\t\tfor i := start; i > stop; i += step {\n\t\t\tresult = append(result, slice[i])\n\t\t}\n\t}\n\treturn result, nil\n}\n\nfunc computeSliceParams(length int, parts []sliceParam) ([]int, error) {\n\tvar start, stop, step int\n\tif !parts[2].Specified {\n\t\tstep = 1\n\t} else if parts[2].N == 0 {\n\t\treturn nil, errors.New(\"Invalid slice, step cannot be 0\")\n\t} else {\n\t\tstep = parts[2].N\n\t}\n\tvar stepValueNegative bool\n\tif step < 0 {\n\t\tstepValueNegative = true\n\t} else {\n\t\tstepValueNegative = false\n\t}\n\n\tif !parts[0].Specified {\n\t\tif stepValueNegative {\n\t\t\tstart = length - 1\n\t\t} else {\n\t\t\tstart = 0\n\t\t}\n\t} else {\n\t\tstart = capSlice(length, parts[0].N, step)\n\t}\n\n\tif !parts[1].Specified {\n\t\tif stepValueNegative {\n\t\t\tstop = -1\n\t\t} else {\n\t\t\tstop = length\n\t\t}\n\t} else {\n\t\tstop = capSlice(length, parts[1].N, step)\n\t}\n\treturn []int{start, stop, step}, nil\n}\n\nfunc capSlice(length int, actual int, step int) int {\n\tif actual < 0 {\n\t\tactual += length\n\t\tif actual < 0 {\n\t\t\tif step < 0 {\n\t\t\t\tactual = -1\n\t\t\t} else {\n\t\t\t\tactual = 0\n\t\t\t}\n\t\t}\n\t} else if actual >= length {\n\t\tif step < 0 {\n\t\t\tactual = length - 1\n\t\t} else {\n\t\t\tactual = length\n\t\t}\n\t}\n\treturn actual\n}\n\n// ToArrayNum converts an empty interface type to a slice of float64.\n// If any element in the array cannot be converted, then nil is returned\n// along with a second value of false.\nfunc toArrayNum(data interface{}) ([]float64, bool) {\n\t// Is there a better way to do this with reflect?\n\tif d, ok := data.([]interface{}); ok {\n\t\tresult := make([]float64, len(d))\n\t\tfor i, el := range d {\n\t\t\titem, ok := el.(float64)\n\t\t\tif !ok {\n\t\t\t\treturn nil, false\n\t\t\t}\n\t\t\tresult[i] = item\n\t\t}\n\t\treturn result, true\n\t}\n\treturn nil, false\n}\n\n// ToArrayStr converts an empty interface type to a slice of strings.\n// If any element in the array cannot be converted, then nil is returned\n// along with a second value of false.  If the input data could be entirely\n// converted, then the converted data, along with a second value of true,\n// will be returned.\nfunc toArrayStr(data interface{}) ([]string, bool) {\n\t// Is there a better way to do this with reflect?\n\tif d, ok := data.([]interface{}); ok {\n\t\tresult := make([]string, len(d))\n\t\tfor i, el := range d {\n\t\t\titem, ok := el.(string)\n\t\t\tif !ok {\n\t\t\t\treturn nil, false\n\t\t\t}\n\t\t\tresult[i] = item\n\t\t}\n\t\treturn result, true\n\t}\n\treturn nil, false\n}\n\nfunc isSliceType(v interface{}) bool {\n\tif v == nil {\n\t\treturn false\n\t}\n\treturn reflect.TypeOf(v).Kind() == reflect.Slice\n}\n"
  },
  {
    "path": "vendor/vendor.json",
    "content": "{\n\t\"comment\": \"\",\n\t\"ignore\": \"test\",\n\t\"package\": [\n\t\t{\n\t\t\t\"checksumSHA1\": \"Ex4zN+CcY/wtoDoK/penrVAxAok=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"Y9W+4GimK4Fuxq+vyIskVYFRnX4=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws/awserr\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"+q4vdl3l1Wom8K1wfIpJ4jlFsbY=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws/awsutil\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"H/tMKHZU+Qka6RtYiGB50s2uA0s=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws/client\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"ieAJ+Cvp/PKv1LpUEnUXpc3OI6E=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws/client/metadata\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"gNWirlrTfSLbOe421hISBAhTqa4=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws/corehandlers\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"dNZNaOPfBPnzE2CBnfhXXZ9g9jU=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws/credentials\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"KQiUK/zr3mqnAXD7x/X55/iNme0=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"NUJUTWlc1sV8b7WjfiYc4JZbXl0=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws/credentials/endpointcreds\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"4Ipx+5xN0gso+cENC2MHMWmQlR4=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws/credentials/stscreds\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"nCMd1XKjgV21bEl7J8VZFqTV8PE=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws/defaults\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"U0SthWum+t9ACanK7SDJOg3dO6M=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws/ec2metadata\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"NyUg1P8ZS/LHAAQAk/4C5O4X3og=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws/request\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"44uohX3kLsfZHHOqunr+qJnSCdw=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws/session\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"7lla+sckQeF18wORAGuU2fFMlp4=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/aws/signer/v4\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"Bm6UrYb2QCzpYseLwwgw6aetgRc=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/private/endpoints\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"wk7EyvDaHwb5qqoOP/4d3cV0708=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/private/protocol\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"pNeF0Ey7TfBArH5LBQhKOQXQbLY=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/private/protocol/json/jsonutil\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"H9TymcQkQnXSXSVfjggiiS4bpzM=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/private/protocol/jsonrpc\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"isoix7lTx4qIq2zI2xFADtti5SI=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/private/protocol/query\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"5xzix1R8prUyWxgLnzUQoxTsfik=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/private/protocol/query/queryutil\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"TW/7U+/8ormL7acf6z2rv2hDD+s=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/private/protocol/rest\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"eUEkjyMPAuekKBE4ou+nM9tXEas=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"sP/qEaDICVBV3rRw2sl759YI0iw=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/service/cloudwatchlogs\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"nH/itbdeFHpl4ysegdtgww9bFSA=\",\n\t\t\t\"path\": \"github.com/aws/aws-sdk-go/service/sts\",\n\t\t\t\"revision\": \"d54f7c6d021d8fca3275e29d13255ededdc54839\",\n\t\t\t\"revisionTime\": \"2016-09-15T23:18:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"8C6hbcW3iPuwRfWoOWFtg4ca5sk=\",\n\t\t\t\"path\": \"github.com/coreos/go-systemd/sdjournal\",\n\t\t\t\"revision\": \"2f344660b11f7285b0af86195c4456e92970f640\",\n\t\t\t\"revisionTime\": \"2016-09-07T12:16:35Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"O8c/VKtW34XPJNNlyeb/im8vWSI=\",\n\t\t\t\"path\": \"github.com/coreos/pkg/dlopen\",\n\t\t\t\"revision\": \"3ac0863d7acf3bc44daf49afef8919af12f704ef\",\n\t\t\t\"revisionTime\": \"2016-07-27T23:37:14Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"cVyhKIRI2gQrgpn5qrBeAqErmWM=\",\n\t\t\t\"origin\": \"github.com/aws/aws-sdk-go/vendor/github.com/go-ini/ini\",\n\t\t\t\"path\": \"github.com/go-ini/ini\",\n\t\t\t\"revision\": \"6e4869b434bd001f6983749881c7ead3545887d8\",\n\t\t\t\"revisionTime\": \"2016-08-27T06:11:18Z\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"github.com/hashicorp/hcl\",\n\t\t\t\"revision\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"67DfevLBglV52Y2eAuhFc/xQni0=\",\n\t\t\t\"path\": \"github.com/hashicorp/hcl/hcl/ast\",\n\t\t\t\"revision\": \"99df0eb941dd8ddbc83d3f3605a34f6a686ac85e\",\n\t\t\t\"revisionTime\": \"2016-09-02T16:52:19Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"lgR7PSAZ0RtvAc9OCtCnNsF/x8g=\",\n\t\t\t\"path\": \"github.com/hashicorp/hcl/hcl/scanner\",\n\t\t\t\"revision\": \"99df0eb941dd8ddbc83d3f3605a34f6a686ac85e\",\n\t\t\t\"revisionTime\": \"2016-09-02T16:52:19Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"JlZmnzqdmFFyb1+2afLyR3BOE/8=\",\n\t\t\t\"path\": \"github.com/hashicorp/hcl/hcl/strconv\",\n\t\t\t\"revision\": \"99df0eb941dd8ddbc83d3f3605a34f6a686ac85e\",\n\t\t\t\"revisionTime\": \"2016-09-02T16:52:19Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"jQ45CCc1ed/nlV7bbSnx6z72q1M=\",\n\t\t\t\"path\": \"github.com/hashicorp/hcl/json/parser\",\n\t\t\t\"revision\": \"99df0eb941dd8ddbc83d3f3605a34f6a686ac85e\",\n\t\t\t\"revisionTime\": \"2016-09-02T16:52:19Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"YdvFsNOMSWMLnY6fcliWQa0O5Fw=\",\n\t\t\t\"path\": \"github.com/hashicorp/hcl/json/scanner\",\n\t\t\t\"revision\": \"99df0eb941dd8ddbc83d3f3605a34f6a686ac85e\",\n\t\t\t\"revisionTime\": \"2016-09-02T16:52:19Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"fNlXQCQEnb+B3k5UDL/r15xtSJY=\",\n\t\t\t\"path\": \"github.com/hashicorp/hcl/json/token\",\n\t\t\t\"revision\": \"99df0eb941dd8ddbc83d3f3605a34f6a686ac85e\",\n\t\t\t\"revisionTime\": \"2016-09-02T16:52:19Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"0ZrwvB6KoGPj2PoDNSEJwxQ6Mog=\",\n\t\t\t\"origin\": \"github.com/aws/aws-sdk-go/vendor/github.com/jmespath/go-jmespath\",\n\t\t\t\"path\": \"github.com/jmespath/go-jmespath\",\n\t\t\t\"revision\": \"bd40a432e4c76585ef6b72d3fd96fb9b6dc7b68d\",\n\t\t\t\"revisionTime\": \"2016-08-03T19:07:31Z\"\n\t\t}\n\t],\n\t\"rootPath\": \"github.com/saymedia/journald-cloudwatch-logs\"\n}\n"
  },
  {
    "path": "writer.go",
    "content": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\tawsSession \"github.com/aws/aws-sdk-go/aws/session\"\n\t\"github.com/aws/aws-sdk-go/service/cloudwatchlogs\"\n)\n\ntype Writer struct {\n\tconn              *cloudwatchlogs.CloudWatchLogs\n\tlogGroupName      string\n\tlogStreamName     string\n\tnextSequenceToken string\n}\n\nfunc NewWriter(sess *awsSession.Session, logGroupName, logStreamName, firstSeqToken string) (*Writer, error) {\n\tconn := cloudwatchlogs.New(sess)\n\n\treturn &Writer{\n\t\tconn:              conn,\n\t\tlogGroupName:      logGroupName,\n\t\tlogStreamName:     logStreamName,\n\t\tnextSequenceToken: firstSeqToken,\n\t}, nil\n}\n\nfunc (w *Writer) WriteBatch(records []Record) (string, error) {\n\n\tevents := make([]*cloudwatchlogs.InputLogEvent, 0, len(records))\n\tfor _, record := range records {\n\t\tjsonDataBytes, err := json.MarshalIndent(record, \"\", \"  \")\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tjsonData := string(jsonDataBytes)\n\n\t\tevents = append(events, &cloudwatchlogs.InputLogEvent{\n\t\t\tMessage:   aws.String(jsonData),\n\t\t\tTimestamp: aws.Int64(int64(record.TimeUsec)),\n\t\t})\n\t}\n\n\tputEvents := func() error {\n\t\trequest := &cloudwatchlogs.PutLogEventsInput{\n\t\t\tLogEvents:     events,\n\t\t\tLogGroupName:  &w.logGroupName,\n\t\t\tLogStreamName: &w.logStreamName,\n\t\t}\n\t\tif w.nextSequenceToken != \"\" {\n\t\t\trequest.SequenceToken = aws.String(w.nextSequenceToken)\n\t\t}\n\t\tresult, err := w.conn.PutLogEvents(request)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tw.nextSequenceToken = *result.NextSequenceToken\n\t\treturn nil\n\t}\n\n\tcreateStream := func() error {\n\t\trequest := &cloudwatchlogs.CreateLogStreamInput{\n\t\t\tLogGroupName:  &w.logGroupName,\n\t\t\tLogStreamName: &w.logStreamName,\n\t\t}\n\t\t_, err := w.conn.CreateLogStream(request)\n\t\treturn err\n\t}\n\n\terr := putEvents()\n\tif err != nil {\n\t\tif awsErr, ok := err.(awserr.Error); ok {\n\t\t\tif awsErr.Code() == \"ResourceNotFoundException\" {\n\t\t\t\t// Maybe our log stream doesn't exist yet. We'll try\n\t\t\t\t// to create it and then, if we're successful, try\n\t\t\t\t// writing the events again.\n\t\t\t\terr := createStream()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", fmt.Errorf(\"failed to create stream: %s\", err)\n\t\t\t\t}\n\n\t\t\t\terr = putEvents()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", fmt.Errorf(\"failed to put events: %s\", err)\n\t\t\t\t}\n\t\t\t\treturn w.nextSequenceToken, nil\n\t\t\t}\n\t\t\tif awsErr.Code() == \"DataAlreadyAcceptedException\" {\n\t\t\t\t// This batch was already sent\n\t\t\t\treturn \"\", nil\n\t\t\t}\n\t\t\tif awsErr.Code() == \"InvalidSequenceTokenException\" {\n\t\t\t\trequest := &cloudwatchlogs.DescribeLogStreamsInput{\n\t\t\t\t\tLogGroupName:        &w.logGroupName,\n\t\t\t\t\tLogStreamNamePrefix: &w.logStreamName,\n\t\t\t\t\tDescending:          aws.Bool(true),\n\t\t\t\t\tLimit:               aws.Int64(1),\n\t\t\t\t}\n\t\t\t\tresult, err := w.conn.DescribeLogStreams(request)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", fmt.Errorf(\"failed to get next sequence token: %s\", err)\n\t\t\t\t}\n\n\t\t\t\tw.nextSequenceToken = *(result.LogStreams[0].UploadSequenceToken)\n\n\t\t\t\terr = putEvents()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", fmt.Errorf(\"failed to put events: %s\", err)\n\t\t\t\t}\n\t\t\t\treturn w.nextSequenceToken, nil\n\t\t\t}\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"failed to put events: %s\", err)\n\t}\n\n\treturn w.nextSequenceToken, nil\n}\n"
  }
]