From 180e52fee8070f4820b077a87780e3e52e8d2063 Mon Sep 17 00:00:00 2001 From: Luca Stocchi Date: Wed, 26 Jan 2022 10:41:29 +0100 Subject: [PATCH] docs: update readme in go impl (#61) Signed-off-by: Luca Stocchi --- docs/public/alizer-spec.md | 2 +- go/README.md | 50 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 go/README.md diff --git a/docs/public/alizer-spec.md b/docs/public/alizer-spec.md index 4718022d..fc473de2 100644 --- a/docs/public/alizer-spec.md +++ b/docs/public/alizer-spec.md @@ -132,7 +132,7 @@ is discovered, a component is found. | | Java API | CLI | Javascript | Go | |----------------------------------|----------|-----|------------|----| -| Language/Framework detection | X | X | X | | +| Language/Framework detection | X | X | X | X | | Devfile detection (metadata) | X | X | X | | | Devfile detection (registry URL) | | X | | | | Component detection | X | X | | | diff --git a/go/README.md b/go/README.md new file mode 100644 index 00000000..624bee48 --- /dev/null +++ b/go/README.md @@ -0,0 +1,50 @@ +# Alizer + +## Summary + +Alizer (which stands for Application Analyzer) is a utilily whose goal is to extract information about an application source code. + +This folder includes the GoLang version of it. + +## Usage + +### Information +To analyze your source code with Alizer, just import it and use the recognizer: + +``` +import "github.com/redhat-developer/alizer/pkg/apis/recognizer" + +languages, err := recognizer.Analyze("./") +``` + +The result is an ordered list of information for each language detected in the source tree, with the following informations: + +- *Name*: the name of the detected language +- *Aliases*: other names which identify the detected language +- *Framework*: a list of detected frameworks (Quarkus, Flash,...) used by the application +- *Tools*: a list of tools (Maven,...) used by the application +- *UsageInPercentage*: a double value that represents the language weight compared to the others. + + +## Building it for the first time +This project includes a Makefile to make you start working with this project smoothly. + +To avoid duplicate some configuration files among all implementations we added them to the root of this repo. +So we first need to copy them withing the go project and then build it so it can embed them. + +There are two scripts based on which OS you work with: + +Windows + +``` +$ make initWin +``` + +Linux/Mac + +``` +$ make init +``` + +This will copy all needed files in correct location and do a first build. +From now you can compile your code as you usually do. \ No newline at end of file