find

package
v0.0.0-...-9fed269 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright © 2024 Manan Patel - github.com/immnan

Copyright © 2024 Manan Patel - github.com/immnan

Copyright © 2024 Manan Patel - github.com/immnan

Copyright © 2024 Manan Patel - github.com/immnan

Copyright © 2024 Manan Patel - github.com/immnan

Copyright © 2024 Manan Patel - github.com/immnan

Copyright © 2024 Manan Patel - github.com/immnan

Copyright © 2024 Manan Patel - github.com/immnan

Copyright © 2024 Manan Patel - github.com/immnan

Copyright © 2024 Manan Patel - github.com/immnan

Index

Constants

This section is empty.

Variables

View Source
var FindCmd = &cobra.Command{
	Use:   "find",
	Short: "Use find command to free-search resources in Blazemeters",
	Long: `Use get command to Find details about the resources within Blazemeter account. Use --help throughout subcommands to get an idea of how these commands are structured. Navigate to help.blazemeter.com for detailed info about these resources. 
	
	For defaults: Make sure you have a file named bmConfig.yaml specifying the defaults.
	The file can be in the current working DIR or in $HOME
	
	Also, use this command to get information about a workspace, team or an account. The command lists number of users, plan details, owners, status, etc. 
	
	For example: [bmgo find -a <account_id>] OR 
	             [bmgo find -w <workspace_id>] OR
				 [bmgo find -t <team_uuid>]
	For default: [bmgo find --ac] OR 
	             [bmgo find --ws] OR
				 [bmgo find --tm]`,
	Run: func(cmd *cobra.Command, args []string) {
		ac, _ := cmd.Flags().GetBool("ac")
		ws, _ := cmd.Flags().GetBool("ws")
		tm, _ := cmd.Flags().GetBool("tm")

		testId, _ := cmd.Flags().GetInt("tid")
		var accountId, workspaceId int
		var teamId string
		if ac {
			accountId = defaultAccount()
		} else {
			accountId, _ = cmd.Flags().GetInt("accountid")
		}
		if ws {
			workspaceId = defaultWorkspace()
		} else {
			workspaceId, _ = cmd.Flags().GetInt("workspaceid")
		}
		if tm {
			teamId = defaultTeam()
		} else {
			teamId, _ = cmd.Flags().GetString("teamid")
		}
		rawOutput, _ := cmd.Flags().GetBool("raw")
		switch {
		case (workspaceId != 0) && (accountId == 0) && teamId == "":
			getWorkspace(workspaceId, rawOutput)
		case (accountId != 0) && (workspaceId == 0) && teamId == "":
			getAccountId(accountId, rawOutput)
		case (accountId == 0) && (workspaceId == 0) && teamId != "":
			getTeamInfo(teamId, rawOutput)
		case testId != 0:
			findTest(testId, rawOutput)
			findTestFiles(testId, rawOutput)
		default:
			cmd.Help()
		}
	},
}

findCmd represents the find command

Functions

func GetPersonalAccessToken

func GetPersonalAccessToken() string

func Getapikeys

func Getapikeys() (string, string)

Types

type DataFile

type DataFile struct {
	LastModified int64  `json:"lastModified"`
	Name         string `json:"name"`
	Size         int    `json:"size"`
	Link         string `json:"link"`
	LinkExpire   int64  `json:"linkExpire"`
}

type FindTestsResponse

type FindTestsResponse struct {
	Result findTestsResult `json:"result"`
	Error  errorResult     `json:"error"`
}

type ListTestsResponse

type ListTestsResponse struct {
	Result []listTestsResult `json:"result"`
	Error  errorResult       `json:"error"`
}

type ProjectResponse

type ProjectResponse struct {
	Result projectResult `json:"result"`
	Error  errorResult   `json:"error"`
}

type Response

type Response struct {
	ApiVersion int         `json:"api_version"`
	Error      errorResult `json:"error"`
	Result     []DataFile  `json:"result"`
	RequestId  string      `json:"request_id"`
}

Jump to

Keyboard shortcuts

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