Fastrest - fast restful framework for golang.

fastrest

fast restful framework for golang.

  1. Create your app directory, like mkdir myapp; cd myapp; go mod init myapp;
  2. Create initial config.toml in a folder initassets, example
    ---
    addr: ":14142"
  3. Create main code, example
    package main
    
    import (      
        "embed"
        "github.com/bingoohuang/fastrest"
    )
    
    //go:embed initassets
    var InitAssets embed.FS
    
    func main() { 
        // 注册路由
        router := fastrest.New(map[string]fastrest.Service{
            "GET /status":  &fastrest.Status{},
            "POST /p1sign": &fastrest.P1Sign{},
        })
    
        args := fastrest.ParseArgs(&InitAssets)
        args.Run(router)
    }
  4. Create Makefile, example
  5. Build make
  6. Create initial conf.toml and ctl: myapp -init
  7. Startup ./ctl start, you can set env export GOLOG_STDOUT=true before startup to view the log in stdout for debugging.
  8. Performance testing using berf: berf :14142/status -d15s -v

easyjson marshalling and unmarshalling

  1. Install easyjson tool
  2. Tag the model, see the following example.
  3. Generate easyjson codes: easyjson yourmodel.go
//easyjson:json
type Service1Req struct {
	Source  string
	BizType string
}

//easyjson:json
type Service1Rsp struct {
	Source string
}
Similar Resources

An restful api that uses CRUDL to support user endpoints. Stores the users in mysqlite. Creates 10 users when the program starts.

UserAPI An restful api that uses CRUDL to support user endpoints. Stores the users in mysqlite. Creates 10 users when the program starts. How to start

Nov 26, 2021

GateCracker-REST - A RESTful API example for simple lock model information application with Go

GateCracker-REST - A RESTful API example for simple lock model information application with Go

Go Lock Models REST API Example A RESTful API example for simple lock model info

Jun 11, 2022

Go-userapi-rest - Build a RESTful API that can get/create/update/delete user data from a persistence database

GO ASSIGNMENT Overview of the Task Context Build a RESTful API that can get/crea

Sep 6, 2022

laravel for golang,goal,fullstack framework,api framework

laravel for golang,goal,fullstack framework,api framework

laravel for golang,goal,fullstack framework,api framework

Feb 24, 2022

⚡ Rux is an simple and fast web framework. support middleware, compatible http.Handler interface. 简单且快速的 Go web 框架,支持中间件,兼容 http.Handler 接口

Rux Simple and fast web framework for build golang HTTP applications. NOTICE: v1.3.x is not fully compatible with v1.2.x version Fast route match, sup

Dec 8, 2022

Flamingo Framework and Core Library. Flamingo is a go based framework for pluggable web projects. It is used to build scalable and maintainable (web)applications.

Flamingo Framework and Core Library. Flamingo is a go based framework for pluggable web projects. It is used to build scalable and maintainable (web)applications.

Flamingo Framework Flamingo is a web framework based on Go. It is designed to build pluggable and maintainable web projects. It is production ready, f

Jan 5, 2023

Golanger Web Framework is a lightweight framework for writing web applications in Go.

/* Copyright 2013 Golanger.com. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except

Nov 14, 2022

The jin is a simplified version of the gin web framework that can help you quickly understand the core principles of a web framework.

jin About The jin is a simplified version of the gin web framework that can help you quickly understand the core principles of a web framework. If thi

Jul 14, 2022
A lightweight RESTful web framework for Go
A lightweight RESTful web framework for Go

Goweb A lightweight RESTful web framework for Go. For examples and usage, please read the Goweb API Documentation Read our Articles Who uses Goweb? "U

Jan 5, 2023
golang crud restful api with gorm , gin and mysql DB

crud restful api with golang , gorm , gin and mysql this api does a simple CRUD operations on a single table mysql Database . this is build on top off

Feb 26, 2022
Implementing a restful-api with Golang.

Go-REST Create a restful api with Golang. The main idea behind this project was to gain some knowledge about implementing a rest-api in Golang. Setup

Aug 22, 2022
⚓️ Golang RESTful APIs

Golang RESTful Golang RESTful API started on January 23rd, 2022. 环境配置相关解决办法

Jan 23, 2022
Fast and Reliable Golang Web Framework
Fast and Reliable Golang Web Framework

Gramework The Good Framework Gramework long-term testing stand metrics screenshot made with Gramework Stats Dashboard and metrics middleware What is i

Dec 18, 2022
A quick and easy way to setup a RESTful JSON API

Go-Json-Rest A quick and easy way to setup a RESTful JSON API Go-Json-Rest is a thin layer on top of net/http that helps building RESTful JSON APIs ea

Jan 3, 2023
TeslaMateApi is a RESTful API to get data collected by self-hosted data logger TeslaMate in JSON

TeslaMateApi is a RESTful API to get data collected by self-hosted data logger TeslaMate in JSON.

Dec 10, 2022
This project demonstrates a simple RESTful API built with Go and Chi.
This project demonstrates a simple RESTful API built with Go and Chi.

Go and chi RESTful API This project demonstrates a simple RESTful API built with Go and chi. This API provides the following endpoints: GET / - Verify

Dec 14, 2022
Project template for creating an RESTful webservice in Go, with relational database backend & example content.

gofound-restful Project template for creating an RESTfull webservice in Go, with relational database backend and example content. Used packages github

Dec 15, 2022
An example repo for RESTful API with swagger docs & unit testing

go REST API An example repo for RESTful API with swagger docs & unit testing Starting development server Copy .env.example to .env in the same directo

Nov 5, 2021