avengers

command module
v0.0.0-...-8c01174 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

Go

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

Terraform

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/

Documentation

Overview

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL