Kumparan Stack Framework for Go Lang
- buff - This folder is used to store the *.proto files and the compilation result.
- client - Client folder is used for other services clients.
- config - This folder used for the configuration setting.
- console - All the terminal commands goes here.
- deploy - Deployment scripts.
- {{YOUR_SERVICE}}svc - Your service handler.
- repository - Service model, query and logic.
- example - contain client example for tutorial purpose only. Remove when you use the boilerplate in your service.
- You can follow the steps here
- Make sure you set your
$GOPATH
right. Check how to set your$GOPATH
here
Some plugin will need to be installed in the $GOBIN
. Default $GOBIN
is $GOPATH/bin
. It must be in your $PATH
for the plugin to find it.
- Add this line in your .zshrc or .bash_profile
$ export PATH=$PATH:$GOPATH/bin
- Then reload the profile
$ source ~/.zshrc #if you are using zsh
$ source ~/.bash_profile #if you are using bash
- Download the appropriate release here
- Unzip the folder
- Enter the folder and run
./autogen.sh && ./configure && make
...If you run into thiserror: autoreconf: failed to run aclocal: No such file or directory
, runbrew install libtool && brew install autoconf && brew install automake
. And run the command from step 3 again. - Then run these other commands. They should run without issues
$ make check
$ sudo make install
$ which protoc
$ protoc --version
- Install the protoc plugin for go.
$ go get -u github.com/golang/protobuf/protoc-gen-go
You can follow the steps here
- Make sure you already clone this repository in your
$GOPATH/src
folder. - Install the dependencies by running
dep ensure
in your terminal. - Compile the protobuf for the server example using
make proto
. - Create a configuration file called
config.yml
in the root directory. - You can copy the configuration in
config.yml.example
to yourconfig.yml
, or you also can change the config. - Run the service using
make run
. - You should see something like this:
INFO : Connection to Arango Server success...
INFO : Connection to database success...
INFO : Listening on 9001
- With the server running, open new terminal.
- Type
make story-client-example
. This command will create a new gRPC client of the server run in port 9001. The client will send a GetStories request to the server, and get the response from the server. - You should see something like this:
INFO : Echo result: [author:<group:"kumparan" id:"22251320" name:"Muhammad Iqbal" username:"mohamad-iqbal" > editor:<id:"22251320" name:"Mohamad Iqbal" username:"mohamad-iqbal" > author:<id:"10512612" name:"Faisal Faisal" username:"faisal admin" > author:<group:"kumparan" id:"33363617" name:"Jofie Yordan" username:"jofie-yordan" > editor:<id:"16871000" name:"Aditya Panji" username:"aditya-panji" > author:<id:"21342092" name:"Faisal F" username:"faisal-f" > author:<group:"kumparan" id:"36644670" name:"denny armandhanu" username:"denny-armandhanu" > editor:<id:"36644670" name:"Denny Armandhanu" username:"denny-armandhanu" > author:<group:"kumparan" id:"15416990" name:"Rizki Sunaryo" username:"rizkisunaryo-1" > editor:<id:"54819011" name:"Joan Riffaldy" username:"joan-riffaldy" > author:<group:"kumparan" id:"44607550" name:"angga sukmawijaya" username:"angga-sukmawijaya" > editor:<id:"44607550" name:"angga sukmawijaya" username:"angga-sukmawijaya" > author:<id:"10048204" name:"Agung Surya Bangsa" username:"agung-surya" > author:<group:"kumparan" id:"16871876" name:"Indra Subagja" username:"indra-subagja" > editor:<id:"22261855" name:"Salmah Muslimah" username:"salmah-muslimah" > author:<id:"76853821" name:"Ganesha Dwi Adynugraha" username:"ganesha-dwi-adynugraha" > ]
- Make sure you already clone this repository in your
$GOPATH/src
folder. - Install the dependencies by running
dep ensure
in your terminal. - Compile the protobuf for the server example using
make echo-example-proto
. - Run the service using
make echo-server-example
. - You should see something like this:
INFO : Listening on 9001
- With the server running, open new terminal.
- Type
make echo-client-example
. This command will create a new gRPC client of the server run in port 9001. The client will send a Echo request to the server, and get the response from the server. - You should see something like this:
INFO : Echo result: i'm screaming