All Projects → kujtimiihoxha → Kit

kujtimiihoxha / Kit

Licence: mit
GoKit CLI

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Labels

Projects that are alternatives of or similar to Kit

yii2-config-kit
Configuration kit for Yii applications
Stars: ✭ 24 (-96.22%)
Mutual labels:  kit
react-auth-kit
universal react app with flux, altjs, passportjs and server side rendering
Stars: ✭ 21 (-96.69%)
Mutual labels:  kit
aurelia-typescript-webpack-starter
A minimal Aurelia starter kit written in TypeScript and built using webpack.
Stars: ✭ 28 (-95.59%)
Mutual labels:  kit
nodejs-starter-kit
A Universal Javascript Starter Kit to satisify all you Web / App needs!
Stars: ✭ 23 (-96.38%)
Mutual labels:  kit
kit-assignment-tests
Test collection for KIT programming assignments (WS16/17)
Stars: ✭ 18 (-97.17%)
Mutual labels:  kit
nestjs-mailer
🌈 A simple implementation example with and without email-templates using mailer module for nest js built on top of nodemailer.
Stars: ✭ 82 (-87.09%)
Mutual labels:  kit
notus-js
Notus JS: Free Tailwind CSS UI Kit and Admin
Stars: ✭ 191 (-69.92%)
Mutual labels:  kit
Tailwindcss Figma Kit
Figma Kit for TailwindCSS
Stars: ✭ 577 (-9.13%)
Mutual labels:  kit
MinecraftNetwork
Minecraft server network backend
Stars: ✭ 35 (-94.49%)
Mutual labels:  kit
RC6502-Apple-1-Replica
An expandable SBC-version of the Apple 1 computer, easy to get started with and lot of cool stuff that can be added to it!
Stars: ✭ 71 (-88.82%)
Mutual labels:  kit
design-kit-hackathon
My recommended list of design resources for any hackathon!
Stars: ✭ 19 (-97.01%)
Mutual labels:  kit
react-auth-kit
Easily manage Authentication state of users in React-based Apps using Hooks and Higher-order components
Stars: ✭ 177 (-72.13%)
Mutual labels:  kit
qak
Qak - the QML Aid Kit
Stars: ✭ 20 (-96.85%)
Mutual labels:  kit
thefront-preview
A professional React Kit that comes with plenty of ready-to-use Material-UI components that will help you to build faster & beautiful frontend pages.
Stars: ✭ 39 (-93.86%)
Mutual labels:  kit
Flutter Ui Nice
More than 130+ pages in this beautiful app and more than 45 developers has contributed to it.
Stars: ✭ 3,092 (+386.93%)
Mutual labels:  kit
notus-angular
Notus Angular: Free Tailwind CSS UI Kit and Admin
Stars: ✭ 148 (-76.69%)
Mutual labels:  kit
DoProject
一个完整项目从头开始需要的工具、技术、SDK等总结
Stars: ✭ 31 (-95.12%)
Mutual labels:  kit
Express Babel
Express starter kit with ES2017+ support, testing, linting, and code coverage
Stars: ✭ 621 (-2.2%)
Mutual labels:  kit
Windows 95 Ui Kit
💾 Windows 95 UI Kit made with Bootstrap 4 components
Stars: ✭ 294 (-53.7%)
Mutual labels:  kit
Kit
A collection of Obj-C classes and categories for macOS.
Stars: ✭ 19 (-97.01%)
Mutual labels:  kit

GoKit CLI Build StatusGo Report CardCoverage Status

This project is a more advanced version of gk. The goal of the gokit cli is to be a tool that you can use while you develop your microservices with gokit.

While gk did help you create your basic folder structure it was not really able to be used further on in your project. This is what GoKit Cli is aiming to change.

Prerequisites

GoKit Cli needs to be installed using go get and go install so Go is a requirement to be able to test your services gokit is needed.

To utilise generation of gRPC service code through kit generate service <SERVICE_NAME> -t grpc you will need to install the grpc prequisites.

go get -u google.golang.org/grpc
go get -u github.com/golang/protobuf/protoc-gen-go

Table of Content

Installation

Before you install please read prerequisites

go get github.com/kujtimiihoxha/kit

Usage

kit help

Also read this medium story

Create a new service

kit new service hello
kit n s hello # using aliases

This will generate the initial folder structure and the service interface

service-name/pkg/service/service.go

package service

// HelloService describes the service.
type HelloService interface {
	// Add your methods here
	// e.x: Foo(ctx context.Context,s string)(rs string, err error)
}

Generate the service

kit g s hello
kit g s hello --dmw # to create the default middleware
kit g s hello -t grpc # specify the transport (default is http)

This command will do these things:

  • Create the service boilerplate: hello/pkg/service/service.go
  • Create the service middleware: hello/pkg/service/middleware.go
  • Create the endpoint: hello/pkg/endpoint/endpoint.go and hello/pkg/endpoint/endpoint_gen.go
  • If using--dmw create the endpoint middleware: hello/pkg/endpoint/middleware.go
  • Create the transport files e.x http: service-name/pkg/http/handler.go
  • Create the service main file 💥
    hello/cmd/service/service.go
    hello/cmd/service/service_gen.go
    hello/cmd/main.go

⚠️ Notice all the files that end with _gen will be regenerated when you add endpoints to your service and you rerun kit g s hello ⚠️

You can run the service by running:

go run hello/cmd/main.go

Generate the client library

kit g c hello

This will generate the client library ✨ http/client/http/http.go that you can than use to call the service methods, you can use it like this:

package main

import (
	"context"
	"fmt"

	client "hello/client/http"
	"github.com/go-kit/kit/transport/http"
)

func main() {
	svc, err := client.New("http://localhost:8081", map[string][]http.ClientOption{})
	if err != nil {
		panic(err)
	}

	r, err := svc.Foo(context.Background(), "hello")
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	fmt.Println("Result:", r)
}

Generate new middleware

kit g m hi -s hello
kit g m hi -s hello -e # if you want to add endpoint middleware

The only thing left to do is add your middleware logic and wire the middleware with your service/endpoint.

Enable docker integration

kit g d

This will add the individual service docker files and one docker-compose.yml file that will allow you to start your services. To start your services just run

docker-compose up

After you run docker-compose up your services will start up and any change you make to your code will automatically rebuild and restart your service (only the service that is changed)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].