app

package
v0.0.0-...-8499f05 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App defines the group of connection, config, repository, usecase, and etc.

func NewApp

func NewApp() *App

NewApp return the new defined App

func (*App) Close

func (app *App) Close()

Close closes the app and all connections.

func (*App) Init

func (app *App) Init(pool *sql.DB)

Init begin the initialization of application. This process initialize all connection, usecase, repositories, config, and etc.

func (*App) Migrate

func (app *App) Migrate() (err error)

Migrate runs the migration script for the application.

func (*App) ParseConfig

func (app *App) ParseConfig(configPath string, appConfig *Config) (err error)

ParseConfig parse config defined in the path to the given struct.

func (*App) Run

func (app *App) Run(osSignal chan os.Signal) (err error)

Run run the application using graceful shutdown

func (*App) SetConfig

func (app *App) SetConfig(config *Config)

SetConfig set the parsed config to the app.

type Config

type Config struct {
	Database
	Server
}

Config define all configs needed to store configured variables.

type Database

type Database struct {
	ConnectionString string `ini:"connection"`
}

Database define the config for conection string.

type Server

type Server struct {
	Port string `ini:"port"`
}

Server define the config for server port to start the apps.

Jump to

Keyboard shortcuts

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