avengers
export GOPATH=$(pwd)
export PATH="$(pwd)/bin:$PATH"
export GOBIN="$(pwd)/bin"
go get github.com/axw/gocov/gocov
go install github.com/axw/gocov/gocov
go get -u github.com/mchirico/date/parse
go get gopkg.in/yaml.v2
go get github.com/spf13/cobra
go get github.com/mitchellh/go-homedir
go get github.com/spf13/viper
cobra init --pkg-name github.com/mchirico/avengers
Testing
Install Ginkgo
go get github.com/onsi/ginkgo/ginkgo
go get github.com/onsi/gomega/...
cd utils
ginkgo bootstrap
ginkgo generate utils
Common vscode commands
F2 refactor by renaming
F12 jump to definition
ctl-click-click to see options
sft-opt-f reformat code
# Go specific changes
cmd-, (commmand-comma)
TODO
Avengers is a playground for go
AWS
- Add SQS capability with mocks
- Add DynamodDB with mocks
Adding Shell commands
cobra add myshell
cobra add server
Next update the following...
var myshellCmd = &cobra.Command{
Use: "myshell",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("myshell called")
},
}
To
import (
"github.com/mchirico/avengers/shell/simple"
)
var myshellCmd = &cobra.Command{
Use: "myshell",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Run: simpleshell.CreateSubShell,
}
Test Coverage
cmd-shft-p
Reference:
https://github.com/mchirico/avengers/issues/2
Step 1:
Setup ...
cd terraform/examples/setups/ec2-simple
Step 2:
terraform init
terraform validate
terraform apply
Step 3:
Connect.. you should see something similiar to the following:
ssh -i ~/.ssh/m1Virginia.pem ubuntu@ec2-54-242-207-151.compute-1.amazonaws.com
NOTE:
If you want a working spot instance with S3, see
terraform/setups/ec2-spot
References
cmd-shft-P goto symble
vscode video
Neptune
https://aws.amazon.com/blogs/database/analyze-amazon-neptune-graphs-using-amazon-sagemaker-jupyter-notebooks/