GinApiServer

module
v0.0.0-...-a9a04e4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2020 License: Apache-2.0

README

GinApiServer

GinApiServer is a HTTP apiserver framework based on Gin.

Replacement

You can get another ApiServer instance by executing following command:

grep -rl GinApiServer . | xargs sed -i 's/GinApiServer/youapiserver/g'  

Usage

bash start.sh
tailf GinApiServer.log

Structure

pkg/
├── config
│   ├── config.go
│   ├── key.go
│   ├── model.go
│   └── opt_defs.go
├── controller
│   ├── ping.go
│   ├── todo.go
│   └── version.go
├── log
│   └── log.go
├── middleware
│   ├── basic_auth_middleware.go
├── models
│   └── common.go
├── route
│   └── routes.go
├── service
│   └── todo.go
├── store
└── util
  • config: configuration
  • controller: achieve function by calling relevant service(MVC-Controller)
  • service: achieve application-specific logic
  • log: log module
  • middleware: responsible for auth and common-middleware logic
  • models: model(MVC-Model)
  • route: gin-route
  • store: storage(eg: MySQL, Redis)
  • util: basic library

Feature

  • Support configmap reload api
  • Support ping-pong health&version check
  • Support dump-goroutine-stack-traces

Image

make dockerfiles.build

Refs

Directories

Path Synopsis
pkg
log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL