api

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 25 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

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) 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