# micro **Repository Path**: gricks/micro ## Basic Information - **Project Name**: micro - **Description**: Gokit Micro Service Example - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-02-08 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Micro This repo is an example for microservices by using [gokit](https://github.com/go-kit/kit) # Endpoint Endpoint represents a single RPC method. ``` type Endpoint func(ctx context.Context, request interface{}) (response interface{}, err error) ``` # Middleware Middleware is a chainable behavior modifier for endpoints. ``` type Middleware func(Endpoint) Endpoint ``` # Transport Transport is a wrapper of endpoint and implement a Handler(http, thrift, grpc). # Service Service is the real server, it always your business code. # Path Assume `GOPATH` is `~/.go` # INSTALL golang.org/x ``` git clone https://github.com/golang/net.git ~/.go/src/github.com/golang/net git clone https://github.com/golang/sys.git ~/.go/src/github.com/golang/sys git clone https://github.com/golang/text.git ~/.go/src/github.com/golang/text git clone https://github.com/golang/tools.git ~/.go/src/github.com/golang/tools mkdir -p ~/.go/src/golang.org/x ln -sf ~/.go/src/github.com/golang ~/.go/src/golang.org/x ``` # INSTALL google.golang.org/grpc ``` go get -u github.com/golang/protobuf/proto go get -u github.com/golang/protobuf/protoc-gen-go mkdir -p ~/.go/src/google.golang.org git clone https://github.com/grpc/grpc-go.git ~/.go/src/github.com/grpc/grpc-go ln -sf ~/.go/src/github.com/grpc/grpc-go ~/.go/src/google.golang.org/grpc git clone https://github.com/google/go-genproto.git ~/.go/src/github.com/google/go-genproto ln -sf ~/.go/src/github.com/google/go-genproto ~/.go/src/google.golang.org/genproto ```