gala

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 14 Imported by: 0

README

gala

Standardized and rapid development of scaffolding based on golang development

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context = gin.Context

type Engine

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

func Default

func Default() *Engine

func (*Engine) AddStatic

func (e *Engine) AddStatic(opt ...Static)

func (*Engine) AddTemplate

func (e *Engine) AddTemplate(path ...string)

func (*Engine) Execute

func (e *Engine) Execute()

Execute : Start-up project

func (*Engine) Register

func (e *Engine) Register(opt ...Manifest)

type Group

type Group struct {
	Name       string    `json:"name" xml:"name" gala:"name"`
	Middleware []Handler `json:"middleware" xml:"middleware" gala:"middleware"` // Group middleware
	Router     []Router  `json:"router" xml:"router" gala:"router"`
}

type Handler

type Handler = gin.HandlerFunc

type Manifest

type Manifest struct {
	Name        string `json:"name" xml:"name" gala:"name"`
	Version     string `json:"version" xml:"version" gala:"version"`
	Author      string `json:"author" xml:"author" gala:"author"`
	Description string `json:"description" xml:"description" gala:"description"`

	Static []Static `json:"static" xml:"static" gala:"static"`

	Group []Group `json:"group" xml:"group" gala:"group"`
}

type Method

type Method int
const (
	GET Method = iota + 1
	POST
	PUT
	DELETE
	ANY
)

type Path

type Path struct {
	Path    string  `json:"addr" xml:"addr" gala:"path"`          // Router Path
	Method  Method  `json:"method" xml:"method" gala:"method"`    // Request Method
	Handler Handler `json:"handler" xml:"handler" gala:"handler"` // Controller
}

type Router

type Router struct {
	Middleware []Handler `json:"middleware" xml:"middleware" gala:"middleware"` // Group middleware
	Paths      []Path    `json:"paths" xml:"paths" gala:"paths"`
}

type Static

type Static struct {
	Name string `json:"name" xml:"name" gala:"name"`
	Path string `json:"path" xml:"path" gala:"path"`
}

type URI

type URI struct {
	Path       string    `json:"path" xml:"path" gala:"path"`
	Method     Method    `json:"method" xml:"method" gala:"method"`
	Handler    Handler   `json:"handler" xml:"handler" gala:"handler"`
	Middleware []Handler `json:"middleware" xml:"middleware" gala:"middleware"`
}

func ConcatURI

func ConcatURI(slices ...[]URI) []URI

func MergeURI

func MergeURI(slices ...[]URI) []URI

Directories

Path Synopsis
addons
web
container
set
storage

Jump to

Keyboard shortcuts

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