github.com/geniusesgroup/libgo@v0.0.0-20220713101832-828057a9d3d4/README.md (about) 1 # libgo 2 [![GoDoc](https://pkg.go.dev/badge/github.com/GeniusesGroup/libgo)](https://pkg.go.dev/github.com/GeniusesGroup/libgo) 3 [![Go Report](https://goreportcard.com/badge/github.com/GeniusesGroup/libgo)](https://goreportcard.com/report/github.com/GeniusesGroup/libgo) 4 5 An **application** developing **framework** provide ZeroOps(zero operations), edge computing, ... that let you develope both server and client applications in Go without need to think more about any fundamental requirements, Just develope business services and user interfaces (now just graphical interface - gui), build apps as OS images or OS applications and easily just run first server node and let it distributes by many factors with inside logics not need external decision makers (automating software deployment) like Kubernetes(K8s). 6 7 In other word, `libgo` abbreviation of `Go language library` is a repository wrapper to store all implementation of GeniusesGroup and others protocols and algorithms to make a digital software more easily in better performance. 8 You can use all packages exported APIs, go generator mechanism or by [library CLI](#CLI) to access some useful APIs from command line easily. 9 10 ## Goals 11 - Provide complete framework to develope any purpose distributed application with low||no code. 12 - No(minimum) dependency on any other repositories. 13 - Compile an application as **Unikernel** instead of regular OSs binaries. 14 - Develope high available and distributed software without any admin in any infrastructure layers (DevOps culture goal). 15 - Let service developers act Lean and Agile in their organization. 16 - [Reinvent the wheel](https://en.wikipedia.org/wiki/Reinventing_the_wheel) 17 18 ## Not Goals 19 - 20 21 ## Protocols 22 You can find protocol descriptions in its directory as now [protocol](./protocol/), [society](./society/), [ISO](./iso/) 23 Read more about each protocol or library in its [RFC](https://github.com/GeniusesGroup/RFCs) 24 As [suggest here](https://github.com/golang/go/issues/48087) to comply with the standards we add [protocol](./protocol) package and all other libgo packages implement this package. You can implement these protocols in your own way if our packages can't satisfied you or your requirements. 25 A standard is a formalized protocol accepted by most of the parties that implement it. A protocol is not a set of rules. A protocol is the thing those rules describe the rules of. This is why programs implement a protocol and comply with a standard. 26 27 ## Industry Protocols 28 - Insurance >> ACCORD 29 - Health Care >> HL7 30 - Retail >> GS1 31 - HR >> HRXML 32 33 ## Go build tags 34 Some functionality in files that have build tags `//go:build tag_name` or `// +build tag_name` in the first line just build when you provided in build time like `go build -tags "dev_mode tcp_listener"`. Build tag declarations must be at the very top of a .go files. Nothing, not even comments, can be above build tags. We prefer `go:build` over `+build` because as [describe in the proposal](https://go.googlesource.com/proposal/+/master/design/draft-gobuild.md#transition) but below chart is how to declare in `+build` style. 35 36 | Build Tag Syntax | Build Tag Sample | Boolean Statement | 37 | :---: | :---: | :---: | 38 | Space-separated elements | // +build pro enterprise | pro OR enterprise | 39 | Comma-separated elements | // +build pro,enterprise | pro AND enterprise | 40 | New line separated elements | // +build pro<br />// +build enterprise | pro AND enterprise | 41 | Exclamation point elements | // +build !pro | NOT pro | 42 43 - **dev_mode** : 44 - **tcp_listener** : 45 46 ## Some useful git commands 47 - Make project version control by ```git init``` 48 - Clone exiting repo by ```git clone ${repository path}```. 49 - Add libgo to project as submodule by ```git submodule add -b master https://github.com/GeniusesGroup/libgo``` 50 - Clone existing project with just latest commits not all one ```git clone ${repository path} --recursive --shallow-submodules``` 51 - Change libgo version by ```git checkout tag/${tag}``` or update by ```git submodule update -f --init --remote --checkout --recursive``` if needed. 52 53 ## Some useful GO commands 54 - go build -race 55 - go tool compile -S {{file-name}}.go > {{file-name}}_C.S 56 - go tool objdump {{file-name}}.o > {{file-name}}_O.S 57 - go build -gcflags=-m {{file-name}}.go 58 - go run -gcflags='-m -m' {{file-name}}.go 59 - go build -ldflags "-X version=0.1" 60 61 ## CLI - Command-Line Interface 62 lib-cli is the command-line client for the some generator APIs implement in [lib-services](./lib-services/). It provides simple access to all APIs functions to make a server, a GUI app & .... 63 64 ### Make new project - Use git as version control 65 - Make project folder and suggest use your domain name for it. 66 - Make project version control by `git init` 67 - Instead aboves you can clone exiting repo by `git clone ${repository path}`. 68 - Add libgo to project as submodule by `git submodule add -b master https://github.com/GeniusesGroup/libgo` 69 - Build lib-cli by `go build ./libgo/lib-cli` 70 - Run lib-cli in a terminal by `./lib-cli` 71 - Choose desire services to make needed files or other actions. 72 73 ### APIs 74 - Complete manifest in main package of service. 75 - Add other data to main package if needed. 76 - Add as many service you need by CLI services and add business logic to them. 77 - From CLI update service file to autogenerate some code for you. 78 - As you can see in file services logic layers are independent layer and you must just think locally. But if you need network stream data use `st protocol.Stream` in your each function parameters. Don't remove it even don't need it. 79 80 ## RUN 81 - first check and change `AppMode_Dev` const in protocol package to desire behavior 82 - Build app by `go build` 83 - Strongly suggest run app by systemd on linux or other app manager on other OS. 84 - Otherwise easily run app by `./{{root-folder-name}}` 85 86 87 ## Contribute Rules 88 - Write benchmarks and tests codes in different files as `{{file-name}}_test.go` and `{{file-name}}_bench_test.go` 89 90 # Enterprise 91 Contact us by [this](mailto:ict@geniuses.group) or [this](mailto:omidhekayati@gmail.com) if you need enterprise support for developing high available and distributed software. See features available in enterprise package: 92 - Develope exclusive features in very short time 93 - Bug fixing quickly 94 - 95 96 ## Good Idea, Bad implementation! 97 - [SQLc](sqlc.dev) 98 - [EntGo](https://entgo.io/) 99 100 ## Related Projects 101 - [Clive is an operating system designed to work in distributed and cloud computing environments.](https://github.com/fjballest/clive) 102 103 # Abbreviations 104 - UI >> any User Interface -- GUI >> Graphic User Interface -- VUI >> Voice User Interface -- CLI >> Command Line Interface