app

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package app 负责组装配置、认证、模块与管理 HTTP 服务。

Index

Constants

View Source
const DefaultListen = ":16680"

DefaultListen 是管理界面默认监听地址,避开 Lucky 的 16601 以便迁移期间并存。

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App 是一个运行中的 Gately 实例。

func New

func New(opts Options) (*App, error)

New 加载配置并初始化所有模块,但不启动网络服务。

func (*App) Handler

func (a *App) Handler() http.Handler

Handler 返回完整的 HTTP 处理器(API + 前端)。

func (*App) Run

func (a *App) Run(ctx context.Context) error

Run 启动所有模块和管理服务,阻塞直到 ctx 取消。

type Options

type Options struct {
	ConfigDir string
	// Listen 非空时覆盖配置文件中的监听地址
	Listen string
	// Web 是嵌入的前端文件系统,可为 nil
	Web fs.FS
	// Modules 是要启用的功能模块
	Modules []module.Module
}

Options 是启动参数。

type Settings

type Settings struct {
	Listen string `json:"listen"`
}

Settings 是程序级基础配置。

Jump to

Keyboard shortcuts

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