Skip to content

vamos-onion/fiber-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License

⚡️Fiber-Template

Simple Golang Fiber framework template


🏗️Dependencies

  • Go >= 1.17
  • RDB
    • MariaDB or MySQL
  • Redis
  • If you don't wanna use query related things, comment out the lines in main.go that initializing DB connection

🗂️Used packages


🚀How to run

  • DB / Redis settings (If you wanna use)
  • generate .env file using env-sample
  • git clone https://github.com/vamos-onion/fiber-template.git
  • go mod tidy & go run main.go (or you can build the project and then run the binary executable file)

🗄️DB settings

Create MariaDB Table

create table example
(
    seq     int(50) auto_increment
        primary key,
    payload varchar(50) default '' not null
);

create table organization
(
    seq          int(50) auto_increment
        primary key,
    organization varchar(50)       not null,
    org_uuid     varchar(50)       null,
    status       tinyint default 0 not null,
    constraint organization_org_uuid_uindex
        unique (org_uuid),
    constraint organization_organization_uindex
        unique (organization)
);

create table account
(
    seq           int unsigned auto_increment
        primary key,
    auth_seq      int(50)           not null,
    account_id    varchar(20)       not null,
    account_pwd   varchar(100)      not null,
    account_name  varchar(20)       null,
    account_email varchar(50)       not null,
    account_uuid  varchar(40)       not null,
    status        tinyint default 1 not null,
    created_at    datetime          null,
    updated_at    datetime          null,
    connected_at  datetime          null,
    constraint users_account_email_uindex
        unique (account_email),
    constraint users_account_id_uindex
        unique (account_id),
    constraint users_account_uuid_uindex
        unique (account_uuid),
    constraint account_organization_seq_fk
        foreign key (auth_seq) references organization (seq)
);

🆘Known issues

  • logrus.Logger.SetReportCaller(true)
    • only printing the point in logger.go file
    • if you want to print out original logrus report caller, should use logrus object directly

⚠️License

The packages that I used include MIT, BSD-2, and BSD-3 Licenses.
Please be aware of use it.

😊 Thx 👍

About

Simple golang fiber framework template

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published