DYNAMODB

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AwsxDynamoDbListCmd = &cobra.Command{
	Use:   "getDynamoDbList",
	Short: "getDynamoDbList command gets list of dynamo-db instances of an aws account",
	Long:  `getDynamoDbList command gets list of dynamo-db instances of an aws account`,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("executing getDynamoDbList command")
		var authFlag, clientAuth, err = authenticate.AuthenticateCommand(cmd)
		if err != nil {
			log.Printf("error during authentication: %v\n", err)
			err := cmd.Help()
			if err != nil {
				return
			}
			return
		}
		if authFlag {
			instances, err := ListDynamoDbInstance(clientAuth, nil)
			if err != nil {
				log.Println("error getting getDynamoDbList: ", err)
				return
			}
			fmt.Println(instances)
		}

	},
}
View Source
var AwsxDynamodDbConfigCmd = &cobra.Command{
	Use:   "getDynamoDbConfig",
	Short: "getDynamoDbConfig command gets dynamo-db configuration",
	Long:  `getDynamoDbConfig command gets dynamo-db configuration`,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("executing getDynamoDbConfig command")
		var authFlag, clientAuth, err = authenticate.AuthenticateCommand(cmd)
		if err != nil {
			log.Printf("error during authentication: %v\n", err)
			err := cmd.Help()
			if err != nil {
				return
			}
			return
		}
		if authFlag {
			tableName, _ := cmd.Flags().GetString("tableName")
			if tableName == "" {
				log.Printf("dynamo-db table name missing")
				err := cmd.Help()
				if err != nil {
					return
				}
				return
			}
			instances, err := GetDynamoDbInstanceByTableName(tableName, clientAuth, nil)
			if err != nil {
				log.Println("error getting getDynamoDbConfig by table name: ", err)
				return
			}
			fmt.Println(instances)
		}
	},
}

Functions

func GetDynamoDbInstanceByTableName

func GetDynamoDbInstanceByTableName(tableName string, clientAuth *model.Auth, client *dynamodb.DynamoDB) (*dynamodb.DescribeTableOutput, error)

func ListDynamoDbInstanceNames

func ListDynamoDbInstanceNames(clientAuth *model.Auth, client *dynamodb.DynamoDB) (*dynamodb.ListTablesOutput, error)

Types

type DynamoDb

type DynamoDb struct {
	Table interface{} `json:"table"`
	Tags  interface{} `json:"tags"`
}

func ListDynamoDbInstance

func ListDynamoDbInstance(clientAuth *model.Auth, client *dynamodb.DynamoDB) ([]DynamoDb, error)

Jump to

Keyboard shortcuts

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