This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ctx := context.Background() | |
| assumecnf, _ := config.LoadDefaultConfig( | |
| ctx, config.WithRegion("{aws-region}"), | |
| config.WithCredentialsProvider(aws.NewCredentialsCache( | |
| credentials.NewStaticCredentialsProvider( | |
| "{aws-assume-role-key}", | |
| "{aws-assume-role-secret}", "", | |
| )), | |
| ), | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rootCmd = &cobra.Command{ | |
| Use: "manualrun", | |
| Short: "trigger a manual run", | |
| Long: func() string { | |
| var b bytes.Buffer | |
| wb := bufio.NewWriter(&b) | |
| h := tabwriter.NewWriter(wb, 0, 10, 5, ' ', 0) | |
| fmt.Fprintf(h, "Trigger a manual run, among other tools.\n\n") | |
| fmt.Fprintf(h, "Format for the --input flag:\n") | |
| fmt.Fprintf(h, " payer:<id>[/link1,link2,...]\trun manual calculation at payer level, optional acct list is for log filtering\n") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| goflag "flag" | |
| "github.com/spf13/cobra" | |
| flag "github.com/spf13/pflag" | |
| "k8s.io/klog" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| goflag "flag" | |
| "github.com/golang/glog" | |
| "github.com/spf13/cobra" | |
| flag "github.com/spf13/pflag" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ( | |
| ... | |
| "golang.org/x/oauth2" | |
| "golang.org/x/oauth2/google" | |
| compute "google.golang.org/api/compute/v1" | |
| deploymentmgr "google.golang.org/api/deploymentmanager/v2" | |
| ) | |
| func main() { | |
| // Error checks are discarded for brevity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| goflag "flag" | |
| "github.com/golang/glog" | |
| "github.com/spf13/cobra" | |
| flag "github.com/spf13/pflag" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version='1.0' encoding='utf-8'?> | |
| <providers> | |
| <provider level="5" ID="a3693192-9ed6-46d2-a981-f8226c8363bd" > | |
| <keyword ID="0xF"/> | |
| </provider> | |
| </providers> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM golang:1.8.3-nanoserver | |
| ADD . /go/src/demoapp | |
| WORKDIR /go/src/demoapp | |
| RUN go build -v | |
| ENTRYPOINT ["/go/src/demoapp/demoapp"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "log" | |
| "time" | |
| ) | |
| func main() { | |
| log.SetFlags(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Pad int = 2 | |
| func Indent(count int) string { | |
| pad := "" | |
| for i := 0; i < count; i++ { | |
| pad += " " | |
| } | |
| return pad | |
| } |
NewerOlder