https://github.com/seefan/microgo
The Microservice Framework develop by go
https://github.com/seefan/microgo
go golang http micro rest
Last synced: 16 days ago
JSON representation
The Microservice Framework develop by go
- Host: GitHub
- URL: https://github.com/seefan/microgo
- Owner: seefan
- License: mit
- Created: 2019-01-24T03:25:24.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-01-09T16:41:27.000Z (about 5 years ago)
- Last Synced: 2024-06-20T05:10:29.103Z (over 1 year ago)
- Topics: go, golang, http, micro, rest
- Language: Go
- Homepage:
- Size: 75.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# microgo
The Microservice Framework develop by go
### example
#### main
package main
import (
"context"
"github.com/seefan/microgo/server/httpserver"
"github.com/seefan/microgo/test"
)
func main() {
s := httpserver.NewHTTPServer("localhost", 8888)
s.Register(&test.TestService{})
if err := s.Start(context.Background()); err != nil {
println(err.Error())
}
}
#### service
package test
import (
"github.com/seefan/microgo/service"
)
type TestService struct {
}
func (TestService) Hello(entry service.Entry) string {
name := entry.Get("name")
return "hello " + name
}
func (TestService) Name() string {
return "test"
}
func (TestService) Version() string {
return "1.0"
}