api

package
v0.2.50 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const BindAddress = "bind_addr"

Variables

This section is empty.

Functions

This section is empty.

Types

type ENV

type ENV int
const (
	DEV ENV = iota
	PROD
)

func (ENV) String added in v0.2.3

func (s ENV) String() string

type PORT

type PORT string
const (
	HttpsPort    PORT = "https_port"
	HttpPort     PORT = "http_port"
	DevHttpsPort PORT = "dev_https_port"
)

type Server

type Server struct {
	Log     loggers.Logger
	LogFile *os.File

	Bind         string
	HttpsPort    int
	HttpPort     int
	DevHttpsPort int
	Env          ENV // 环境变量:DEV 或 PROD
	// contains filtered or unexported fields
}

func NewServer

func NewServer(options ...func(s *Server) error) (*Server, error)

func (*Server) Close

func (s *Server) Close()

func (*Server) GetCaddyConfig added in v0.2.36

func (s *Server) GetCaddyConfig() *caddy.Config

GetCaddyConfig 获取 Caddy 配置(用于备份调度器)

func (*Server) GetCouchDBConfig added in v0.2.36

func (s *Server) GetCouchDBConfig() *couchdb.Config

GetCouchDBConfig 获取 CouchDB 配置(用于备份调度器)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(enableHttps bool) error

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis
analytics
Package analytics provides the methods to run an analytics reporting system for API requests which may be useful to users for measuring access and possibly identifying bad actors abusing requests.
Package analytics provides the methods to run an analytics reporting system for API requests which may be useful to users for measuring access and possibly identifying bad actors abusing requests.

Jump to

Keyboard shortcuts

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