server

package
v0.0.0-...-def24e1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServer

type APIServer struct {
	Middlewares []gin.HandlerFunc
	Resources   []interface{}
	// ShutdownTimeout is the timeout used for server shutdown. This specifies the timeout before server
	// gracefully shutdown returns.
	ShutdownTimeout time.Duration
	// contains filtered or unexported fields
}

type GenericAPIServer gin.Engine.

func (*APIServer) Close

func (s *APIServer) Close()

Close graceful shutdown the api server.

func (*APIServer) GetEngine

func (s *APIServer) GetEngine() *gin.Engine

func (*APIServer) InitAPIServer

func (s *APIServer) InitAPIServer()

func (*APIServer) InstallAPIs

func (s *APIServer) InstallAPIs()

InstallAPIs install generic apis.

func (*APIServer) InstallMiddlewares

func (s *APIServer) InstallMiddlewares()

InstallMiddlewares install generic middlewares.

func (*APIServer) InstallResources

func (s *APIServer) InstallResources()

func (*APIServer) Run

func (s *APIServer) Run() error

Run spawns the http server. It only returns when the port cannot be listened on initially.

type BaseResource

type BaseResource struct {
}

func (BaseResource) SetErrorResult

func (r BaseResource) SetErrorResult(c *gin.Context, result interface{})

func (BaseResource) SetResult

func (r BaseResource) SetResult(c *gin.Context, result interface{})

type DeleteResourceInterface

type DeleteResourceInterface interface {
	Delete(c *gin.Context)
}

type GetResourceInterface

type GetResourceInterface interface {
	Get(c *gin.Context)
}

type ListResourceInterface

type ListResourceInterface interface {
	List(c *gin.Context)
}

type PathResourceInterface

type PathResourceInterface interface {
	Path() string
}

type PostResourceInterface

type PostResourceInterface interface {
	Post(c *gin.Context)
}

type PutResourceInterface

type PutResourceInterface interface {
	Put(c *gin.Context)
}

Jump to

Keyboard shortcuts

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