apis

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package apis save the web api code init.go define init() function and default system api handlers save you handle functions routes.go register handle function on url WAY TO ADD YOUR NEW API: create code file or package according to you business logic, let structure be modularized write the gin handlerFunc code like the Ping() in the file you should extract the common business logic handle functions into services package database model should be defined in models package by modularized general tool functions should be defined in utils package by modularized you can record log by utils.Logger and get config by viper you can return unified json struct by utils/response package the new return code should be defined in services/retcode package when you finish the handlerFunc you need to register it on a url in routes.go that's all.

Package apis routes.go provides register handlers on url

Index

Constants

View Source
const VERSION = "0.0.1"

VERSION your API version, don't change the code style

Variables

This section is empty.

Functions

func Ping

func Ping(c *gin.Context)

Ping godoc @Summary Ping for server is living will respond API version @Tags x @Produce json @Router /x/ping [get] @Success 200 {object} response.Response

func RegisterRoutes

func RegisterRoutes(app *gin.Engine)

RegisterRoutes add handlers on urls at there

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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