httpGo

package
v1.2.229 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: GPL-3.0 Imports: 27 Imported by: 2

Documentation

Overview

implementation support SSE on backend

Index

Constants

View Source
const ShowVersion = "/api/version()"

Variables

View Source
var (
	Version   string
	HTTPGOVer string
	OSVersion string
	Build     string
	Branch    string
)

version

Functions

func ConvertANSICodeToCSS added in v1.1.192

func ConvertANSICodeToCSS(input []byte) []byte

func GetAppTitle added in v1.2.204

func GetAppTitle(name string) string

func HandleNoticeSSE added in v1.1.192

func HandleNoticeSSE(ctx *fasthttp.RequestCtx) (any, error)

HandleNoticeSSE for demo version

func RunRedirectNoSecure added in v1.1.192

func RunRedirectNoSecure(port string)

Types

type Access added in v1.0.11512

type Access interface {
	Allow(ctx *fasthttp.RequestCtx, addr string) bool
}

type AccessConf added in v1.0.14

type AccessConf struct {
	ChkConn       bool              `yaml:"ChkConn"`
	AllowIP       []string          `yaml:"Allow"`
	DenyIP        []string          `yaml:"Deny"`
	Mess          string            `yaml:"Mess"`
	AllowRoute    []string          `yaml:"AllowRoute"`
	DenyRoute     []string          `yaml:"DenyRoute"`
	QuickResponse map[string]string `yaml:"QuickResponse"`
}

func (*AccessConf) Allow added in v1.0.14

func (cfg *AccessConf) Allow(ctx *fasthttp.RequestCtx, addr string) bool

func (*AccessConf) Deny added in v1.0.14

func (cfg *AccessConf) Deny(ctx *fasthttp.RequestCtx, addr string) bool

func (*AccessConf) IsAccess added in v1.0.11512

func (cfg *AccessConf) IsAccess() bool

type CfgHttp

type CfgHttp struct {
	*AccessConf `yaml:"Access" json:"access,omitempty"`

	Domains      map[string]string   `yaml:"Domains,omitempty" json:"Domains,omitempty"`
	HTTP2        *http2.ServerConfig `yaml:"HTTP2,omitempty" json:"HTTP2,omitempty"`
	KillSignal   int                 `yaml:"KillSignal" json:"KillSignal,omitempty"`
	Server       *fasthttp.Server    `yaml:"Server,omitempty" json:"-"`
	PortRedirect string              `yaml:"PortRedirect" json:"PortRedirect,omitempty"`
	// contains filtered or unexported fields
}

CfgHttp has some options for Acceptor work

func NewCfgHttp

func NewCfgHttp(filename string) (cfgGlobal *CfgHttp, err error)

NewCfgHttp create CfgHttp from config file

func (*CfgHttp) Reload added in v1.0.19

func (cfg *CfgHttp) Reload() (any, error)

type HttpGo

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

HttpGo implement rest api http/https server for operation with storage

func NewHttpgo

func NewHttpgo(cfg *CfgHttp, listener net.Listener, apis *Apis) *HttpGo

NewHttpgo get configuration option from cfg listener to receive requests

func (*HttpGo) Run

func (h *HttpGo) Run(secure bool, certFile, keyFile string) error

Run starting http or https server according to secure certFile and keyFile are paths to TLS certificate and key files for https server

type LogWriter added in v1.1.192

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

func (*LogWriter) Write added in v1.1.192

func (l *LogWriter) Write(p []byte) (n int, err error)

type Store added in v1.1.192

type Store struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewStore added in v1.1.192

func NewStore() *Store

func (*Store) Get added in v1.1.192

func (s *Store) Get(id uint64, name string) any

func (*Store) Len added in v1.1.192

func (s *Store) Len() int

func (*Store) Set added in v1.1.192

func (s *Store) Set(ctx *fasthttp.RequestCtx, name string, value any) StoreKey

func (*Store) StartSSELog added in v1.1.192

func (s *Store) StartSSELog(ctx *fasthttp.RequestCtx, startMsg []byte, fnc func(w io.Writer)) StoreKey

type StoreKey added in v1.1.192

type StoreKey struct {
	Id   uint64
	Name string
}

Jump to

Keyboard shortcuts

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