annotation

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

* Routes are first written in the comment lines. Then the library I prepared reads these comment lines and creates automatic route functions. It provides a Symfony framework or Flask-style routing environment. It does not cause performance problems because the route function is already created.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Config
	Routes []Route
}

App is the application.

func (*App) Generate

func (app *App) Generate()

Generates the routes.go file.

func (*App) ParseAnnotationRoute

func (app *App) ParseAnnotationRoute(annotation string) (Route, error)

func (*App) ParseDirectory

func (app *App) ParseDirectory()

Parses the handler directory.

func (*App) SetConfig

func (app *App) SetConfig(config Config)

Sets the configuration.

type Config

type Config struct {
	Directory string // Handler or Controller directory path.
	Output    string // Output file path; routes.go
}

Configures the application.

type Route

type Route struct {
	Method  string // HTTP method
	Path    string // Path
	Handler string // Handler name
	Name    string // Route name
}

Parses the annotation and returns the route.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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