diff --git a/.idea/modules.xml b/.idea/modules.xml index 3cb0cef53a388823d6846759fd42d4e39a9055eb..82e2a9970057e6aa3d9bfb84106056d6c4212d07 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -3,8 +3,6 @@ <component name="ProjectModuleManager"> <modules> <module fileurl="file://$PROJECT_DIR$/.idea/documentation-manager.iml" filepath="$PROJECT_DIR$/.idea/documentation-manager.iml" /> - <module fileurl="file://$PROJECT_DIR$/../../../schukai/utilities/makefile/makefile.iml" filepath="$PROJECT_DIR$/../../../schukai/utilities/makefile/makefile.iml" /> - <module fileurl="file://$PROJECT_DIR$/../requirements-manager/requirements-manager.iml" filepath="$PROJECT_DIR$/../requirements-manager/requirements-manager.iml" /> </modules> </component> </project> \ No newline at end of file diff --git a/.idea/runConfigurations/changelog_print.xml b/.idea/runConfigurations/changelog_print.xml deleted file mode 100644 index 29352a78a679c45231090b54d8810c710c678c80..0000000000000000000000000000000000000000 --- a/.idea/runConfigurations/changelog_print.xml +++ /dev/null @@ -1,12 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration default="false" name="changelog print" type="GoApplicationRunConfiguration" factoryName="Go Application"> - <module name="documentation-manager" /> - <working_directory value="$PROJECT_DIR$/development/examples/example1" /> - <parameters value="changelog print " /> - <kind value="DIRECTORY" /> - <directory value="$PROJECT_DIR$/application/source" /> - <filePath value="$PROJECT_DIR$" /> - <output_directory value="$PROJECT_DIR$/deployment/build" /> - <method v="2" /> - </configuration> -</component> \ No newline at end of file diff --git a/.idea/runConfigurations/documents_add.xml b/.idea/runConfigurations/documents_add.xml deleted file mode 100644 index 6da5594a80bc49cfe70945e50e31489dede4ad3d..0000000000000000000000000000000000000000 --- a/.idea/runConfigurations/documents_add.xml +++ /dev/null @@ -1,12 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration default="false" name="documents add" type="GoApplicationRunConfiguration" factoryName="Go Application"> - <module name="documentation-manager" /> - <working_directory value="$PROJECT_DIR$/development/examples/example1" /> - <parameters value="documents add" /> - <kind value="DIRECTORY" /> - <directory value="$PROJECT_DIR$/application/source" /> - <filePath value="$PROJECT_DIR$" /> - <output_directory value="$PROJECT_DIR$/deployment/build" /> - <method v="2" /> - </configuration> -</component> \ No newline at end of file diff --git a/.idea/runConfigurations/version.xml b/.idea/runConfigurations/help.xml similarity index 72% rename from .idea/runConfigurations/version.xml rename to .idea/runConfigurations/help.xml index f99562c169c5a4acbf791474cf7836b1788c2332..c4551a423ee97195cf99c1828e7efbb4cd3e334f 100644 --- a/.idea/runConfigurations/version.xml +++ b/.idea/runConfigurations/help.xml @@ -1,8 +1,8 @@ <component name="ProjectRunConfigurationManager"> - <configuration default="false" name="version" type="GoApplicationRunConfiguration" factoryName="Go Application"> + <configuration default="false" name="help" type="GoApplicationRunConfiguration" factoryName="Go Application"> <module name="documentation-manager" /> <working_directory value="$PROJECT_DIR$" /> - <parameters value="version" /> + <parameters value="--help" /> <kind value="DIRECTORY" /> <directory value="$PROJECT_DIR$/application/source" /> <filePath value="$PROJECT_DIR$" /> diff --git a/.idea/runConfigurations/tasks_print.xml b/.idea/runConfigurations/tasks_print.xml deleted file mode 100644 index a56a7260eee0b0b9fce78717c756b494c160e80f..0000000000000000000000000000000000000000 --- a/.idea/runConfigurations/tasks_print.xml +++ /dev/null @@ -1,12 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration default="false" name="tasks print" type="GoApplicationRunConfiguration" factoryName="Go Application"> - <module name="documentation-manager" /> - <working_directory value="$PROJECT_DIR$/development/examples/example1" /> - <parameters value="tasks print" /> - <kind value="DIRECTORY" /> - <directory value="$PROJECT_DIR$/application/source" /> - <filePath value="$PROJECT_DIR$" /> - <output_directory value="$PROJECT_DIR$/deployment/build" /> - <method v="2" /> - </configuration> -</component> \ No newline at end of file diff --git a/README.md b/README.md index 7195863aaedba85546c062d80cee954a0e0b632a..db25e2008ed33f093f78bc8ada38849a320af0d9 100644 --- a/README.md +++ b/README.md @@ -13,15 +13,43 @@ For Linux, the execution bit must still be set. chmod u+x docman ``` + + + +## Developments + +To search the source code for new texts, you have to go to the source directory and +call + +```bash +go generate translations/translations.go +``` + + + + + + + + +---- + + + ## Commands ### General Parameters The date format for the output can be specified with the parameter `--date-format`. -All configuration values can also be specified in a configuration file. +All confirguration values can also be specified in a configuration file. The configuration file can be specified with the `--config` parameter. +If no path is specified, the configuration file `config.yaml` is first searched for in the working directory. +If this is not found, the file is searched for in the home directory `~/.config/documentations-manager/config.yaml`. + +Finally, we look for the configuration in the `/etc/documentations-manager/config.yaml` directory. + The parameter `path` specifies the path. ### Help diff --git a/application/source/commandlineoptions.go b/application/source/commandlineoptions.go deleted file mode 100644 index db71689da7a86c36c6fedb093d6644230f6a4b0a..0000000000000000000000000000000000000000 --- a/application/source/commandlineoptions.go +++ /dev/null @@ -1,31 +0,0 @@ -package main - -type commandLineOptions struct { - Config string `short:"c" long:"config" description:"file with configuration values"` - Path string `short:"p" long:"path" description:"define the path where the specifications are located" default:"."` - DateFormat string `long:"date-format" description:"date format" default:"2006-01-02"` - Documents struct { - Add struct { - Name string `short:"n" long:"name" description:"name of the document"` - } `command:"add"` - } `command:"documents"` - Tasks struct { - Print struct { - } `command:"print"` - } `command:"tasks"` - Changelog struct { - Print struct { - } `command:"print"` - } `command:"changelog"` - Build struct { - Print struct { - Columns []string `short:"c" long:"column" description:"defines the columns used"` - TemplatePath string `short:"t" long:"template" description:"file name of the template of the overview page"` - Output string `short:"o" long:"output" description:"redirect output to a file"` - Format string `short:"f" long:"format" description:"the desired output format" choice:"pdf" choice:"md"` - LatexTemplatePath string `short:"l" long:"latex-template-path" description:"latex template"` - } `command:"print"` - } `command:"build"` - Version struct { - } `command:"version"` -} diff --git a/application/source/commands/01_state.go b/application/source/commands/01_state.go new file mode 100644 index 0000000000000000000000000000000000000000..a6a78dffcfd7bf644b7d8116e2c72e08c79b3b26 --- /dev/null +++ b/application/source/commands/01_state.go @@ -0,0 +1,66 @@ +package commands + +import ( + "gitlab.schukai.com/oss/utilities/documentation-manager/translations" + "os" +) + +type stateStruct struct { + info Info + exitCode int + warnings []string + errors []string + messages []string +} + +type Info struct { + Version string + Build string +} + +var state *stateStruct + +func init() { + state = &stateStruct{} +} + +func ExitWithError(code int, message string, a ...interface{}) { + state.SetCode(code).AddError(translations.T.Sprintf(message, a)).Exit() +} + +func (e *stateStruct) AddWarning(warning string) *stateStruct { + e.warnings = append(e.warnings, warning) + return e +} + +func (e *stateStruct) AddError(error string) *stateStruct { + e.errors = append(e.errors, error) + return e +} + +func (e *stateStruct) AddMessage(message string) *stateStruct { + e.messages = append(e.messages, message) + return e +} + +func (e *stateStruct) SetCode(code int) *stateStruct { + e.exitCode = code + return e +} + +const ExitWithCodeSymbol = "exit with code" + +func (e *stateStruct) Exit() { + PrintMessages() + panic(ExitWithCodeSymbol) +} + +func Exit() { + + for _, fkt := range handlers.shutdown { + f := *fkt + f() + } + + os.Exit(state.exitCode) +} diff --git a/application/source/commands/02_command.go b/application/source/commands/02_command.go new file mode 100644 index 0000000000000000000000000000000000000000..2378b929f87bffbb054b20f865d12aa0d6d2e2dd --- /dev/null +++ b/application/source/commands/02_command.go @@ -0,0 +1,31 @@ +package commands + +import ( + "github.com/jessevdk/go-flags" + "strings" +) + +func initCommands() { + + for n, h := range handlers.executor { + x := strings.Split(n, "-") + + var c *flags.Command + + for i, y := range x { + + if i == 0 { + c = terminalState.parser.Find(y) + } else { + c = c.Find(y) + } + + } + + if c != nil { + h.init(c) + } + + } + +} diff --git a/application/source/commands/02_handler.go b/application/source/commands/02_handler.go new file mode 100644 index 0000000000000000000000000000000000000000..da3c67b13dd92facb10f94cdbe5dcdfc748c564f --- /dev/null +++ b/application/source/commands/02_handler.go @@ -0,0 +1,37 @@ +package commands + +import "github.com/jessevdk/go-flags" + +type handlerStruct struct { + shutdown []*hook + executor map[string]handler +} + +type hook func() + +type handler struct { + init func(*flags.Command) + execute func(*flags.Command) +} + +var handlers handlerStruct + +func init() { + handlers.executor = make(map[string]handler) + handlers.shutdown = make([]*hook, 0) +} + +func (e *handlerStruct) removeShutdownHook(h *hook) *handlerStruct { + for i, f := range e.shutdown { + if f == h { + e.shutdown = append(e.shutdown[:i], e.shutdown[i+1:]...) + return e + } + } + return e +} + +func (e *handlerStruct) addShutdownHook(h *hook) *handlerStruct { + e.shutdown = append(e.shutdown, h) + return e +} diff --git a/application/source/commands/03_errors.go b/application/source/commands/03_errors.go new file mode 100644 index 0000000000000000000000000000000000000000..e4110027d65285091d11b0a55ffe38035dead54d --- /dev/null +++ b/application/source/commands/03_errors.go @@ -0,0 +1,88 @@ +package commands + +import ( + "errors" + "github.com/jessevdk/go-flags" + "gitlab.schukai.com/oss/utilities/documentation-manager/translations" +) + +const ( + // Generic codes. + CodeOK = 0 // success + CodeErr = 1 // generic error + CodeHelpErr = 2 // command is invoked with -help or -h flag but no such flag is defined + + // Codes as defined in /usr/include/sysexits.h on *nix systems. + CodeUsage = 64 // command line usage error + CodeDataErr = 65 // data format error + CodeNoInput = 66 // cannot open input + CodeNoUser = 67 // addressee unknown + CodeNoHost = 68 // host name unknown + CodeUnavailable = 69 // service unavailable + CodeSoftware = 70 // internal software error + CodeOSErr = 71 // system error (e.g., can't fork) + CodeOSFile = 72 // critical OS file missing + CodeCantCreat = 73 // can't create (user) output file + CodeIOErr = 74 // input/output error + CodeTempFail = 75 // temp failure; user is invited to retry + CodeProtocol = 76 // remote error in protocol + CodeNoPerm = 77 // permission denied + CodeConfig = 78 // configuration error + +) + +var ( + notPermittedError = errors.New(translations.T.Sprintf("Not permitted")) +) + +func checkFlagsError(err error) { + e := err.(*flags.Error) + switch e.Type { + case flags.ErrUnknown: + state.AddError(translations.T.Sprintf("flag error unknown")).Exit() + case flags.ErrExpectedArgument: + state.AddError(translations.T.Sprintf("expected argument")).Exit() + case flags.ErrUnknownFlag: + state.AddError(translations.T.Sprintf("unknown flag")).Exit() + case flags.ErrUnknownGroup: + state.AddError(translations.T.Sprintf("unknown group")).Exit() + case flags.ErrMarshal: + state.AddError(translations.T.Sprintf("marshal")).Exit() + case flags.ErrHelp: + state.Exit() + case flags.ErrNoArgumentForBool: + state.AddError(translations.T.Sprintf("no argument for bool")).Exit() + case flags.ErrRequired: + state.Exit() + case flags.ErrShortNameTooLong: + state.AddError(translations.T.Sprintf("short name too long")).Exit() + case flags.ErrDuplicatedFlag: + state.AddError(translations.T.Sprintf("duplicated flag")).Exit() + case flags.ErrTag: + state.AddError(translations.T.Sprintf("tag %s", err.Error())).Exit() + case flags.ErrCommandRequired: + state.Exit() + case flags.ErrUnknownCommand: + state.AddError(translations.T.Sprintf("unknown command")).Exit() + case flags.ErrInvalidChoice: + state.AddError(translations.T.Sprintf("invalid choice")).Exit() + case flags.ErrInvalidTag: + state.AddError(translations.T.Sprintf("invalid tag")).Exit() + default: + state.AddError(translations.T.Sprintf("unrecognized error type")).Exit() + + } +} + +func CheckError(err error) { + if err == nil { + return + } + + switch err.(type) { + case *flags.Error: + checkFlagsError(err) + } + + ExitWithError(1, "Unknown Error: %s", err.Error()) +} diff --git a/application/source/commands/03_messages.go b/application/source/commands/03_messages.go new file mode 100644 index 0000000000000000000000000000000000000000..0581ad790ed920e38cd2a39e0c5cf2a4144eb26a --- /dev/null +++ b/application/source/commands/03_messages.go @@ -0,0 +1,42 @@ +package commands + +import ( + "github.com/gookit/color" + "gitlab.schukai.com/oss/utilities/documentation-manager/translations" + "strings" +) + +func PrintMessages() { + + const indent = " " + + if len(state.errors) > 0 { + color.Error.Println(strings.ToUpper(translations.T.Sprintf("Error")) + ":") + } + + for _, message := range state.errors { + color.Error.Println(indent + message) + } + + if len(state.warnings) > 0 { + color.Warn.Println(strings.ToUpper(translations.T.Sprintf("Warn")) + ":") + } + + for _, message := range state.warnings { + color.Warn.Println(indent + message) + } + + if len(state.messages) > 0 { + color.Info.Println(strings.ToUpper(translations.T.Sprintf("Info")) + ":") + } + + for _, message := range state.messages { + color.Info.Println(indent + message) + } + + // reset + state.messages = []string{} + state.warnings = []string{} + state.errors = []string{} + +} diff --git a/application/source/commands/03_terminal.go b/application/source/commands/03_terminal.go new file mode 100644 index 0000000000000000000000000000000000000000..948d119053738d7b39d35b70b72cac0bbf3396b7 --- /dev/null +++ b/application/source/commands/03_terminal.go @@ -0,0 +1,10 @@ +package commands + +import "github.com/jessevdk/go-flags" + +type TerminalStateStruct struct { + parser *flags.Parser + definition *Definition +} + +var terminalState TerminalStateStruct diff --git a/application/source/commands/06_definitions.go b/application/source/commands/06_definitions.go new file mode 100644 index 0000000000000000000000000000000000000000..a25596c8d07f3c1e975a2256869e75b19ce6b831 --- /dev/null +++ b/application/source/commands/06_definitions.go @@ -0,0 +1,6 @@ +package commands + +type Definition struct { + Version VersionDefinition `command:"version" alias:"v"` + Document DocumentDefinition `command:"document" alias:"d"` +} diff --git a/application/source/commands/07_execute.go b/application/source/commands/07_execute.go new file mode 100644 index 0000000000000000000000000000000000000000..5168d7bdc47a211c7f0886dbd098fbefaf8eebd8 --- /dev/null +++ b/application/source/commands/07_execute.go @@ -0,0 +1,61 @@ +package commands + +import ( + "github.com/jessevdk/go-flags" + "gitlab.schukai.com/oss/utilities/documentation-manager/translations" + "strings" +) + +func Execute(Info Info) { + + state.info = Info + + initTerminalState() + initCommands() + + _, err := terminalState.parser.Parse() + CheckError(err) + + a := terminalState.parser.Command.Active + if a == nil { + ExitWithError(1, "No active command found") + } + + queue := []string{} + runCommand(queue, terminalState.parser.Command.Active) + +} + +func initTerminalState() { + + definition := &Definition{} + parser := flags.NewParser(definition, flags.Default) + + parser.ShortDescription = translations.T.Sprintf("This program can be used to create documentation for your project.") + parser.LongDescription = translations.T.Sprintf("This program can be used to create documentation for your project.\nIt can be used to create a new documentation project,\nadd new documentation to an existing project, or to generate\ndocumentation from a source code project.") + + terminalState = TerminalStateStruct{ + parser: parser, + definition: definition, + } + +} + +func runCommand(queue []string, activeCommand *flags.Command) { + + queue = append(queue, activeCommand.Name) + + if activeCommand.Active != nil { + runCommand(queue, activeCommand.Active) + return + } + + k := strings.Join(queue, "-") + + if handler, ok := handlers.executor[k]; ok { + execute := handler.execute + execute(activeCommand) + } else { + ExitWithError(1, "handler %s not found", k) + } +} diff --git a/application/source/commands/08_document.go b/application/source/commands/08_document.go new file mode 100644 index 0000000000000000000000000000000000000000..1aa4920552f2415da023e9b166ceff837ec80981 --- /dev/null +++ b/application/source/commands/08_document.go @@ -0,0 +1,35 @@ +package commands + +import ( + "github.com/jessevdk/go-flags" + "gitlab.schukai.com/oss/utilities/documentation-manager/translations" +) + +func init() { + + h := handler{ + init: initDocument, + } + + handlers.executor["document"] = h + +} + +type DocumentDefinition struct { + Path string `long:"path" short:"p" default:"."` + Add DocumentAddDefinition `command:"add" alias:"a"` +} + +func initDocument(command *flags.Command) { + const text = "Functions for creating and editing documents" + command.ShortDescription = translations.T.Sprintf(text) + command.LongDescription = translations.T.Sprintf(text) + + for _, opt := range command.Options() { + switch opt.LongName { + case "path": + opt.Description = translations.T.Sprintf("base directory in which the documents are saved") + } + } + +} diff --git a/application/source/commands/08_document_add.go b/application/source/commands/08_document_add.go new file mode 100644 index 0000000000000000000000000000000000000000..4eacd9dd4763a52828fbd760024a1461e8137d28 --- /dev/null +++ b/application/source/commands/08_document_add.go @@ -0,0 +1,106 @@ +package commands + +import ( + "fmt" + "github.com/jessevdk/go-flags" + "gitlab.schukai.com/oss/utilities/documentation-manager/translations" +) + +const documentAddSymbol = "document-add" + +// language: md +const newDocumentTemplate = ` +--- +# Document title +Title: New Document + +# keywords mainly used for searching +Keywords: + - documentation + +# First and last name of the authors as a list +Author: + - null + +Created: %%CREATED%% +Last Update: %%CREATED%% + +... + +## {{ .Title }} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. +` + +func init() { + + h := handler{ + init: initDocumentAdd, + execute: runDocumentAdd, + } + + handlers.executor[documentAddSymbol] = h + +} + +type DocumentAddDefinition struct { + Positional struct { + Name []string `positional-arg-name:"name" required:"yes" positional:"yes"` + } `positional-args:"yes" required:"yes"` +} + +func initDocumentAdd(command *flags.Command) { + const text = "Adds a new document" + command.ShortDescription = translations.T.Sprintf(text) + command.LongDescription = translations.T.Sprintf(text) + + for _, arg := range command.Args() { + switch arg.Name { + case "name": + arg.Description = translations.T.Sprintf("file names of the new documents, separated by spaces") + } + + } + +} + +func createNewDocument(name string) error { + + //p := path.Join(arguments.Path, arguments.Add.Name+".md") + //if fileExists(p) { + // printErrorAndExit(2, "the document with name already exists", arguments.Add.Name, p) + //} + // + //t := config.Document.Template.Add + //t = strings.Replace(t, "%%ID%%", arguments.Add.Name, -1) + //t = strings.Replace(t, "%%CREATED%%", time.Now().Format("2006-01-02"), -1) + // + //d1 := []byte(t) + //err := os.WriteFile(p, d1, 0644) + //if err != nil { + // return err + //} + // + //return nil + + return nil +} + +func runDocumentAdd(command *flags.Command) { + + t := terminalState + p := t.definition.Document.Path + fmt.Println(p) + + names := terminalState.definition.Document.Add.Positional.Name + + if len(names) == 0 { + ExitWithError(1, "no document name given") + } + + for _, name := range names { + fmt.Printf("Adding document %s\n", name) + createNewDocument(name) + } + +} diff --git a/application/source/commands/08_version.go b/application/source/commands/08_version.go new file mode 100644 index 0000000000000000000000000000000000000000..82abbba91e49596c44a65c1809cab8d4954c66b9 --- /dev/null +++ b/application/source/commands/08_version.go @@ -0,0 +1,33 @@ +package commands + +import ( + "github.com/jessevdk/go-flags" + "gitlab.schukai.com/oss/utilities/documentation-manager/translations" +) + +const versionSymbol = "version" + +func init() { + + h := handler{ + init: initVersion, + execute: runVersion, + } + + handlers.executor[versionSymbol] = h + +} + +type VersionDefinition struct { +} + +func initVersion(command *flags.Command) { + const text = "Prints the version and build information" + command.ShortDescription = translations.T.Sprintf(text) + command.LongDescription = translations.T.Sprintf(text) +} + +func runVersion(command *flags.Command) { + translations.T.Printf("version: %s\n", state.info.Version) + translations.T.Printf("build: %s\n", state.info.Build) +} diff --git a/application/source/defaults.go b/application/source/defaults.go deleted file mode 100644 index 5b6b325f571ee4383abba14932626b6efde712e8..0000000000000000000000000000000000000000 --- a/application/source/defaults.go +++ /dev/null @@ -1,233 +0,0 @@ -package main - -const exitOK = 0 - -// - Catchall for general errors -const exitCodeCatchAll = 1 - -// Invalid argument to exit -// const exitCodeInvalidArgument = 128 - -const defaultOverviewTemplate = ` - ---- -block-headings: true ---- - -{{ if .HasChangelog }} -## Changelog - -{{.Changelog}} - -{{ end}}{{ if .HasPrivacy }} -## Privacy - -{{.Privacy}} - -{{ end}}{{ if .HasMeta }} -## Build - -{{.Meta}} - -{{ end}}{{ if .HasTasks }} -## Tasks - -{{.Tasks}} - -{{ end}}{{ if .HasItems }} -## Items - -{{.Items}} - -{{ end}}{{ if .HasRequirements }} -## Documents - -{{.Documents}} - -{{ end}} - - -` - -// -const defaultNewRequirementTemplate = ` ---- -ID: %%ID%% -Title: null - -# Reference to other requirements -References: null - -# Display, Functional, Performance, Printing, Report, Testing or Validation -Type: null - -Alias: null - -Keywords: - - Requirement - -# First and last name of the authors as a list -Author: - - null - -# Proposed (The document has been requested by an authorized source.), -# In Progress (A business analyst is actively working on crafting the document.), -# Drafted (The initial version of the document has been written.), -# Approved (The document has been analyzed, its impact on the project has been estimated, and it has been allocated to the baseline for a specific release. ), -# Implemented (The code that implements the document has been designed, written, and unit tested. The document has been traced to the pertinent design and code elements. It’s now ready for review or other verification.), -# Verified (The document has satisfied its acceptance criteria, meaning that the correct functioning of the implemented document has been confirmed.), -# Deferred (An approved document is now planned for implementation in a later release.), -# Deleted (An approved document has been removed from the baseline.) or -# Rejected (The document was proposed but was never approved and is not planned for implementation in any upcoming release.) -Status: "Proposed" - -# Low, Medium, Hi -Complexity: null -# Low, Medium, Hi -Difficulty: null -# Nice to have, Low, Medium, Hi or Blocker -Priority: null -Version: 0.0.1 -Milestone: null - -# 0 (means that a task has already been completed), 1 (is a very small task), 2, 3, 5 (are rather smaller tasks), -# 8, 13, 20, 40, 100 -Estimation: - -# The time required for this document -# Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”. -Time Spent: - -# who is the source of the demand -Source: null -Created: %%CREATED%% -Last Update: null - -# The issues that are associated with this document -# You can add an issue by adding a new line to the list with the following format: -# - Gitlab: -# ID: <issue-id> -# -# if the issue is not yet in the project, you can add it by using the following format: -# Only the Title is required. -# - Gitlab: -# Title: <issue-title> -# Description: <issue-description> -# Priority: <issue-priority> -# Status: <issue-status> -# Assignee: <issue-assignee> -# Milestone: <issue-milestone> -# Labels: <issue-labels> -# -Issues: - - -# the individual items as a list -Items: - - ID: null - Name: null - # what is it, a image, font, legal information, access data, texts, decisions, etc. - Type: null - # does this belong to a group - group: null - Description: null - Delivery until: null - # when was the project items delivered and by whom? - Provided on: null - Provided by: null - -# https://gdpr-info.eu/art-30-gdpr/ -Privacy: - - ID: null - - # Purpose of the data processing, - # for example, shipping an order and handing it over to a shipping service provider. - Purposes: null - - # More detailed description of the reason and process of data processing. - Description: null - - # Who is responsible for data protection - Contact: null - - # But working with these categories might end up being a bad idea since doing so might - # mean packing different things into one. This leads to either oversimplifications or - # a lot of specifications within a category. It might be advisable to split some of them - # up or to add additional ones to make them fit your business reality. - # Examples: Employees, Suppliers, Customers, Job applicants, Consultants, Visitors, Prospects, Contractors, Trainees - Affected Groups: null - - # - Category: - - # Example: 5 years from the payment of the salary - Data Retention Period: null - - # On what legal basis is the data collected - # Special legal regulation outside the GDPR - # Consent of the data subject (Art. 6 para. 1 a) DSG-VO) use Consent field - # Collective agreement (e.g. company agreement, collective agreement) - # Establishment, performance or termination of an employment relationship (nationally regulated in the BDSG) - # Contract or initiation of a contract with the data subject (Art. 6 para. 1 b) DSG-VO.) - # Balancing of interests (Art. 6 para. 1 f) DSG-VO): Please name the overriding interests - Legal Basis: null - - # “Consent” of the data subject refers to any freely given specific, informed and unambiguous indication of his or - # her wishes in the form of a statement or other unambiguous affirmative act by which the data subject signifies - # his or her agreement to personal data relating to him or her being processed. - Consent: null - - # Where applicable, transfers of personal data to a third country or an international organisation, including - # the identification of that third country or international organisation and, in the case of transfers referred - # to in the second subparagraph of Article 49(1), the documentation of suitable safeguards; - Transfers: - - # Where possible, a general description of the technical and organisational - # security measures referred to in Article 32(1). - TOM: null - -... - -### {{ .Title }} - {{ .ID }} - -#### Subheading - -- [ ] task 1 -- [ ] task 2 - - -{{ if .Items }} -#### Items - -| ID | Name | Delivery until | Provided on | -|--------------------|--------------|----------------------:|-----------------------------------------:| -{{ range .Items - }}| {{ .ID }} | {{ .Name }} | {{ .DeliveryUntil.Format "02.Jan" }} | {{ .ProvidedOn.Format "02.Jan" }} | -{{ end }} - -{{ end }} - -{{ if .Privacy }} -#### Privacy - -{{ range .Privacy }} -{{ if .Purposes }}**{{ .Purposes }}** {{ end }}**({{ .ID }})** - -{{ if .Description }} {{ .Description }} -{{ end }} -| | | -|-----------------------|----------------------------| -| Category | {{ .Category }} | -| Data Retention Period | {{ .DataRetentionPeriod }} | -| Legal Basis | {{ .LegalBasis }} | -| Transfers | {{ .Transfers }} | -{{ end }} - -{{ end }} - - - - - - -` diff --git a/application/source/documents.go b/application/source/documents.go deleted file mode 100644 index 8aef5d705300565f3a70aab44a1f5ac568b139f4..0000000000000000000000000000000000000000 --- a/application/source/documents.go +++ /dev/null @@ -1,142 +0,0 @@ -package main - -import ( - "bytes" - "os" - "path" - "reflect" - "strconv" - "strings" - "time" - - "gopkg.in/yaml.v3" - - "github.com/olekukonko/tablewriter" -) - -type document struct { - ToDos []task `yaml:"-"` - Absolute string `yaml:"-"` - File string `yaml:"-"` - - // remember the node structure of yaml - OriginNode *yaml.Node `yaml:"-"` - OriginText string `yaml:"-"` - - Name string `yaml:"Name"` - References []string `yaml:"References"` - Keywords []string `yaml:"Keywords"` - Author []string `yaml:"Author"` - Version string `yaml:"Version"` - Created time.Time `yaml:"Created"` - LastUpdate time.Time `yaml:"Last Update"` -} - -func addDocument() error { - - if arguments.Documents.Add.Name == "" { - printErrorAndExit(2, "the name must not be empty") - } - - p := path.Join(arguments.Path, arguments.Documents.Add.Name+".md") - if fileExists(p) { - printErrorAndExit(2, "the request with id already exists", arguments.Documents.Add.Name, p) - } - - t := config.Requirement.Template.Add - t = strings.Replace(t, "%%ID%%", arguments.Documents.Add.Name, -1) - t = strings.Replace(t, "%%CREATED%%", time.Now().Format("2006-01-02"), -1) - - d1 := []byte(t) - err := os.WriteFile(p, d1, 0644) - if err != nil { - return err - } - - return nil -} - -func buildRequirements(pageMap map[string]*document) (error, string, bool) { - - hasRequirements := false - - buf := new(bytes.Buffer) - table := tablewriter.NewWriter(buf) - - translateMetaColumns := translateHeaders(config.Requirement.Table.Columns) - - table.SetHeader(translateMetaColumns) - table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false}) - table.SetCenterSeparator("|") - - var tableData [][]string - - for _, pd := range pageMap { - - r := reflect.ValueOf(pd) - - var row []string - found := false - for _, name := range config.Requirement.Table.Columns { - - field := reflect.Indirect(r).FieldByName(name) - if field == (reflect.Value{}) { - row = append(row, printer.Sprintf("no value")) - continue - } - - t := field.Type() - - switch t.Name() { - case "string": - found = true - row = append(row, field.String()) - case "Duration": - found = true - t := field.Interface().(time.Duration) - row = append(row, t.String()) - case "Time": - found = true - t := field.Interface().(time.Time) - if t.IsZero() { - row = append(row, "—") - } else { - row = append(row, field.Interface().(time.Time).Format(config.Locale.DateFormat)) - } - case "int": - found = true - row = append(row, strconv.FormatInt(field.Int(), 10)) - case "float64": - found = true - row = append(row, strconv.FormatFloat(field.Float(), 'f', 10, 2)) - case "nil": - row = append(row, field.String()) - case "bool": - found = true - expr := field.Bool() - if expr { - row = append(row, "true") - } else { - row = append(row, "false") - } - - default: - row = append(row, printer.Sprintf("unsuported type", t.Name())) - } - - } - - if found { - tableData = append(tableData, row) - hasRequirements = true - } - - } - - table.AppendBulk(tableData) // Add Bulk Data - table.SetHeaderAlignment(tablewriter.ALIGN_LEFT) - table.Render() - - return nil, buf.String(), hasRequirements - -} diff --git a/application/source/go.mod b/application/source/go.mod index ddd4660ae37f609327b8be33c2784626323b1fde..2cce3dbbdb39c5fe00b40f463ae88374f27fa6de 100644 --- a/application/source/go.mod +++ b/application/source/go.mod @@ -1,49 +1,12 @@ -module gitlab.schukai.com/oss/utilities/requirements-manager +module gitlab.schukai.com/oss/utilities/documentation-manager go 1.18 -require ( - github.com/go-git/go-git/v5 v5.4.2 - github.com/gookit/color v1.5.1 - github.com/jessevdk/go-flags v1.5.0 - github.com/olekukonko/tablewriter v0.0.5 - github.com/xanzy/go-gitlab v0.68.0 - golang.org/x/text v0.3.7 - gopkg.in/yaml.v2 v2.4.0 - gopkg.in/yaml.v3 v3.0.1 -) +require golang.org/x/text v0.3.7 require ( - github.com/Microsoft/go-winio v0.5.2 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20220517143526-88bb52951d5b // indirect - github.com/acomagu/bufpipe v1.0.3 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emirpasic/gods v1.18.1 // indirect - github.com/go-git/gcfg v1.5.0 // indirect - github.com/go-git/go-billy/v5 v5.3.1 // indirect - github.com/golang/protobuf v1.5.2 // indirect - github.com/google/go-querystring v1.1.0 // indirect - github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-retryablehttp v0.7.1 // indirect - github.com/imdario/mergo v0.3.13 // indirect - github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/kevinburke/ssh_config v1.2.0 // indirect - github.com/kr/pretty v0.2.1 // indirect - github.com/mattn/go-runewidth v0.0.13 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect - github.com/sergi/go-diff v1.2.0 // indirect - github.com/src-d/gcfg v1.4.0 // indirect - github.com/xanzy/ssh-agent v0.3.1 // indirect + github.com/gookit/color v1.5.1 // indirect + github.com/jessevdk/go-flags v1.5.0 // indirect github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect - golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect - golang.org/x/net v0.0.0-20220621193019-9d032be2e588 // indirect - golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb // indirect - golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect - golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.28.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect - gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect - gopkg.in/warnings.v0 v0.1.2 // indirect + golang.org/x/sys v0.0.0-20220702020025-31831981b65f // indirect ) diff --git a/application/source/go.sum b/application/source/go.sum index ab243f5ee6350e2ad7f6f53fb56ee99b595df446..952c2d7f22c12eab698bf17c07caefd639311ab3 100644 --- a/application/source/go.sum +++ b/application/source/go.sum @@ -1,546 +1,19 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= -github.com/ProtonMail/go-crypto v0.0.0-20220517143526-88bb52951d5b h1:lcbBNuQhppsc7A5gjdHmdlqUqJfgGMylBdGyDs0j7G8= -github.com/ProtonMail/go-crypto v0.0.0-20220517143526-88bb52951d5b/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= -github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= -github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= -github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= -github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= -github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= -github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git v4.7.0+incompatible h1:+W9rgGY4DOKKdX2x6HxSR7HNeTxqiKrOvKnuittYVdA= -github.com/go-git/go-git v4.7.0+incompatible/go.mod h1:6+421e08gnZWn30y26Vchf7efgYLe4dl5OQbBSUXShE= -github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= -github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= -github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gookit/color v1.5.0 h1:1Opow3+BWDwqor78DcJkJCIwnkviFi+rrOANki9BUFw= -github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo= github.com/gookit/color v1.5.1 h1:Vjg2VEcdHpwq+oY63s/ksHrgJYCTo0bwWvmmYWdE9fQ= github.com/gookit/color v1.5.1/go.mod h1:wZFzea4X8qN6vHOSP2apMb4/+w/orMznEzYsIHPaqKM= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= -github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= -github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY= -github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= -github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4= -github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/xanzy/go-gitlab v0.68.0 h1:b2iMQHgZ1V+NyRqLRJVv6RFfr4xnd/AASeS/PETYL0Y= -github.com/xanzy/go-gitlab v0.68.0/go.mod h1:o4yExCtdaqlM8YGdDJWuZoBmfxBsmA9TPEjs9mx1UO4= -github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= -github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= -github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= -github.com/xanzy/ssh-agent v0.3.1 h1:AmzO1SSWxw73zxFZPRwaMN1MohDw8UyHnmuxyceTEGo= -github.com/xanzy/ssh-agent v0.3.1/go.mod h1:QIE4lCeL7nkC25x+yA3LBIYfwCc1TFziCtG7cBAac6w= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220615171555-694bf12d69de h1:ogOG2+P6LjO2j55AkRScrkB2BFpd+Z8TY2wcM0Z3MGo= -golang.org/x/net v0.0.0-20220615171555-694bf12d69de/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220621193019-9d032be2e588 h1:9ubFuySsnAJYGyJrZ3koiEv8FyqofCBdz3G9Mbf2YFc= -golang.org/x/net v0.0.0-20220621193019-9d032be2e588/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb h1:8tDJ3aechhddbdPAxpycgXHJRMLpk/Ab+aa4OgdN5/g= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44 h1:Bli41pIlzTzf3KEY06n+xnzK/BESIg2ze4Pgfh/aI8c= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886 h1:eJv7u3ksNXoLbGSKuv2s/SIO4tJVxc/A+MTpzxDgz/Q= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/sys v0.0.0-20220702020025-31831981b65f h1:xdsejrW/0Wf2diT5CPp3XmKUNbr7Xvw8kYilQ+6qjRY= +golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220411224347-583f2d630306 h1:+gHMid33q6pen7kv9xvT+JRinntgeXO2AeZVd0AWD3w= -golang.org/x/time v0.0.0-20220411224347-583f2d630306/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858 h1:Dpdu/EMxGMFgq0CeYMh4fazTD2vtlZRYE7wyynxJb9U= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg= -gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98= -gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= -gopkg.in/src-d/go-git.v4 v4.13.1 h1:SRtFyV8Kxc0UP7aCHcijOMQGPxHSmMOPrzulQWolkYE= -gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8= -gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99 h1:dbuHpmKjkDzSOMKAWl10QNlgaZUd3V1q99xc81tt2Kc= -gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/application/source/main.go b/application/source/main.go index 98a67334419c517571019fcb0db21b9509baa78e..8c8e6065e34e35eabc0cc3d68456bb7741486cf5 100644 --- a/application/source/main.go +++ b/application/source/main.go @@ -1,50 +1,31 @@ package main import ( - "os" - - "golang.org/x/text/language" - "golang.org/x/text/message" + "gitlab.schukai.com/oss/utilities/documentation-manager/commands" ) -// Wird beim Bauen per +// Used when building per // -ldflags "-X main.version=$app_version -X main.build=$(due --iso-8601 | tr -d "-" )" -// gesetzt var ( version string = "dev" build string = "dev" - printer *message.Printer - //sugar *zap.SugaredLogger ) -var serverLangs = []language.Tag{ - language.English, // en fallback - language.German, // de -} - -var matcher = language.NewMatcher(serverLangs) - -var userPrefs = []language.Tag{ - language.Make(os.Getenv("LANG")), - language.Make("en"), -} - -func init() { - - initEnvironment() - - tag, _, _ := matcher.Match(userPrefs...) - printer = message.NewPrinter(tag) - - initL10n() - -} - -func initEnvironment() { -} - /** */ func main() { - executeCommand() + + defer func() { + if r := recover(); r != nil && + r != commands.ExitWithCodeSymbol { + panic(r) + } + commands.Exit() + }() + + commands.Execute(commands.Info{ + Version: version, + Build: build, + }) + } diff --git a/application/source/overview.go b/application/source/overview.go deleted file mode 100644 index 0db49c2a512ccd97bed6cc0f0be2b2920edfde08..0000000000000000000000000000000000000000 --- a/application/source/overview.go +++ /dev/null @@ -1,284 +0,0 @@ -package main - -import ( - "io/ioutil" - "os" - "path" - "path/filepath" - "regexp" - "sort" - "strings" - "text/template" - "time" -) - -type Dataset struct { - Config *Configuration - Meta string - HasChangelog bool - Changelog string - HasPrivacy bool - Privacy string - HasMeta bool - Tasks string - HasTasks bool - Items string - HasItems bool - Requirements string - HasRequirements bool - Created time.Time - CreatedFormat string -} - -func PrintOverview() error { - - err, pageData := collectStructureFromFiles(config.Path) - if err != nil { - return err - } - - err, meta, hasMeta := buildRequirements(pageData) - if err != nil { - return err - } - - err, changelog, hasChangelog := buildChangelog(pageData) - if err != nil { - return err - } - - err, tasks, hasTasks := buildTasksTable(pageData, false) - if err != nil { - return err - } - - t, err := template.New("overview").Parse(config.Overview.Template.Internal.MarkdownContent) - if err != nil { - return err - } - - requirements := "" - - keys := make([]string, 0, len(pageData)) - for k := range pageData { - keys = append(keys, k) - } - - sort.Strings(keys) - - hasRequirements := false - for _, k := range keys { - hasRequirements = true - p := pageData[k] - requirements = requirements + getAdjustedContent(p.Absolute) - } - - d := new(Dataset) - - d.Changelog = changelog - d.HasChangelog = hasChangelog - - d.Meta = meta - d.HasMeta = hasMeta - - d.Tasks = tasks - d.HasTasks = hasTasks - - d.Requirements = requirements - d.HasRequirements = hasRequirements - - d.Config = config - d.Created = time.Now() - d.CreatedFormat = time.Now().Format(config.Locale.DateFormat) - //d.document = document - - outputName := arguments.Build.Print.Output - - if arguments.Build.Print.Format == "pdf" { - - if outputName == "" { - printErrorAndExit(2, "if the type is pdf, the output option must be specified") - } - - file, err := ioutil.TempFile(os.TempDir(), "reqman") - if err != nil { - printErrorAndExit(2, "A temporary file cannot be created", err.Error()) - } - defer os.Remove(file.Name()) - - err = t.Execute(file, d) - if err != nil { - return err - } - - convertToPDF(file.Name(), outputName, config.Overview.Template.Latex) - - } else { - - if outputName != "" { - file, err := os.Create(outputName) - if err != nil { - printErrorAndExit(2, "The output file cannot be written", err.Error()) - } - - // close fo on exit and check for its returned error - defer func() { - if err := file.Close(); err != nil { - printErrorAndExit(2, "The output file cannot be written", err.Error()) - } - }() - - err = t.Execute(file, d) - if err != nil { - return err - } - - } else { - - err = t.Execute(os.Stdout, d) - if err != nil { - return err - } - } - - } - - return nil - -} - -func getAdjustedContent(absolute string) string { - - content, err := os.ReadFile(absolute) - if err != nil { - printError("The file cannot be read", absolute) - return "" - } - - err, def := splitYamlParts(content) - if err != nil { - printError(err.Error()) - return "" - } - - s := convertImages(def.content, path.Dir(absolute)) - - return s -} - -func convertImages(content string, absolute string) string { - - todoRegEx := regexp.MustCompile(`(?P<match>\!\[(?P<label>[^]]*)\]\((?P<path>[^)]*)\))`) - - matches := todoRegEx.FindAllStringSubmatch(content, -1) - if matches == nil { - return content - } - - for _, match := range matches { - result := make(map[string]string) - for i, name := range todoRegEx.SubexpNames() { - if i != 0 && name != "" { - result[name] = match[i] - } - } - - if filepath.IsAbs(result["path"]) { - continue - } - - path := path.Clean(absolute + "/" + result["path"]) - content = strings.Replace(content, result["match"], "!["+result["label"]+"]("+path+")", -1) - - } - - return content -} - -func convertTemplateLogo(content string, absolute string) string { - todoRegEx := regexp.MustCompile(`(?m)^(?P<match>logo:\s*"?(?P<path>[^"\n]*)"?\s*)$`) - - matches := todoRegEx.FindAllStringSubmatch(content, -1) - if matches == nil { - return content - } - - for _, match := range matches { - result := make(map[string]string) - for i, name := range todoRegEx.SubexpNames() { - if i != 0 && name != "" { - result[name] = match[i] - } - } - - if filepath.IsAbs(result["path"]) { - continue - } - - path := path.Clean(absolute + "/" + result["path"]) - content = strings.Replace(content, result["match"], "logo: \""+path+"\"", -1) - - } - - return content -} - -func convertTemplateLatexLogo(content string, absolute string) string { - todoRegEx := regexp.MustCompile(`(?m)(?P<match>\\includegraphics[^{]*\{(?P<path>[^}]*)\})`) - - matches := todoRegEx.FindAllStringSubmatch(content, -1) - if matches == nil { - return content - } - - for _, match := range matches { - result := make(map[string]string) - for i, name := range todoRegEx.SubexpNames() { - if i != 0 && name != "" { - result[name] = match[i] - } - } - - if filepath.IsAbs(result["path"]) { - continue - } - - path := path.Clean(absolute + "/" + result["path"]) - a := strings.Replace(result["match"], result["path"], path, -1) - - content = strings.Replace(content, result["match"], a, -1) - - } - - return content -} - -func convertTemplateImages(content string, absolute string) string { - content = convertTemplateLogo(content, absolute) - content = convertTemplateLatexLogo(content, absolute) - - return content - -} - -func validateColumns(columns []string) []string { - - //for i, column := range columns { - // columns[i] = printer.Sprintf(column) - //} - - // VALIDATE COLUMS NAME - - // - //for _, name := range config.Documents.Columns { - // - // field := reflect.Indirect(r).FieldByName(name) - // if field == (reflect.Value{}) { - // printError("the specified column " + name + " for the table does not exist") - // continue - - // } - - return columns - -} diff --git a/application/source/translations/catalog.go b/application/source/translations/catalog.go new file mode 100644 index 0000000000000000000000000000000000000000..34454b8fb8d008b8bb655274daa0d4656f7c7d68 --- /dev/null +++ b/application/source/translations/catalog.go @@ -0,0 +1,113 @@ +// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. + +package translations + +import ( + "golang.org/x/text/language" + "golang.org/x/text/message" + "golang.org/x/text/message/catalog" +) + +type dictionary struct { + index []uint32 + data string +} + +func (d *dictionary) Lookup(key string) (data string, ok bool) { + p, ok := messageKeyToIndex[key] + if !ok { + return "", false + } + start, end := d.index[p], d.index[p+1] + if start == end { + return "", false + } + return d.data[start:end], true +} + +func init() { + dict := map[string]catalog.Dictionary{ + "de": &dictionary{index: deIndex, data: deData}, + "en": &dictionary{index: enIndex, data: enData}, + } + fallback := language.MustParse("en") + cat, err := catalog.NewFromMap(dict, catalog.Fallback(fallback)) + if err != nil { + panic(err) + } + message.DefaultCatalog = cat +} + +var messageKeyToIndex = map[string]int{ + "Error": 0, + "Info": 2, + "No active command found": 19, + "Not permitted": 3, + "This program can be used to create documentation for your project.": 20, + "This program can be used to create documentation for your project. It can be used to create a new documentation project, add new documentation to an existing project, or to generate documentation from a source code project.": 21, + "Unknown Error: %s": 18, + "Warn": 1, + "build: %s\n": 30, + "duplicated flag": 12, + "expected argument": 5, + "flag error unknown": 4, + "handler %s not found": 22, + "invalid choice": 15, + "invalid tag": 16, + "long document": 24, + "long document add": 26, + "long version": 28, + "marshal": 8, + "no argument for bool": 9, + "required": 10, + "short document": 23, + "short document add": 25, + "short name too long": 11, + "short version": 27, + "tag": 13, + "unknown command": 14, + "unknown flag": 6, + "unknown group": 7, + "unrecognized error type": 17, + "version: %s\n": 29, +} + +var deIndex = []uint32{ // 32 elements + 0x00000000, 0x00000007, 0x0000000f, 0x00000014, + 0x00000014, 0x00000014, 0x00000014, 0x00000014, + 0x00000014, 0x00000014, 0x00000014, 0x00000014, + 0x00000014, 0x00000014, 0x00000014, 0x00000014, + 0x00000014, 0x00000014, 0x00000014, 0x00000014, + 0x00000014, 0x00000014, 0x00000014, 0x00000014, + 0x00000014, 0x00000014, 0x00000014, 0x00000014, + 0x00000014, 0x00000014, 0x00000014, 0x00000014, +} // Size: 152 bytes + +const deData string = "\x02Fehler\x02Warnung\x02Info" + +var enIndex = []uint32{ // 32 elements + 0x00000000, 0x00000006, 0x0000000b, 0x00000010, + 0x0000001e, 0x00000031, 0x00000043, 0x00000050, + 0x0000005e, 0x00000066, 0x0000007b, 0x00000084, + 0x00000098, 0x000000a8, 0x000000ac, 0x000000bc, + 0x000000cb, 0x000000d7, 0x000000ef, 0x00000104, + 0x0000011c, 0x0000015f, 0x0000023f, 0x00000257, + 0x00000266, 0x00000274, 0x00000287, 0x00000299, + 0x000002a7, 0x000002b4, 0x000002c8, 0x000002da, +} // Size: 152 bytes + +const enData string = "" + // Size: 730 bytes + "\x02Error\x02Warn\x02Info\x02Not permitted\x02flag error unknown\x02expe" + + "cted argument\x02unknown flag\x02unknown group\x02marshal\x02no argument" + + " for bool\x02required\x02short name too long\x02duplicated flag\x02tag" + + "\x02unknown command\x02invalid choice\x02invalid tag\x02unrecognized err" + + "or type\x02Unknown Error: %[1]s\x02No active command found\x02This progr" + + "am can be used to create documentation for your project.\x02This program" + + " can be used to create documentation for your project. It can be used to" + + " create a new documentation project, add new documentation to an existin" + + "g project, or to generate documentation from a source code project.\x02h" + + "andler %[1]s not found\x02short document\x02long document\x02short docum" + + "ent add\x02long document add\x02short version\x02long version\x04\x00" + + "\x01\x0a\x0f\x02version: %[1]s\x04\x00\x01\x0a\x0d\x02build: %[1]s" + + // Total table size 1054 bytes (1KiB); checksum: 2EA20D06 diff --git a/application/source/translations/locales/de/messages.gotext.json b/application/source/translations/locales/de/messages.gotext.json new file mode 100644 index 0000000000000000000000000000000000000000..8b66a4d2b2a0b0d61357fd9624231e03467d58b6 --- /dev/null +++ b/application/source/translations/locales/de/messages.gotext.json @@ -0,0 +1,34 @@ +{ + "language": "de", + "messages": [ + { + "id": "Error: {Arg_1}", + "message": "Error: {Arg_1}", + "translation": "Fehler: {Arg_1}", + "placeholders": [ + { + "id": "Arg_1", + "string": "%[1]s", + "type": "", + "underlyingType": "string", + "argNum": 1 + } + ] + }, + { + "id": "Error", + "message": "Error", + "translation": "Fehler" + }, + { + "id": "Warn", + "message": "Warn", + "translation": "Warnung" + }, + { + "id": "Info", + "message": "Info", + "translation": "Info" + } + ] +} \ No newline at end of file diff --git a/application/source/translations/locales/de/out.gotext.json b/application/source/translations/locales/de/out.gotext.json new file mode 100644 index 0000000000000000000000000000000000000000..7027e2a781c07e823d1cfb7191c4083dfe63729c --- /dev/null +++ b/application/source/translations/locales/de/out.gotext.json @@ -0,0 +1,198 @@ +{ + "language": "de", + "messages": [ + { + "id": "Not permitted", + "message": "Not permitted", + "translation": "" + }, + { + "id": "flag error unknown", + "message": "flag error unknown", + "translation": "" + }, + { + "id": "expected argument", + "message": "expected argument", + "translation": "" + }, + { + "id": "unknown flag", + "message": "unknown flag", + "translation": "" + }, + { + "id": "unknown group", + "message": "unknown group", + "translation": "" + }, + { + "id": "marshal", + "message": "marshal", + "translation": "" + }, + { + "id": "no argument for bool", + "message": "no argument for bool", + "translation": "" + }, + { + "id": "required", + "message": "required", + "translation": "" + }, + { + "id": "short name too long", + "message": "short name too long", + "translation": "" + }, + { + "id": "duplicated flag", + "message": "duplicated flag", + "translation": "" + }, + { + "id": "tag", + "message": "tag", + "translation": "" + }, + { + "id": "unknown command", + "message": "unknown command", + "translation": "" + }, + { + "id": "invalid choice", + "message": "invalid choice", + "translation": "" + }, + { + "id": "invalid tag", + "message": "invalid tag", + "translation": "" + }, + { + "id": "unrecognized error type", + "message": "unrecognized error type", + "translation": "" + }, + { + "id": "Unknown Error: {Arg_1}", + "message": "Unknown Error: {Arg_1}", + "translation": "", + "placeholders": [ + { + "id": "Arg_1", + "string": "%[1]s", + "type": "", + "underlyingType": "string", + "argNum": 1 + } + ] + }, + { + "id": "Error", + "message": "Error", + "translation": "Fehler" + }, + { + "id": "Warn", + "message": "Warn", + "translation": "Warnung" + }, + { + "id": "Info", + "message": "Info", + "translation": "Info" + }, + { + "id": "No active command found", + "message": "No active command found", + "translation": "" + }, + { + "id": "This program can be used to create documentation for your project.", + "message": "This program can be used to create documentation for your project.", + "translation": "" + }, + { + "id": "This program can be used to create documentation for your project. It can be used to create a new documentation project, add new documentation to an existing project, or to generate documentation from a source code project.", + "message": "This program can be used to create documentation for your project. It can be used to create a new documentation project, add new documentation to an existing project, or to generate documentation from a source code project.", + "translation": "" + }, + { + "id": "handler {Arg_1} not found", + "message": "handler {Arg_1} not found", + "translation": "", + "placeholders": [ + { + "id": "Arg_1", + "string": "%[1]s", + "type": "", + "underlyingType": "string", + "argNum": 1 + } + ] + }, + { + "id": "short document", + "message": "short document", + "translation": "" + }, + { + "id": "long document", + "message": "long document", + "translation": "" + }, + { + "id": "short document add", + "message": "short document add", + "translation": "" + }, + { + "id": "long document add", + "message": "long document add", + "translation": "" + }, + { + "id": "short version", + "message": "short version", + "translation": "" + }, + { + "id": "long version", + "message": "long version", + "translation": "" + }, + { + "id": "version: {Version}", + "message": "version: {Version}", + "translation": "", + "placeholders": [ + { + "id": "Version", + "string": "%[1]s", + "type": "string", + "underlyingType": "string", + "argNum": 1, + "expr": "state.info.Version" + } + ] + }, + { + "id": "build: {Build}", + "message": "build: {Build}", + "translation": "", + "placeholders": [ + { + "id": "Build", + "string": "%[1]s", + "type": "string", + "underlyingType": "string", + "argNum": 1, + "expr": "state.info.Build" + } + ] + } + ] +} \ No newline at end of file diff --git a/application/source/translations/locales/en/out.gotext.json b/application/source/translations/locales/en/out.gotext.json new file mode 100644 index 0000000000000000000000000000000000000000..04d827f1df11a6b872264b0aa228d2fc267d7f83 --- /dev/null +++ b/application/source/translations/locales/en/out.gotext.json @@ -0,0 +1,260 @@ +{ + "language": "en", + "messages": [ + { + "id": "Not permitted", + "message": "Not permitted", + "translation": "Not permitted", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "flag error unknown", + "message": "flag error unknown", + "translation": "flag error unknown", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "expected argument", + "message": "expected argument", + "translation": "expected argument", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "unknown flag", + "message": "unknown flag", + "translation": "unknown flag", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "unknown group", + "message": "unknown group", + "translation": "unknown group", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "marshal", + "message": "marshal", + "translation": "marshal", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "no argument for bool", + "message": "no argument for bool", + "translation": "no argument for bool", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "required", + "message": "required", + "translation": "required", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "short name too long", + "message": "short name too long", + "translation": "short name too long", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "duplicated flag", + "message": "duplicated flag", + "translation": "duplicated flag", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "tag", + "message": "tag", + "translation": "tag", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "unknown command", + "message": "unknown command", + "translation": "unknown command", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "invalid choice", + "message": "invalid choice", + "translation": "invalid choice", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "invalid tag", + "message": "invalid tag", + "translation": "invalid tag", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "unrecognized error type", + "message": "unrecognized error type", + "translation": "unrecognized error type", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "Unknown Error: {Arg_1}", + "message": "Unknown Error: {Arg_1}", + "translation": "Unknown Error: {Arg_1}", + "translatorComment": "Copied from source.", + "placeholders": [ + { + "id": "Arg_1", + "string": "%[1]s", + "type": "", + "underlyingType": "string", + "argNum": 1 + } + ], + "fuzzy": true + }, + { + "id": "Error", + "message": "Error", + "translation": "Error", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "Warn", + "message": "Warn", + "translation": "Warn", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "Info", + "message": "Info", + "translation": "Info", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "No active command found", + "message": "No active command found", + "translation": "No active command found", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "This program can be used to create documentation for your project.", + "message": "This program can be used to create documentation for your project.", + "translation": "This program can be used to create documentation for your project.", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "This program can be used to create documentation for your project. It can be used to create a new documentation project, add new documentation to an existing project, or to generate documentation from a source code project.", + "message": "This program can be used to create documentation for your project. It can be used to create a new documentation project, add new documentation to an existing project, or to generate documentation from a source code project.", + "translation": "This program can be used to create documentation for your project. It can be used to create a new documentation project, add new documentation to an existing project, or to generate documentation from a source code project.", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "handler {Arg_1} not found", + "message": "handler {Arg_1} not found", + "translation": "handler {Arg_1} not found", + "translatorComment": "Copied from source.", + "placeholders": [ + { + "id": "Arg_1", + "string": "%[1]s", + "type": "", + "underlyingType": "string", + "argNum": 1 + } + ], + "fuzzy": true + }, + { + "id": "short document", + "message": "short document", + "translation": "short document", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "long document", + "message": "long document", + "translation": "long document", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "short document add", + "message": "short document add", + "translation": "short document add", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "long document add", + "message": "long document add", + "translation": "long document add", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "short version", + "message": "short version", + "translation": "short version", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "long version", + "message": "long version", + "translation": "long version", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "version: {Version}", + "message": "version: {Version}", + "translation": "version: {Version}", + "translatorComment": "Copied from source.", + "placeholders": [ + { + "id": "Version", + "string": "%[1]s", + "type": "string", + "underlyingType": "string", + "argNum": 1, + "expr": "state.info.Version" + } + ], + "fuzzy": true + }, + { + "id": "build: {Build}", + "message": "build: {Build}", + "translation": "build: {Build}", + "translatorComment": "Copied from source.", + "placeholders": [ + { + "id": "Build", + "string": "%[1]s", + "type": "string", + "underlyingType": "string", + "argNum": 1, + "expr": "state.info.Build" + } + ], + "fuzzy": true + } + ] +} \ No newline at end of file diff --git a/application/source/translations/translations.go b/application/source/translations/translations.go new file mode 100644 index 0000000000000000000000000000000000000000..e1168f0824341ece80caf6ede10aeecfaecad8ca --- /dev/null +++ b/application/source/translations/translations.go @@ -0,0 +1,59 @@ +package translations + +//go:generate gotext -srclang=en update -out=catalog.go -lang=en,de gitlab.schukai.com/oss/utilities/documentation-manager + +import ( + "golang.org/x/text/language" + "golang.org/x/text/message" + "os" + "strings" +) + +var T *L10n + +func init() { + T = &L10n{} + T.init() +} + +type L10n struct { + tag language.Tag + printer *message.Printer +} + +func (t *L10n) Printf(format string, args ...interface{}) { + t.GetPrinter().Printf(format, args...) +} + +func (t *L10n) Sprintf(format string, args ...interface{}) string { + return t.GetPrinter().Sprintf(format, args...) +} + +func (t *L10n) GetPrinter() *message.Printer { + if t.printer == nil { + t.printer = message.NewPrinter(t.tag) + } + return t.printer +} + +func (t *L10n) init() { + + defer func() { + if r := recover(); r != nil { + t.tag = language.English + } + }() + + lang := os.Getenv("LANGUAGE") + if lang == "" { + lang = os.Getenv("LANG") + } + + parts := strings.Split(lang, ".") + if len(parts) > 0 { + lang = parts[0] + } + + t.tag = language.MustParse(lang) + +} diff --git a/development/examples/example1/doc.pdf b/development/examples/example1/doc.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8ad413ac277a4914b5ee448a41c55a20194435cb Binary files /dev/null and b/development/examples/example1/doc.pdf differ diff --git a/development/examples/example1/feature-1.md b/development/examples/example1/feature-1.md index 87ec59254485c39a3345563dccbf724e2f2ae37a..ee172b680dca741f96d65e0ea2c91aba635378b2 100644 --- a/development/examples/example1/feature-1.md +++ b/development/examples/example1/feature-1.md @@ -1,13 +1,63 @@ + --- +# Document title +Title: New Document + +# keywords mainly used for searching +Keywords: +- Document + +# First and last name of the authors as a list +Author: +- Me + +Created: 2022-07-01 +Last Update: 2022-07-01 + +Language: de -Last Updated: 2020-01-01 ... -# First Feature +### {{ .Title }} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. + + + +- [ ] do it +- [ ] 2022-12-01 do it + + +Name | Age +--------|------ +Bob || +Alice | 23 +========|====== +Total | 23 + +{#id3 .myclass fontsize="tiny"} +# Header 1 + + +```go +func getTrue() bool { + return true +} +``` + +Cat +: Fluffy animal everyone likes + +Internet +: Vector of transmission for pictures of cats + + +This is a footnote.[^1] + +[^1]: the footnote text. + -This is the first feature of the application. +https://www.schukai.com/ -- [ ] task 1 -- [ ] tast 2 -- [x] 2022-12-13 task 3 with due date +--strike through-- diff --git a/development/examples/example1/feature-2.md b/development/examples/example1/feature-2.md new file mode 100644 index 0000000000000000000000000000000000000000..1f612868a916d21122bd5bf534683978cd8c1ce9 --- /dev/null +++ b/development/examples/example1/feature-2.md @@ -0,0 +1,64 @@ + +--- +# Document title +Title: New Document 2 + +# keywords mainly used for searching +Keywords: +- Document +- HTML +- Markdown + +# First and last name of the authors as a list +Author: +- null + +Created: 2022-07-02 +Last Update: 2022-07-02 + +Language: en + +... + +### {{ .Title }} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. + + + +- [ ] do it +- [ ] 2022-12-01 do it + + +Name | Age +--------|------ +Bob || +Alice | 23 +========|====== +Total | 23 + +{#id3 .myclass fontsize="tiny"} +# Header 1 + + +```go +func getTrue() bool { + return true +} +``` + +Cat +: Fluffy animal everyone likes + +Internet +: Vector of transmission for pictures of cats + + +This is a footnote.[^1] + +[^1]: the footnote text. + + +https://www.schukai.com/ + +--strike through-- diff --git a/application/source/changelog.go b/development/temp/changelog.go similarity index 88% rename from application/source/changelog.go rename to development/temp/changelog.go index c73465b6aa5bf0d0c787972e1a5977056303e73f..fd4fa6f3c21c7ed941c80e85ff4e893bf49ad6ff 100644 --- a/application/source/changelog.go +++ b/development/temp/changelog.go @@ -8,15 +8,16 @@ import ( type logs []string -func buildChangelog(pageMap map[string]*document) (error, string, bool) { +func buildChangelog(pageMap map[string]*documentContent) (error, string, bool) { changelog := make(map[string]logs) datemap := make(map[string]string) for _, q := range pageMap { - p := *q + s := *q + p := s.meta - title := strings.Trim(p.Name, " ") + title := strings.Trim(p.Title, " ") if title == "" { title = printer.Sprintf("Untitled") } diff --git a/application/source/commandline.go b/development/temp/commandline.go similarity index 58% rename from application/source/commandline.go rename to development/temp/commandline.go index 3c6030260f401b4dfee6c73df6d3ba988d56c8b3..e5cb29ab2e98b297a8b4e35b1665f93d5ddee239 100644 --- a/application/source/commandline.go +++ b/development/temp/commandline.go @@ -28,6 +28,11 @@ func executeCommand() { config.Path = arguments.Path } + arguments.Path, err = filepath.Abs(arguments.Path) + if err != nil { + printErrorAndExit(2, "Unknown Error", err.Error()) + } + if arguments.DateFormat != "" { config.Locale.DateFormat = arguments.DateFormat } @@ -62,40 +67,51 @@ func executeCommand() { } } - case "document": - subcommand := activeCommand.Active - switch subcommand.Name { - case "add": - config.Requirement.Template.Add = defaultNewRequirementTemplate - err := addDocument() - if err != nil { - printErrorAndExit(2, err.Error()) - } + case "add": + if config.Document.Template.Add == "" { + config.Document.Template.Add = defaultNewDocumentTemplate + } + + err := addDocument() + if err != nil { + printErrorAndExit(2, err.Error()) } case "build": + subcommand := activeCommand.Active switch subcommand.Name { - case "print": + case "html": - if len(arguments.Build.Print.Columns) > 0 { - config.Requirement.Table.Columns = validateColumns(arguments.Build.Print.Columns) + if arguments.Build.HTML.TemplatePath != "" { + config.HTML.Template.Internal.HTMLContent = readTemplate(arguments.Build.HTML.TemplatePath) + } else if config.HTML.Template.HTML != "" { + config.HTML.Template.Internal.HTMLContent = readTemplate(config.HTML.Template.HTML) + } else { + config.HTML.Template.Internal.HTMLContent = defaultHTMLTemplate } - if arguments.Build.Print.TemplatePath != "" { - config.Overview.Template.Internal.MarkdownContent = readTemplate(arguments.Build.Print.TemplatePath) - } else if config.Overview.Template.Markdown != "" { - config.Overview.Template.Internal.MarkdownContent = readTemplate(config.Overview.Template.Markdown) + err := createHTML() + if err != nil { + printErrorAndExit(2, err.Error()) + } + + case "pdf": + + if arguments.Build.PDF.TemplatePath != "" { + config.PDF.Template.Internal.MarkdownContent = readTemplate(arguments.Build.PDF.TemplatePath) + } else if config.PDF.Template.Markdown != "" { + config.PDF.Template.Internal.MarkdownContent = readTemplate(config.PDF.Template.Markdown) } else { - config.Overview.Template.Internal.MarkdownContent = defaultOverviewTemplate + config.PDF.Template.Internal.MarkdownContent = defaultPDFTemplate } - if arguments.Build.Print.LatexTemplatePath != "" { - config.Overview.Template.Latex = arguments.Build.Print.LatexTemplatePath + if arguments.Build.PDF.LatexTemplatePath != "" { + config.PDF.Template.Latex = arguments.Build.PDF.LatexTemplatePath } - err := PrintOverview() + err := CreatePDF() if err != nil { printErrorAndExit(2, err.Error()) } diff --git a/development/temp/commandlineoptions.go b/development/temp/commandlineoptions.go new file mode 100644 index 0000000000000000000000000000000000000000..4baf8620c5266b89e107d2e95b6cfc36284e5a30 --- /dev/null +++ b/development/temp/commandlineoptions.go @@ -0,0 +1,31 @@ +package main + +type commandLineOptions struct { + Config string `short:"c" long:"config" description:"file with configuration values"` + Path string `short:"p" long:"path" description:"define the path where the specifications are located" default:"."` + DateFormat string `long:"date-format" description:"date format" default:"2006-01-02"` + Add struct { + Name string `short:"n" long:"name" description:"name of the document"` + } `command:"add"` + Tasks struct { + Print struct { + } `command:"print"` + } `command:"tasks"` + Changelog struct { + Print struct { + } `command:"print"` + } `command:"changelog"` + Build struct { + PDF struct { + TemplatePath string `short:"t" long:"template" description:"file name of the template of the pages"` + Output string `short:"o" long:"output" description:"output file name"` + LatexTemplatePath string `short:"l" long:"latex-template-path" description:"latex template"` + } `command:"pdf"` + HTML struct { + TemplatePath string `short:"t" long:"template" description:"file name of the template of a html page"` + Output string `short:"o" long:"output" description:"output directory"` + } `command:"html"` + } `command:"build"` + Version struct { + } `command:"version"` +} diff --git a/application/source/config.go b/development/temp/config.go similarity index 82% rename from application/source/config.go rename to development/temp/config.go index 26fd3db624dc935ac833a1cd8abf9f3f8124793f..abacd27af9be0919fcebf8aee1c0f46e071a5d92 100644 --- a/application/source/config.go +++ b/development/temp/config.go @@ -17,7 +17,7 @@ type configPathsStruct struct { var ( configPaths = configPathsStruct{ - main: "/etc/requirements-manager/config.yaml", + main: "/etc/documentations-manager/config.yaml", } ) @@ -29,28 +29,30 @@ type Configuration struct { DateFormat string `yaml:"DateFormat"` } `yaml:"Locale"` - Gitlab struct { - Token string `yaml:"Token"` - } `yaml:"Gitlab"` - - Overview struct { + PDF struct { Template struct { Markdown string `yaml:"Markdown"` Latex string `yaml:"Latex"` Internal struct { MarkdownContent string - } + } `yaml:"-"` + } `yaml:"Template"` + } `yaml:"PDF"` + + HTML struct { + Template struct { + HTML string `yaml:"HTML"` + Internal struct { + HTMLContent string + } `yaml:"-"` } `yaml:"Template"` - } `yaml:"Build"` + } - Requirement struct { - Table struct { - Columns []string `yaml:"Columns"` - } `yaml:"Table"` + Document struct { Template struct { Add string `yaml:"Add"` } `yaml:"Template"` - } `yaml:"Requirement"` + } `yaml:"Document"` } func fileExists(name string) (found bool) { @@ -74,7 +76,7 @@ func NewConfiguration(argConfigPath string) *Configuration { usr, err := user.Current() if err == nil { - configPaths.user = usr.HomeDir + "/.config/requirements-manager/config.yaml" + configPaths.user = usr.HomeDir + "/.config/documentations-manager/config.yaml" } if argConfigPath != "" { diff --git a/development/temp/dataset.go b/development/temp/dataset.go new file mode 100644 index 0000000000000000000000000000000000000000..b1dbc32db497416d464bbead8692a2c9e1656cf2 --- /dev/null +++ b/development/temp/dataset.go @@ -0,0 +1,80 @@ +package main + +import ( + "sort" + "time" +) + +type Dataset struct { + Config *Configuration + Meta string + HasMeta bool + HasChangelog bool + Changelog string + Tasks string + HasTasks bool + Documents string + HasDocuments bool + Created time.Time + CreatedFormat string + Description string + HasDescription bool + Title string + HasTitle bool + keys []string +} + +const flagInitChangelog = 1 +const flagInitTasks = 2 +const flagInitDocuments = 4 + +func getDataset(pageData map[string]*documentContent, flags int) (*Dataset, error) { + + keys := make([]string, 0, len(pageData)) + for k := range pageData { + keys = append(keys, k) + } + + sort.Strings(keys) + + d := &Dataset{} + + d.keys = keys + + if flags&flagInitChangelog != 0 { + err, changelog, hasChangelog := buildChangelog(pageData) + if err != nil { + return nil, err + } + d.Changelog = changelog + d.HasChangelog = hasChangelog + } + + if flags&flagInitTasks != 0 { + err, tasks, hasTasks := buildTasksTable(pageData, false) + if err != nil { + return nil, err + } + + d.Tasks = tasks + d.HasTasks = hasTasks + } + + if flags&flagInitDocuments != 0 { + documents := "" + + for _, k := range d.keys { + d.HasDocuments = true + p := pageData[k].meta + documents = documents + convertToHtml(getAdjustedContent(p.Absolute)) + } + + d.Documents = documents + } + + d.Config = config + d.Created = time.Now() + d.CreatedFormat = time.Now().Format(config.Locale.DateFormat) + + return d, nil +} diff --git a/development/temp/defaults.go b/development/temp/defaults.go new file mode 100644 index 0000000000000000000000000000000000000000..6888cf4cb82635ad2c3e605ede74fbcab6334093 --- /dev/null +++ b/development/temp/defaults.go @@ -0,0 +1,69 @@ +package main + +const exitOK = 0 + +const exitCodeCatchAll = 1 + +// language: html +const defaultHTMLTemplate = `<!DOCTYPE html> +{{ if .HasLanguage }} +<html lang="{{.Language}}"> +{{ else }} +<html> +{{ end }} +<head> + <meta charset="UTF-8"/> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name='viewport' + content='width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no'> + <title>{{.Title}}</title> + {{if .HasCanonical }} + <link rel="canonical" href="{{.Canonical}}"> + {{end}} + {{if .HasDescription }} + <meta name="description" content="{{.Description}}"> + {{end}} + + <style> + body { + padding: 0px; + margin: 0px; + } + </style> +</head> +<body> +{{ if .HasBody }}{{.Body}}{{ end }} +</body> +</html>` + +const defaultPDFTemplate = ` +<!DOCTYPE html> +<html lang="de"> +<head> + +<body> +--- +block-headings: true +... + +{{ if .HasChangelog }} +## Changelog + +{{.Changelog}} + +{{ end}}{{ if .HasTasks }} +## Tasks + +{{.Tasks}} + +{{ end}}{{ if .HasDocuments }} +## Documents + +{{.Documents}} + +{{ end}} + +</body> +</html> + +` diff --git a/development/temp/documents.go b/development/temp/documents.go new file mode 100644 index 0000000000000000000000000000000000000000..0684d558536023aea3b53780100fc2536ad02195 --- /dev/null +++ b/development/temp/documents.go @@ -0,0 +1,54 @@ +package main + +import ( + "os" + "path" + "strings" + "time" + + "gopkg.in/yaml.v3" +) + +type document struct { + ToDos []task `yaml:"-"` + Absolute string `yaml:"-"` + File string `yaml:"-"` + + // remember the node structure of yaml + OriginNode *yaml.Node `yaml:"-"` + OriginText string `yaml:"-"` + + Title string `yaml:"Title"` + Abbreviation string `yaml:"Abbreviation"` + References []string `yaml:"References"` + Keywords []string `yaml:"Keywords"` + Authors []string `yaml:"Authors"` + Version string `yaml:"Version"` + Created time.Time `yaml:"Created"` + LastUpdate time.Time `yaml:"Last Update"` + Language string `yaml:"Language"` +} + +func addDocument() error { + + if arguments.Add.Name == "" { + printErrorAndExit(2, "the name must not be empty") + } + + p := path.Join(arguments.Path, arguments.Add.Name+".md") + if fileExists(p) { + printErrorAndExit(2, "the document with name already exists", arguments.Add.Name, p) + } + + t := config.Document.Template.Add + t = strings.Replace(t, "%%ID%%", arguments.Add.Name, -1) + t = strings.Replace(t, "%%CREATED%%", time.Now().Format("2006-01-02"), -1) + + d1 := []byte(t) + err := os.WriteFile(p, d1, 0644) + if err != nil { + return err + } + + return nil +} diff --git a/application/source/errors.go b/development/temp/errors.go similarity index 100% rename from application/source/errors.go rename to development/temp/errors.go diff --git a/application/source/files.go b/development/temp/files.go similarity index 89% rename from application/source/files.go rename to development/temp/files.go index 8cbd8ead2efd03f5d4d059b1bb807ff0b1b58960..afb290e3a3d68b9b0762637f6301d720b9fd349b 100644 --- a/application/source/files.go +++ b/development/temp/files.go @@ -11,11 +11,11 @@ import ( "gopkg.in/yaml.v3" ) -func collectStructureFromFiles(directory string) (error, map[string]*document) { +func collectStructureFromFiles(directory string) (error, map[string]*documentContent) { cleanedDirectory, err := filepath.Abs(path.Clean(directory)) - pageMap := make(map[string]*document) + pageMap := make(map[string]*documentContent) err = filepath.Walk(cleanedDirectory, func(current string, info os.FileInfo, err error) error { @@ -50,13 +50,13 @@ func collectStructureFromFiles(directory string) (error, map[string]*document) { bp := []byte(cleanedPath) bs := string(bp[len(bd):len(bp)]) - p.data.File = "." + bs - p.data.Absolute = cleanedPath - p.data.ToDos = findTask(content) + p.meta.File = "." + bs + p.meta.Absolute = cleanedPath + p.meta.ToDos = findTask(content) k := cleanedPath - pageMap[k] = &p.data + pageMap[k] = &p return nil }) diff --git a/development/temp/html.go b/development/temp/html.go new file mode 100644 index 0000000000000000000000000000000000000000..48686c6fa59a4d5df3cabe9f17e181ccef6aff7c --- /dev/null +++ b/development/temp/html.go @@ -0,0 +1,149 @@ +package main + +import ( + "fmt" + "github.com/gomarkdown/markdown" + "github.com/gomarkdown/markdown/html" + "github.com/gomarkdown/markdown/parser" + "html/template" + "os" + "path" + "time" +) + +type PageDataset struct { + Body string + HasBody bool + Created time.Time + CreatedFormat string + Updated time.Time + UpdatedFormat string + Language string + HasLanguage bool + + //Config *Configuration + //Meta string + //HasMeta bool + //HasChangelog bool + //Changelog string + //Tasks string + //HasTasks bool + //Documents string + //HasDocuments bool + //Language string + //HasLanguage bool + //Canonical string + //HasCanonical bool + //Description string + //HasDescription bool + //Title string + //HasTitle bool + //Body string + //HasBody bool + //keys []string +} + +func createHTML() error { + + err, pageData := collectStructureFromFiles(config.Path) + if err != nil { + return err + } + + dataset, err := getDataset(pageData, 0) + fmt.Println(dataset) + if err != nil { + return err + } + + for _, p := range pageData { + fmt.Println(p.text) + d := &PageDataset{ + //Created: p.created, + //CreatedFormat: p.createdFormat, + //Updated: p.updated, + //UpdatedFormat: p.updatedFormat, + //Language: p.language, + //HasLanguage: p.hasLanguage, + } + + fmt.Printf(d.CreatedFormat) + //initBody(d, pageData) + //err = createHTMLFile(p, d) + //if err != nil { + // return err + //} + } + + return nil +} + +//func initBody(d *Dataset, pageData map[string]*documentContent) { +// +// d.Body = "" +// d.HasBody = false +// +// for _, k := range d.keys { +// d.HasBody = true +// p := pageData[k].meta +// d.Body = d.Body + getAdjustedContent(p.Absolute) +// } +// +//} + +func convertToHtml(text string) string { + extensions := parser.CommonExtensions | parser.AutoHeadingIDs | parser.Footnotes | parser.SuperSubscript | parser.Includes | parser.Attributes + parser := parser.NewWithExtensions(extensions) + + htmlFlags := html.CommonFlags | html.HrefTargetBlank + opts := html.RendererOptions{Flags: htmlFlags} + renderer := html.NewRenderer(opts) + + md := []byte(text) + return string(markdown.ToHTML(md, parser, renderer)) + +} + +func createHTMLFile(p *documentContent, d *PageDataset) error { + + if d.Body == "" { + d.HasBody = false + } else { + d.HasBody = true + } + + t, err := template.New("pdf").Parse(config.PDF.Template.Internal.MarkdownContent) + if err != nil { + return err + } + + outputDir := arguments.Build.HTML.Output + if outputDir == "" { + printErrorAndExit(2, "if the type is html, the output option must be specified") + } + + if !path.IsAbs(outputDir) { + outputDir = path.Join(config.Path, outputDir) + } + + fileinfo, err := os.Stat(outputDir) + if os.IsNotExist(err) { + printErrorAndExit(2, "The file %s does not exist", outputDir) + } + if !fileinfo.IsDir() { + printErrorAndExit(2, "The file %s is not a directory", outputDir) + } + + fileName := path.Join(outputDir, ".html") + file, err := os.Create(fileName) + if err != nil { + return err + } + + err = t.Execute(file, d) + if err != nil { + return err + } + + return nil +} diff --git a/application/source/l10n.go b/development/temp/l10n.go similarity index 94% rename from application/source/l10n.go rename to development/temp/l10n.go index b4fd1fe37ae506947650afdb5efccef4f9b291e4..b42be045ed64e585b20313ef3ac473e403809f84 100644 --- a/application/source/l10n.go +++ b/development/temp/l10n.go @@ -228,10 +228,10 @@ var l10nMap = []l10nKeyTranslation{ }, }, { - "Name", + "Title", []l10nLocaleTranslation{ - {"de", "Name"}, - {"en", "Name"}, + {"de", "Title"}, + {"en", "Title"}, }, }, { @@ -254,10 +254,10 @@ var l10nMap = []l10nKeyTranslation{ }, }, { - "the request with id already exists", + "the document with name already exists", []l10nLocaleTranslation{ - {"de", "Die Anforderung mit der ID %s existiert bereits (%s)."}, - {"en", "the request with id %s already exists (%s)."}, + {"de", "Das Dokument mit dem Namen %s existiert bereits (%s)."}, + {"en", "The document named %s already exists (%s)."}, }, }, { @@ -274,6 +274,13 @@ var l10nMap = []l10nKeyTranslation{ {"en", "if the type is pdf, the output option must be specified"}, }, }, + { + "if the type is html, the output option must be specified", + []l10nLocaleTranslation{ + {"de", "Der Tpy HTML benötigt die Option --output"}, + {"en", "if the type is html, the output option must be specified"}, + }, + }, { "Unknown Error", []l10nLocaleTranslation{ diff --git a/development/temp/main.go b/development/temp/main.go new file mode 100644 index 0000000000000000000000000000000000000000..98a67334419c517571019fcb0db21b9509baa78e --- /dev/null +++ b/development/temp/main.go @@ -0,0 +1,50 @@ +package main + +import ( + "os" + + "golang.org/x/text/language" + "golang.org/x/text/message" +) + +// Wird beim Bauen per +// -ldflags "-X main.version=$app_version -X main.build=$(due --iso-8601 | tr -d "-" )" +// gesetzt +var ( + version string = "dev" + build string = "dev" + printer *message.Printer + //sugar *zap.SugaredLogger +) + +var serverLangs = []language.Tag{ + language.English, // en fallback + language.German, // de +} + +var matcher = language.NewMatcher(serverLangs) + +var userPrefs = []language.Tag{ + language.Make(os.Getenv("LANG")), + language.Make("en"), +} + +func init() { + + initEnvironment() + + tag, _, _ := matcher.Match(userPrefs...) + printer = message.NewPrinter(tag) + + initL10n() + +} + +func initEnvironment() { +} + +/** + */ +func main() { + executeCommand() +} diff --git a/application/source/message.go b/development/temp/message.go similarity index 100% rename from application/source/message.go rename to development/temp/message.go diff --git a/application/source/pandoc.go b/development/temp/pandoc.go similarity index 83% rename from application/source/pandoc.go rename to development/temp/pandoc.go index 95ebac5f3bf8f5195fa71b7b7eb78a9dc122a456..83e501124cc97bf4eadde018d21d98981267d9a9 100644 --- a/application/source/pandoc.go +++ b/development/temp/pandoc.go @@ -5,7 +5,7 @@ import ( "os/exec" ) -func convertToPDF(source string, outputName string, latexPath string) string { +func runPandoc(source string, outputName string, latexPath string) string { arguments := "/bin/env pandoc " @@ -21,6 +21,10 @@ func convertToPDF(source string, outputName string, latexPath string) string { arguments += "--template=" + latexPath + " " } + if luaRawBlockFile != nil { + arguments += "--lua-filter=" + luaRawBlockFile.Name() + " " + } + arguments += "--columns=5 " arguments += "--highlight-style espresso " arguments += "--toc " diff --git a/development/temp/pdf.go b/development/temp/pdf.go new file mode 100644 index 0000000000000000000000000000000000000000..0f3e3d66a9c6d0ee526912300635f5f0e0d01da9 --- /dev/null +++ b/development/temp/pdf.go @@ -0,0 +1,190 @@ +package main + +import ( + "io/ioutil" + "os" + "path" + "path/filepath" + "regexp" + "strings" + "text/template" +) + +func CreatePDF() error { + + err, pageData := collectStructureFromFiles(config.Path) + if err != nil { + return err + } + + d, err := getDataset(pageData, flagInitChangelog|flagInitTasks|flagInitDocuments) + if err != nil { + return err + } + + outputName := arguments.Build.PDF.Output + + if outputName == "" { + printErrorAndExit(2, "if the type is pdf, the output option must be specified") + } + + file, err := ioutil.TempFile(os.TempDir(), "docman") + if err != nil { + printErrorAndExit(2, "A temporary file cannot be created", err.Error()) + } + defer os.Remove(file.Name()) + + t, err := template.New("pdf").Parse(config.PDF.Template.Internal.MarkdownContent) + if err != nil { + return err + } + + err = t.Execute(file, d) + if err != nil { + return err + } + + createLuaFile() + runPandoc(file.Name(), outputName, config.PDF.Template.Latex) + + if luaRawBlockFile != nil { + luaRawBlockFile.Close() + } + + return nil + +} + +var luaRawBlockFile *os.File + +func createLuaFile() { + var err error + + luaRawBlockFile, err = ioutil.TempFile(os.TempDir(), "lua-raw-block") + if err != nil { + printErrorAndExit(2, "A temporary file cannot be created", err.Error()) + } + + luaRawBlockFile.WriteString(` +function RawBlock (raw) + return raw.format:match 'html' + and pandoc.read(raw.text, 'html').blocks + or raw +end +`) + +} + +func getAdjustedContent(absolute string) string { + + content, err := os.ReadFile(absolute) + if err != nil { + printError("The file cannot be read", absolute) + return "" + } + + err, def := splitYamlParts(content) + if err != nil { + printError(err.Error()) + return "" + } + + s := convertImages(def.text, path.Dir(absolute)) + + return s +} + +func convertImages(content string, absolute string) string { + + todoRegEx := regexp.MustCompile(`(?P<match>\!\[(?P<label>[^]]*)\]\((?P<path>[^)]*)\))`) + + matches := todoRegEx.FindAllStringSubmatch(content, -1) + if matches == nil { + return content + } + + for _, match := range matches { + result := make(map[string]string) + for i, name := range todoRegEx.SubexpNames() { + if i != 0 && name != "" { + result[name] = match[i] + } + } + + if filepath.IsAbs(result["path"]) { + continue + } + + path := path.Clean(absolute + "/" + result["path"]) + content = strings.Replace(content, result["match"], "!["+result["label"]+"]("+path+")", -1) + + } + + return content +} + +func convertTemplateLogo(content string, absolute string) string { + todoRegEx := regexp.MustCompile(`(?m)^(?P<match>logo:\s*"?(?P<path>[^"\n]*)"?\s*)$`) + + matches := todoRegEx.FindAllStringSubmatch(content, -1) + if matches == nil { + return content + } + + for _, match := range matches { + result := make(map[string]string) + for i, name := range todoRegEx.SubexpNames() { + if i != 0 && name != "" { + result[name] = match[i] + } + } + + if filepath.IsAbs(result["path"]) { + continue + } + + path := path.Clean(absolute + "/" + result["path"]) + content = strings.Replace(content, result["match"], "logo: \""+path+"\"", -1) + + } + + return content +} + +func convertTemplateLatexLogo(content string, absolute string) string { + todoRegEx := regexp.MustCompile(`(?m)(?P<match>\\includegraphics[^{]*\{(?P<path>[^}]*)\})`) + + matches := todoRegEx.FindAllStringSubmatch(content, -1) + if matches == nil { + return content + } + + for _, match := range matches { + result := make(map[string]string) + for i, name := range todoRegEx.SubexpNames() { + if i != 0 && name != "" { + result[name] = match[i] + } + } + + if filepath.IsAbs(result["path"]) { + continue + } + + path := path.Clean(absolute + "/" + result["path"]) + a := strings.Replace(result["match"], result["path"], path, -1) + + content = strings.Replace(content, result["match"], a, -1) + + } + + return content +} + +func convertTemplateImages(content string, absolute string) string { + content = convertTemplateLogo(content, absolute) + content = convertTemplateLatexLogo(content, absolute) + + return content + +} diff --git a/application/source/run.go b/development/temp/run.go similarity index 100% rename from application/source/run.go rename to development/temp/run.go diff --git a/application/source/tasks.go b/development/temp/tasks.go similarity index 93% rename from application/source/tasks.go rename to development/temp/tasks.go index bac3781c5350aabd824a51f538575b90c5686b6a..52eeca3b99e9d82532a50d65175278c8c79f12bc 100644 --- a/application/source/tasks.go +++ b/development/temp/tasks.go @@ -72,7 +72,7 @@ func findTask(content []byte) []task { return toDos } -func buildTasksTable(pageMap map[string]*document, extended bool) (error, string, bool) { +func buildTasksTable(pageMap map[string]*documentContent, extended bool) (error, string, bool) { buf := new(bytes.Buffer) @@ -94,7 +94,10 @@ func buildTasksTable(pageMap map[string]*document, extended bool) (error, string var tableData [][]string - for _, pageData := range pageMap { + for _, pageDoc := range pageMap { + + pageData := pageDoc.meta + for _, info := range pageData.ToDos { has = true diff --git a/application/source/util.go b/development/temp/util.go similarity index 77% rename from application/source/util.go rename to development/temp/util.go index f3731987322271e2b120a2045a29a5f9121e2db9..46abce5061c481f733b48774642630aef5261509 100644 --- a/application/source/util.go +++ b/development/temp/util.go @@ -11,12 +11,12 @@ import ( "gopkg.in/yaml.v3" ) -type contentRequirement struct { - content string - data document +type documentContent struct { + text string + meta document } -func splitYamlParts(content []byte) (error, contentRequirement) { +func splitYamlParts(content []byte) (error, documentContent) { origin := string(content) @@ -28,15 +28,15 @@ func splitYamlParts(content []byte) (error, contentRequirement) { t := strings.TrimSpace(origin) if len(t) == 0 { - return errors.New("the file is empty"), contentRequirement{ - content: origin, - data: document{}, + return errors.New("the file is empty"), documentContent{ + text: origin, + meta: document{}, } } - return errors.New("the file does not contain a definition block"), contentRequirement{ - content: origin, - data: document{}, + return errors.New("the file does not contain a definition block"), documentContent{ + text: origin, + meta: document{}, } } @@ -55,7 +55,7 @@ func splitYamlParts(content []byte) (error, contentRequirement) { a, b, found = strings.Cut(remaining, "---") if !found { - return errors.New("the file does not contain a definition block"), contentRequirement{} + return errors.New("the file does not contain a definition block"), documentContent{} } } @@ -68,35 +68,35 @@ func splitYamlParts(content []byte) (error, contentRequirement) { t, err := template.New("overview").Parse(text) if err != nil { - return err, contentRequirement{} + return err, documentContent{} } var node yaml.Node err = yaml.Unmarshal([]byte(meta), &node) if err != nil { - return err, contentRequirement{} + return err, documentContent{} } data := document{} err = node.Decode(&data) if err != nil { - return err, contentRequirement{} + return err, documentContent{} } - req := contentRequirement{} - req.data = data + req := documentContent{} + req.meta = data - req.data.OriginNode = &node - req.data.OriginText = text + req.meta.OriginNode = &node + req.meta.OriginText = text var buffer bytes.Buffer err = t.Execute(&buffer, data) if err != nil { printError(err.Error()) - return err, contentRequirement{} + return err, documentContent{} } - req.content = buffer.String() + req.text = buffer.String() return nil, req