common

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package common contains all shared structs(data structures) required for all connectors

Index

Constants

This section is empty.

Variables

View Source
var MAIN_DEFECT_TYPES map[string]MAIN_DEFECT_TYPE = map[string]MAIN_DEFECT_TYPE{
	"AUTOMATION_BUG": AUTOMATION_BUG,
	"SYSTEM_BUG":     SYSTEM_BUG,
	"PRODUCT_BUG":    PRODUCT_BUG,
	"NO_DEFECT":      NO_DEFECT,
}
View Source
var PREDICTED_SUB_TYPES map[string]PREDICTED_SUB_TYPE = map[string]PREDICTED_SUB_TYPE{
	"PREDICTED_AUTOMATION_BUG": PREDICTED_AUTOMATION_BUG,
	"PREDICTED_SYSTEM_BUG":     PREDICTED_SYSTEM_BUG,
	"PREDICTED_PRODUCT_BUG":    PREDICTED_PRODUCT_BUG,
	"PREDICTED_NO_DEFECT":      PREDICTED_NO_DEFECT,
}
View Source
var TFA_DEFECT_TYPE map[string]MAIN_DEFECT_TYPE = map[string]MAIN_DEFECT_TYPE{
	"Automation Bug": AUTOMATION_BUG,
	"Product Bug":    PRODUCT_BUG,
	"System Issue":   SYSTEM_BUG,
	"No Defect":      NO_DEFECT,
}
View Source
var TFA_DEFECT_TYPE_TO_SUB_TYPE map[string]PREDICTED_SUB_TYPE = map[string]PREDICTED_SUB_TYPE{
	"Automation Bug": PREDICTED_AUTOMATION_BUG,
	"Product Bug":    PREDICTED_PRODUCT_BUG,
	"System Issue":   PREDICTED_SYSTEM_BUG,
	"No Defect":      PREDICTED_NO_DEFECT,
}

Functions

func FileExist added in v1.0.3

func FileExist(str string) bool

FileExist is a helper function that tell if a file exites.

func HandleError

func HandleError(err error, method string)

HandleError is the Error handler for the whole tfacon.

func PrintGreen

func PrintGreen(str string)

PrintGreen is a helper function that prints str in green to terminal.

func PrintHeader

func PrintHeader(version string)

PrintHeader is a helper function for the whole program to print header information.

func PrintRed

func PrintRed(str string)

PrintRed is a helper function that prints str in red to terminal.

func SendHTTPRequest

func SendHTTPRequest(ctx context.Context, method, url,
	auth_token string, body io.Reader, client *http.Client) ([]byte, bool, error)

SendHTTPRequest is a helper function that deals with all http operation for tfacon.

Types

type GeneralUpdatedList

type GeneralUpdatedList interface {
	GetSelf() GeneralUpdatedList
}

GeneralUpdatedList is an updated list of object, with the prediction from TFA classifier each connector should have it's own UpdatedList structure and implement the GeneralUpdatedList interface.

type MAIN_DEFECT_TYPE added in v1.1.4

type MAIN_DEFECT_TYPE map[string]string
var AUTOMATION_BUG MAIN_DEFECT_TYPE = MAIN_DEFECT_TYPE{
	"locator":   "ab001",
	"typeRef":   "AUTOMATION_BUG",
	"longName":  "Automation Bug",
	"shortName": "AB",
	"color":     "#f7d63e",
}
var NO_DEFECT MAIN_DEFECT_TYPE = MAIN_DEFECT_TYPE{
	"locator":   "nd001",
	"typeRef":   "NO_DEFECT",
	"longName":  "No Defect",
	"shortName": "ND",
	"color":     "#777777",
}
var PRODUCT_BUG MAIN_DEFECT_TYPE = MAIN_DEFECT_TYPE{
	"locator":   "pb001",
	"typeRef":   "PRODUCT_BUG",
	"longName":  "Product Bug",
	"shortName": "PB",
	"color":     "#ec3900",
}
var SYSTEM_BUG MAIN_DEFECT_TYPE = MAIN_DEFECT_TYPE{
	"locator":   "si001",
	"typeRef":   "SYSTEM_ISSUE",
	"longName":  "System Issue",
	"shortName": "SI",
	"color":     "#0274d1",
}

type PREDICTED_SUB_TYPE

type PREDICTED_SUB_TYPE map[string]string
var PREDICTED_AUTOMATION_BUG PREDICTED_SUB_TYPE = PREDICTED_SUB_TYPE{
	"typeRef":   "TO_INVESTIGATE",
	"longName":  "Predicted Automation Bug",
	"shortName": "TIA",
	"color":     "#ffeeaa",
}
var PREDICTED_NO_DEFECT PREDICTED_SUB_TYPE = PREDICTED_SUB_TYPE{
	"typeRef":   "TO_INVESTIGATE",
	"longName":  "Predicted No Defect",
	"shortName": "TND",
	"color":     "#C1BCB4",
}
var PREDICTED_PRODUCT_BUG PREDICTED_SUB_TYPE = PREDICTED_SUB_TYPE{
	"typeRef":   "TO_INVESTIGATE",
	"longName":  "Predicted Product Bug",
	"shortName": "TIP",
	"color":     "#ffaaaa",
}
var PREDICTED_SYSTEM_BUG PREDICTED_SUB_TYPE = PREDICTED_SUB_TYPE{
	"typeRef":   "TO_INVESTIGATE",
	"longName":  "Predicted System Issue",
	"shortName": "TIS",
	"color":     "#aaaaff",
}

type TFAInput

type TFAInput struct {
	ID                     string  `json:"id"`
	Project                string  `json:"project"`
	Messages               string  `json:"messages"`
	AutoFinalizeDefectType bool    `json:"finalization_flag"`
	FinalizationThreshold  float32 `json:"finalization_threshold"`
}

TFAInput is the data structure for describing the three input params for TFA Classifier.

type TFAModel

type TFAModel map[string]TFAInput

TFAModel is the data structure for describing the request body for TFA Classifer.

Jump to

Keyboard shortcuts

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