scaffold

package module
v0.0.0-...-ffce114 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: Apache-2.0 Imports: 9 Imported by: 4

README

webapp-scaffold

scaffold for go webapp

This is a scaffold for moetang projects.

Dependencies

Features

TBD

TODO List

  • User/Identity integration
  • Session framework
  • Multiple language

Addons

  • pg query orm: struct tag - "mx.orm"

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotEnabled = errors.New("feature not enabled")

Functions

func ReadCustomConfig

func ReadCustomConfig(file string, s interface{}) error

Types

type GinApi

type GinApi interface {
	GetGin() *gin.Engine
}

type PostgresApi

type PostgresApi interface {
	GetPostgresPool() *pgxpool.Pool
}

type ScaffoldLifecycle

type ScaffoldLifecycle interface {
	SyncStart() error
	Shutdown() error
}

type WebappScaffold

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

func NewFromConfigFile

func NewFromConfigFile(file string) (*WebappScaffold, error)

func (*WebappScaffold) GetGin

func (w *WebappScaffold) GetGin() *gin.Engine

func (*WebappScaffold) GetPostgresPool

func (w *WebappScaffold) GetPostgresPool() *pgxpool.Pool

func (*WebappScaffold) PreInitDb

func (w *WebappScaffold) PreInitDb() error

func (*WebappScaffold) Shutdown

func (w *WebappScaffold) Shutdown() error

func (*WebappScaffold) SyncStart

func (w *WebappScaffold) SyncStart() error

type WebappScaffoldConfig

type WebappScaffoldConfig struct {
	GlobalConfig struct {
		Debug bool `toml:"debug"`
	} `toml:"global"`
	GinConfig struct {
		ReleaseMode       bool              `toml:"release_mode"`
		HtmlGlobPaths     []string          `toml:"html_glob_paths"`
		Listen            string            `toml:"listen" default:":6001"`
		StaticPathMapping map[string]string `toml:"static_path_mapping"`
	} `toml:"gin"`
	PgConfig struct {
		Enable                bool   `toml:"enable" default:"false"`
		PostgresConnectString string `toml:"connstring"`
	} `toml:"postgres"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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