Git Product home page Git Product logo

go-fiber-mysql-api-gateway's Introduction

Go Mysql Gateway

merupakan Api gateway untuk mengakses database mysql.
setiap request akan dicatat dalam log pada table logs
/api/v1/mysql/query
Stack :
1. Go
2. Gorm
3. Viper
4. Fiber

setelah running pastikan table logs telah terbentuk dalam database yang telah didaftarkan
dan sesuaikan dengan struktur berikut :

CREATE TABLE LOGS (
    id INT AUTO_INCREMENT,
    LEVEL VARCHAR(10),
    message TEXT,
    created_at DATETIME,
    PRIMARY KEY (id, created_at)
) ENGINE=INNODB PARTITION BY RANGE (TO_DAYS(created_at)) (
    PARTITION p0 VALUES LESS THAN (TO_DAYS('2023-01-01')),
    PARTITION p1 VALUES LESS THAN (TO_DAYS('2023-02-01')),
    PARTITION p2 VALUES LESS THAN (TO_DAYS('2023-03-01')),
    PARTITION p3 VALUES LESS THAN (TO_DAYS('2023-04-01')),
    PARTITION p4 VALUES LESS THAN (TO_DAYS('2023-05-01')),
    PARTITION p5 VALUES LESS THAN (TO_DAYS('2023-06-01')),
    PARTITION p6 VALUES LESS THAN (TO_DAYS('2023-07-01')),
    PARTITION p7 VALUES LESS THAN (TO_DAYS('2023-08-01')),
    PARTITION p8 VALUES LESS THAN (TO_DAYS('2023-09-01')),
    PARTITION p9 VALUES LESS THAN (TO_DAYS('2023-10-01')),
    PARTITION p10 VALUES LESS THAN (TO_DAYS('2023-11-01')),
    PARTITION p11 VALUES LESS THAN (TO_DAYS('2023-12-01'))
);
CREATE INDEX idx_created_at ON LOGS (created_at);

go build -ldflags="-s -w" main.go

go-fiber-mysql-api-gateway's People

Contributors

donnyirianto avatar

Watchers

 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.