gol

package module
v0.0.0-...-942d1c8 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

README

gol

This is repository contains personal tools to run a RestAPI using Go with Gin Gonic.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadControllers

func LoadControllers(app *App, controllers ...*Controller)

func RunServer

func RunServer(port string, app *App)

Types

type App

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

An app is a varible that contains API controllers

func NewApp

func NewApp(ncontrollers uint) *App

func NewDefaultApp

func NewDefaultApp() *App

type Context

type Context struct {
	*gin.Context
}

Delegated type Context

type Controller

type Controller struct {
	Path         string
	HandlerFuncs HandlerData
}

A controllers has a path and a possible Handler Function by each http method

func (*Controller) AddHandleFunc

func (c *Controller) AddHandleFunc(method rest.RestMethod, handlerFunc HandlerFunc)

type HandlerData

type HandlerData map[rest.RestMethod]HandlerFunc

Represent the methods that a controller can execute

type HandlerFunc

type HandlerFunc func(Context)

Delegated type HandlerFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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