server

package
v0.0.0-...-963ac0d Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface {
	Name() string
	Meta() map[string]string
	Setup(*Server) error
}

type Option

type Option func(*ServerConfig)

func SetComponents

func SetComponents(in []Component) Option

func SetGinMiddlewares

func SetGinMiddlewares(in []gin.HandlerFunc) Option

func SetServerMeta

func SetServerMeta(in ServerMeta) Option

type Server

type Server struct {
	*gin.Engine
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Server

func (*Server) Meta

func (s *Server) Meta() ServerMeta

func (*Server) Serve

func (s *Server) Serve()

func (*Server) SetComponent

func (s *Server) SetComponent(c Component) error

type ServerConfig

type ServerConfig struct {
	Components     []Component
	Meta           ServerMeta
	GinMiddlewares []gin.HandlerFunc
}

type ServerMeta

type ServerMeta struct {
	Name        string
	Description string
	GitHubLink  bool
}

Directories

Path Synopsis
contrib

Jump to

Keyboard shortcuts

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