api

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureRouter

func ConfigureRouter(debug bool) *gin.Engine

Types

type API

type API interface {
	Start() error
	AddRoute(method, path string, handler gin.HandlerFunc)
}

type APIOption

type APIOption func(*APIv1)

func WithGroup

func WithGroup(group string) APIOption

func WithHost

func WithHost(host string) APIOption

func WithPort

func WithPort(port uint) APIOption

type APIRouteRegistrar

type APIRouteRegistrar interface {
	RegisterRoutes()
}

type APIv1

type APIv1 struct {
	ApiGroup *gin.RouterGroup
	Host     string
	Port     uint
	// contains filtered or unexported fields
}

func GetInstance

func GetInstance() *APIv1

func New

func New(debug bool, options ...APIOption) *APIv1

func (*APIv1) AddRoute

func (a *APIv1) AddRoute(method, path string, handler gin.HandlerFunc)

func (*APIv1) Engine

func (a *APIv1) Engine() *gin.Engine

func (*APIv1) Start

func (a *APIv1) Start() error

@license.name Apache 2.0 @license.url http://www.apache.org/licenses/LICENSE-2.0.html

Jump to

Keyboard shortcuts

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