golite

package module
v0.0.0-...-1d05df0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(dstype string, dsn string) *sql.DB

func DbConnect

func DbConnect(dataSourceName string)

func InitData

func InitData() *map[string]any

Types

type Controller

type Controller struct {
	Name     string
	Path     string
	Template string
	Data     map[string]any
	Methods  string
	// contains filtered or unexported fields
}

func MakeRoute

func MakeRoute(c Controller) Controller

func (*Controller) AddData

func (c *Controller) AddData()

}

func (*Controller) AddQuery

func (c *Controller) AddQuery(q Query, args ...[]any)

func (*Controller) Get

func (c *Controller) Get()

func (*Controller) Post

func (c *Controller) Post()

type Data

type Data map[string]any

type DbHandle

type DbHandle struct {
	DB *sql.DB
}

func (DbHandle) Query

func (h DbHandle) Query(sql string, args ...interface{}) *RowsHandle

type Query

type Query struct {
	Sql  string
	Args []any
}

type RootApp

type RootApp struct {
	CTL map[string]Controller
	DBM map[string]DbHandle
	TPL map[string]Template
}
var App *RootApp = &RootApp{}

AppConfig stores the applicaiton configuration

type RowsHandle

type RowsHandle struct {
	Rows *sql.Rows
}

func (RowsHandle) FetchRowMap

func (rh RowsHandle) FetchRowMap() map[string]interface{}

func (RowsHandle) Next

func (rh RowsHandle) Next() bool

type Template

type Template struct {
	Name   string
	File   string
	Action func()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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