gorpi

package
v0.0.0-...-edb9ed9 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigFolderPath  = os.Getenv("CONFIG_FOLDER")
	DefaultConfigFile = ConfigFolderPath + "/config.json"
	DefaultHost       = "127.0.0.1"
	DefaulPort        = "9095"
)

Functions

func RequestBodyClientErrorHandler

func RequestBodyClientErrorHandler(c *gin.Context, err error)

func ResourceNotFoundHandler

func ResourceNotFoundHandler(c *gin.Context, resourceName string)

Types

type Config

type Config struct {
	Server struct {
		Host string `json:"host"`
		Port string `json:"port"`
	} `json:"server"`
	Database struct {
		Username string `json:"username"`
		Password string `json:"password"`
		DbName   string `json:"db_name"`
		Host     string `json:"host"`
		Port     string `json:"port"`
	}
}

type Server

type Server struct {
	Cancel context.CancelFunc

	RouteManager    *routing.RouteManager
	MiddlewareStack *middlewares.MiddlewareStack
	DB              *models.DB

	ConfigFile string
	Config     *Config
	// contains filtered or unexported fields
}

func DefaultServer

func DefaultServer() (srv *Server, err error)

func New

func New(config *Config) (srv *Server, err error)

func (*Server) Run

func (srv *Server) Run() (err error)

func (*Server) Setup

func (srv *Server) Setup() (err error)

func (*Server) Shutdown

func (srv *Server) Shutdown() (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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