fattingo

package module
v0.0.0-...-0567aa5 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: MIT Imports: 18 Imported by: 0

README

Backend

Create a ./config.toml file based on the ./config.example.toml one.
You can use a Sqlite3 or MySQL database, check the example config.

For sqlite, you can use the schema.sqlite.sql file to create the tables and the seed.sql file to insert some example data:

sqlite3 ./testdb < schema.sqlite.sql
sqlite3 ./testdb < seed.sql

If you use MySQL, leave host = "db" to use the docker container or replace it with some address (like 127.0.0.1) to use another mysql db.
To create the tables you can use the schema.mysql.sql file:

echo "CREATE DATABASE fattingo_test;" | mysql -uroot
mysql -uroot fattingo_test < schema.mysql.sql
mysql -uroot fattingo_test < seed.sql

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORSMiddleware

func CORSMiddleware(next http.Handler) http.Handler

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

func NewBackend

func NewBackend(cfg *Config) (*Backend, error)

func (*Backend) Run

func (b *Backend) Run() error

func (*Backend) Stop

func (b *Backend) Stop()

type Config

type Config struct {
	// contains filtered or unexported fields
}

func ReadConf

func ReadConf() (*Config, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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