server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package server implements the Gate HTTP server and its lifecycle.

Index

Constants

This section is empty.

Variables

View Source
var ServerCmd = &cobra.Command{
	Use:   "server",
	Short: "run the server",
	Long:  ``,
	RunE: func(cmd *cobra.Command, args []string) error {
		ctx := cmd.Context()

		server := NewServer(ctx, config.GetCurrent())
		if err := server.Init(); err != nil {
			return err
		}
		return server.serve()
	},
}

ServerCmd represents the server command.

Functions

This section is empty.

Types

type Server

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

Server is the main HTTP server.

func NewServer

func NewServer(ctx context.Context, config *config.Config) *Server

NewServer creates a new Server instance.

func (*Server) Init

func (s *Server) Init() error

Init initializes the HTTP server with routes, middleware, and configuration.

Directories

Path Synopsis
Package handlers provides HTTP request handlers for the Gate API.
Package handlers provides HTTP request handlers for the Gate API.
Package middlewares provides HTTP middleware for the Gate server.
Package middlewares provides HTTP middleware for the Gate server.

Jump to

Keyboard shortcuts

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