Giter Club home page Giter Club logo

goapi.g8's Introduction

goapi.g8

Giter8 template to develop API server / Microservices in Go using Echo framework.

Latest release: template-v0.4.r4.

Features

Getting Started

Install go-giter8

This a Giter8 template, so it is meant to be used in conjunction with a giter8 tool. Since this is a template for Go application, it make sense to use go-giter8.

See go-giter8 website for installation guide.

Create new project from template

g8 new btnguyen2k/goapi.g8

and follow the instructions.

Note: This template requires go-giter8 version 0.3.2 or higher.

Application configurations

Application configurations are loaded from config/application.conf file, in HOCON format. Its content is human-readable and self-explained. So, this readme lists only key configurations:

application info

app {
  # this section configures application's info such as name, version, description, etc.
}

API configurations

api {
  # "api" section configure common API settings swuch as max request size or request timeout

  http {
    # this sub-section configures HTTP/Rest API gateway
  }

  grpc {
    # this sub-section configures gRPC API gateway
  }
}

API endpoints

api.http.endpoints {
  # this sub-section defines API HTTP endpoints
}

Implement APIs

General guideline

  • Each API is an itineris.IApiHandler instance (e.g. func(*ApiContext, *ApiAuth, *ApiParams) *ApiResult)
  • Register APIs with the global API router instance goapi.ApiRouter
  • (Optional) Define API HTTP endpoints in configuration api.http.endpoints sub-section.

If gRPC API gateway is enable, APIs are automatically available via gRPC. See gRPC service definition file.

Sample APIs:

API filter

API filter (instance of type itineris.IApiFilter) is plugable component that is used to intercept API call and do some pre-processing, intercept result and do some post-processing before returning to caller.

See sample API filter.

Scaffolding

At project's root directory, run command

$ g8 scaffold <scaffold-name>

to generate scaffolds. This template includes a few scaffolds.

Scaffolding requires go-giter8 v0.4.0 or higher.

LICENSE & COPYRIGHT

See LICENSE.md for details.

Giter8 template

For information on giter8 templates, please see http://www.foundweekends.org/giter8/

goapi.g8's People

Contributors

btnguyen2k avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.