tool

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2019 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// Update is a const for the update command
	Update = "update"

	// Delete is a const for the delete command
	Delete = "delete"

	// Create is a const for the create command
	Create = "create"

	// Unknown is a const for an unrecognized command
	Unknown = "unknown"
)

Variables

View Source
var (
	// TimeLayout is the layout for time parsing in the case of due date, can be overwritten VIA flag
	TimeLayout = "1/2/06" //"2006-01-02T15:04:05.000Z"

	// TimeToWaitBetweenLines defines the duration the tool waits between lines as to not overload the JIRA api
	TimeToWaitBetweenLines = 300 * time.Millisecond
)

TODO there should not be any global variables

Functions

func CalculateProgress

func CalculateProgress(commandSuccess int, commandFailure int, lineCount int, startTime time.Time) string

CalculateProgress creates a progress bar that includes an estimate of the amount of time until termination

func ProcessCSVContents

func ProcessCSVContents(payload *JiraToolPayload) (err error)

ProcessCSVContents parses a file and creates the API calls to update/create/delete a JIRA issue

func ProcessLine

func ProcessLine(payload *JiraToolPayload, currentLine []string, lineNum int, status string, descToIndex map[string]int)

ProcessLine kicks off a thread to handle a single line from the JIRA change file

Types

type JiraConnection

type JiraConnection struct {
	Connector *jira.ConnectorJira
	Config    domain.SourceConfig
	// contains filtered or unexported fields
}

JiraConnection is a single JIRAConnection that is shared between threads that use the same project

type JiraToolPayload

type JiraToolPayload struct {
	BlockWG *sync.WaitGroup

	LineNumOfSucceed  *[]int
	LineNumOfFailed   *[]int
	LineNumToDescLine map[int]string
	CommandSuccess    *int
	CommandFailure    *int

	Separator string

	StartTime   time.Time
	FileAsSlice []string
	// contains filtered or unexported fields
}

JiraToolPayload contains all the information required throughout the processing of a file

func MakePayload

func MakePayload(db domain.DatabaseConnection, fileContents string, templateConfig domain.SourceConfig, appconfig jira.ConfigJira, progressPrint func(string, int, int, int, time.Time)) *JiraToolPayload

MakePayload creates a JIRAPayload, and calculates minor helpful information (such as the line count)

Jump to

Keyboard shortcuts

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