tools

package
v0.0.0-...-961e209 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyToByte

func AnyToByte(data any) []byte

func AnyToString

func AnyToString(data any) string

func CreateJsonFile

func CreateJsonFile(filepath string, data any) (err error)

func Error

func Error(message string)

func Fail

func Fail(message string, tab ...bool)

func GetJsonFile

func GetJsonFile(filename string) (file []byte, err error)

func GetValue

func GetValue(result []byte, index string) string

func Info

func Info(message string, tab ...bool)

func Log

func Log(message string, logData string, tab ...bool)

func PrettyString

func PrettyString(str []byte) (string, error)

func PrintCelluleLogs

func PrintCelluleLogs(celluleLogs map[int]structure.CelluleLog)

func PrintColorTable

func PrintColorTable(header []string, dataList [][]string, title_opt ...string)

func PrintColorTableNoBorder

func PrintColorTableNoBorder(header []string, dataList [][]string, title_opt ...string)

func PrintExplore

func PrintExplore(celluleID string, data map[int]structure.CelluleData)

func PrintGridPosition

func PrintGridPosition(programme structure.Programme, size int)
func PrintGridPosition(programme structure.Programme, size int) {
	var header []string
	var data [][]string
	header = append(header, "secteur")
	for i := 0; i < size; i++ {
		header = append(header, fmt.Sprintf("zone %d", i))
	}
	for i := 0; i < size; i++ {
		var tmpData []string
		tmpData = append(tmpData, aurora.Cyan(fmt.Sprintf("%d", i)).String())
		for j := 0; j < size; j++ {
			value := aurora.Red("0").String()
			if programme.Position.SecteurID == i && programme.Position.ZoneID == j {
				value = aurora.Green("1").String()
			}
			tmpData = append(tmpData, value)
		}
		data = append(data, tmpData)
	}
	PrintColorTable(header, data)
}

func PrintInfosGrille

func PrintInfosGrille(infos structure.GridInfos)

func PrintProgramme

func PrintProgramme(psi structure.ProgrammeStatusInfos)

func PrintZoneActif

func PrintZoneActif(Zones []structure.ZonesGrid)

func PrintZoneInfos

func PrintZoneInfos(infos structure.ZoneInfos)

func Success

func Success(message string, tab ...bool)

func Title

func Title(title string)

func Warning

func Warning(message string, tab ...bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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