LAMBDA

package
v1.0.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AwsxLambdaConfigCmd = &cobra.Command{
	Use:   "getLambdaConfig",
	Short: "getLambdaConfig command gets lambda configuration",
	Long:  `getLambdaConfig command gets lambda configuration`,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("executing getLambdaConfig 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 {
			functionName, _ := cmd.Flags().GetString("functionName")
			if functionName == "" {
				log.Printf("lambda function name missing")
				err := cmd.Help()
				if err != nil {
					return
				}
				return
			}

			instances, err := GetLambdaFunctionByFunctionName(functionName, clientAuth, nil)
			if err != nil {
				log.Println("error getting getLambdaConfig by function name: ", err)
				return
			}
			fmt.Println(instances)

		}
	},
}
View Source
var AwsxLambdaListCmd = &cobra.Command{
	Use:   "getLambdaList",
	Short: "getLambdaList command gets list of lambda functions of an aws account",
	Long:  `getLambdaList command gets list of lambda functions of an aws account`,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("executing getLambdaList 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 {
			resp, err := ListLambdaInstances(clientAuth, nil)
			if err != nil {
				log.Println("error getting getLambdaList: ", err)
				return
			}
			fmt.Println(resp)
		}
	},
}

Functions

func GetLambdaFunctionByFunctionName

func GetLambdaFunctionByFunctionName(functionName string, clientAuth *model.Auth, client *lambda.Lambda) (*lambda.GetFunctionOutput, error)

func ListLambdaInstances

func ListLambdaInstances(clientAuth *model.Auth, client *lambda.Lambda) (*lambda.ListFunctionsOutput, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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