cmd

package
v0.0.0-...-0281767 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright © 2021 Jose Ramon Mañes jr.mb47@gmail.com

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.

Copyright © 2021 Jose Ramon Mañes jr.mb47@gmail.com

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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSonarResponse

func CheckSonarResponse(resp *http.Response, err error) error

CheckSonarResponse verify if the response of SQ after generate the token

func CommandExists

func CommandExists(cmd string) bool

CommandExists verify if a command exists in path

func ConfigureSystem

func ConfigureSystem()

ConfigureSystem set the needed path to the sysctl https: //docs.sonarqube.org/latest/requirements/requirements/

func CreateFileInPath

func CreateFileInPath(configHome, configPath string) error

CreateFileInPath Create a file in a path

func CreateFileWithContent

func CreateFileWithContent(path, content string) string

CreateFileWithContent generates the docker file in the path specified

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetTokenInFile

func GetTokenInFile(tokenName string) (string, error)

GetTokenInFile check the content inside the file and return it

func LinuxConfigSystem

func LinuxConfigSystem(debug bool) error

LinuxConfigSystem Configure system to execute SonarQube in Linux

func LinuxPkg

func LinuxPkg(debug bool)

LinuxPkg Install needed SonarQube packages for Linux environments

func MacOSPkg

func MacOSPkg(debug bool)

MacOSPkg Install needed SonarQube packages for MacOS environments

func SonarScanner

func SonarScanner(p, token string) error

SonarScanner executes the scanner of code

func StartSonar

func StartSonar(cmd *cobra.Command)

StartSonar initialize all the subcommands and detect the arguments

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

Command struct which contains an info message, command to execute and an array of arguments

type Commands

type Commands []Command

Commands list of commands

type TokenResponse

type TokenResponse struct {
	// Login kind of login
	Login string `json:"login"`
	// Name of the token
	Name string `json:"name"`
	// Token value of the token
	Token string `json:"token"`
	// CreatedAt timestamp about the creation
	CreatedAt string `json:"createdAt"`
}

TokenResponse is the struct that we use for our Sonar responses

Jump to

Keyboard shortcuts

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