hemi

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: BSD-2-Clause Imports: 2 Imported by: 5

README

Hemi

Hemi is the engine of Gorox.

Architecture

Logical

The logical architecture of a stage in Hemi engine looks like this:

   ^     +--------------------------------------------+  shutdown
   |     |                cronjob(*)                  |     |
   |     +---+--------+--------------+----------------+     |
   |     |   |        |     rpc[+]   |     web[+]     |     |
   |     | s | [quic] |     server   |     server     |     |
   |     | e | [tcps] | <gate><conn> |  <gate><conn>  |     |
   |     | r | [udps] +--------------+----------------+     |
   |     | v | mesher |              | app(*) handlet |     |
   |     | e | filter |              | socklet reviser|     |
   |     | r |  case  |   svc(*)     |    rule        |     |
   |     |(*)|        |          +---+--+      +------+     |
   |     |   |        |          |stater|      |storer|     |
   |     +---+--------+----------+------+------+------+     |
   |     |           backend <node> <conn>            |     |
   |     +---+---+---+---+---+---+---+---+------------+     |
   |     | o | u | t | g | a | t | e | s |   runner   |     |
   |     +---+---+---+---+---+---+---+---+------------+     |
   |     |   clock   |     fcache    |     resolv     |     |
prepare  +-----------+---------------+----------------+     v

Dependencies

A program using Hemi typically has following dependencies:

  +-------------------------------------------------------------+
  |                           <program>                         |
  +-------------+-------------------------------+----------+----+
                |                               |          |
                v                               v          v
  +------+   +---------------------------+   +------+ +---------+
  | libs |<--+ apps & jobs & srvs & svcs +-->| exts | |<procman>|
  +------+   +--+---------------------+--+   +--+---+ +----+----+
                |                     |         |          |
                v                     v         v          v
  +-----------------------+   +---------------------------------+
  |       <contrib>       |<--+              <hemi>             |
  +-----------+-----------+   +-----------------+---------------+
              |                                 |
              v                                 v
  +-------------------------------------------------------------+
  |                         <internal>                          |
  +-------------------------------------------------------------+

Examples

For examples showing how to use Hemi, see: https://github.com/hexinfra/examples

Documentation

Index

Constants

View Source
const (
	Version = internal.Version

	CodeBug = internal.CodeBug
	CodeUse = internal.CodeUse
	CodeEnv = internal.CodeEnv
)
View Source
const (
	Version1_0 = internal.Version1_0
	Version1_1 = internal.Version1_1
	Version2   = internal.Version2
	Version3   = internal.Version3

	SchemeHTTP  = internal.SchemeHTTP
	SchemeHTTPS = internal.SchemeHTTPS

	// Known methods
	MethodGET     = internal.MethodGET
	MethodHEAD    = internal.MethodHEAD
	MethodPOST    = internal.MethodPOST
	MethodPUT     = internal.MethodPUT
	MethodDELETE  = internal.MethodDELETE
	MethodCONNECT = internal.MethodCONNECT
	MethodOPTIONS = internal.MethodOPTIONS
	MethodTRACE   = internal.MethodTRACE

	// 1XX
	StatusContinue           = internal.StatusContinue
	StatusSwitchingProtocols = internal.StatusSwitchingProtocols
	StatusProcessing         = internal.StatusProcessing
	StatusEarlyHints         = internal.StatusEarlyHints
	// 2XX
	StatusOK                         = internal.StatusOK
	StatusCreated                    = internal.StatusCreated
	StatusAccepted                   = internal.StatusAccepted
	StatusNonAuthoritativeInfomation = internal.StatusNonAuthoritativeInfomation
	StatusNoContent                  = internal.StatusNoContent
	StatusResetContent               = internal.StatusResetContent
	StatusPartialContent             = internal.StatusPartialContent
	StatusMultiStatus                = internal.StatusMultiStatus
	StatusAlreadyReported            = internal.StatusAlreadyReported
	StatusIMUsed                     = internal.StatusIMUsed
	// 3XX
	StatusMultipleChoices   = internal.StatusMultipleChoices
	StatusMovedPermanently  = internal.StatusMovedPermanently
	StatusFound             = internal.StatusFound
	StatusSeeOther          = internal.StatusSeeOther
	StatusNotModified       = internal.StatusNotModified
	StatusUseProxy          = internal.StatusUseProxy
	StatusTemporaryRedirect = internal.StatusTemporaryRedirect
	StatusPermanentRedirect = internal.StatusPermanentRedirect
	// 4XX
	StatusBadRequest                  = internal.StatusBadRequest
	StatusUnauthorized                = internal.StatusUnauthorized
	StatusPaymentRequired             = internal.StatusPaymentRequired
	StatusForbidden                   = internal.StatusForbidden
	StatusNotFound                    = internal.StatusNotFound
	StatusMethodNotAllowed            = internal.StatusMethodNotAllowed
	StatusNotAcceptable               = internal.StatusNotAcceptable
	StatusProxyAuthenticationRequired = internal.StatusProxyAuthenticationRequired
	StatusRequestTimeout              = internal.StatusRequestTimeout
	StatusConflict                    = internal.StatusConflict
	StatusGone                        = internal.StatusGone
	StatusLengthRequired              = internal.StatusLengthRequired
	StatusPreconditionFailed          = internal.StatusPreconditionFailed
	StatusContentTooLarge             = internal.StatusContentTooLarge
	StatusURITooLong                  = internal.StatusURITooLong
	StatusUnsupportedMediaType        = internal.StatusUnsupportedMediaType
	StatusRangeNotSatisfiable         = internal.StatusRangeNotSatisfiable
	StatusExpectationFailed           = internal.StatusExpectationFailed
	StatusMisdirectedRequest          = internal.StatusMisdirectedRequest
	StatusUnprocessableEntity         = internal.StatusUnprocessableEntity
	StatusLocked                      = internal.StatusLocked
	StatusFailedDependency            = internal.StatusFailedDependency
	StatusTooEarly                    = internal.StatusTooEarly
	StatusUpgradeRequired             = internal.StatusUpgradeRequired
	StatusPreconditionRequired        = internal.StatusPreconditionRequired
	StatusTooManyRequests             = internal.StatusTooManyRequests
	StatusRequestHeaderFieldsTooLarge = internal.StatusRequestHeaderFieldsTooLarge
	StatusUnavailableForLegalReasons  = internal.StatusUnavailableForLegalReasons
	// 5XX
	StatusInternalServerError           = internal.StatusInternalServerError
	StatusNotImplemented                = internal.StatusNotImplemented
	StatusBadGateway                    = internal.StatusBadGateway
	StatusServiceUnavailable            = internal.StatusServiceUnavailable
	StatusGatewayTimeout                = internal.StatusGatewayTimeout
	StatusHTTPVersionNotSupported       = internal.StatusHTTPVersionNotSupported
	StatusVariantAlsoNegotiates         = internal.StatusVariantAlsoNegotiates
	StatusInsufficientStorage           = internal.StatusInsufficientStorage
	StatusLoopDetected                  = internal.StatusLoopDetected
	StatusNotExtended                   = internal.StatusNotExtended
	StatusNetworkAuthenticationRequired = internal.StatusNetworkAuthenticationRequired
)

Variables

View Source
var (
	RegisterRunner = internal.RegisterRunner

	RegisterBackend = internal.RegisterBackend

	RegisterQUICFilter = internal.RegisterQUICFilter
	RegisterTCPSFilter = internal.RegisterTCPSFilter
	RegisterUDPSFilter = internal.RegisterUDPSFilter

	RegisterStater = internal.RegisterStater
	RegisterStorer = internal.RegisterStorer

	RegisterAppInit = internal.RegisterAppInit
	RegisterHandlet = internal.RegisterHandlet
	RegisterReviser = internal.RegisterReviser
	RegisterSocklet = internal.RegisterSocklet

	RegisterSvcInit = internal.RegisterSvcInit

	RegisterServer = internal.RegisterServer

	RegisterCronjob = internal.RegisterCronjob
)
View Source
var (
	SetDebug = internal.SetDebug
	Debug    = internal.Debug

	SetBaseDir = internal.SetBaseDir
	SetLogsDir = internal.SetLogsDir
	SetTempDir = internal.SetTempDir
	SetVarsDir = internal.SetVarsDir

	BaseDir = internal.BaseDir
	LogsDir = internal.LogsDir
	TempDir = internal.TempDir
	VarsDir = internal.VarsDir

	Print   = internal.Print
	Println = internal.Println
	Printf  = internal.Printf
	Error   = internal.Error
	Errorln = internal.Errorln
	Errorf  = internal.Errorf

	BugExitln = internal.BugExitln
	BugExitf  = internal.BugExitf
	UseExitln = internal.UseExitln
	UseExitf  = internal.UseExitf
	EnvExitln = internal.EnvExitln
	EnvExitf  = internal.EnvExitf

	FromFile = internal.FromFile
	FromText = internal.FromText
)

Functions

This section is empty.

Types

type App

type App = internal.App

type Backend

type Backend = internal.Backend

type Bundlet added in v0.1.6

type Bundlet = internal.Bundlet

type Component_

type Component_ = internal.Component_
type Cookie = internal.Cookie

type Cronjob

type Cronjob = internal.Cronjob

type Cronjob_

type Cronjob_ = internal.Cronjob_

type GRPCBridge added in v0.1.2

type GRPCBridge = internal.GRPCBridge // for implementing gRPC server in exts

type Gate_

type Gate_ = internal.Gate_

type H1Conn

type H1Conn = internal.H1Conn

type H1Request

type H1Request = internal.H1Request

type H1Response

type H1Response = internal.H1Response

type H1Socket

type H1Socket = internal.H1Socket

type H1Stream

type H1Stream = internal.H1Stream

type H2Conn

type H2Conn = internal.H2Conn

type H2Request

type H2Request = internal.H2Request

type H2Response

type H2Response = internal.H2Response

type H2Socket

type H2Socket = internal.H2Socket

type H2Stream

type H2Stream = internal.H2Stream

type H3Conn

type H3Conn = internal.H3Conn

type H3Request

type H3Request = internal.H3Request

type H3Response

type H3Response = internal.H3Response

type H3Socket

type H3Socket = internal.H3Socket

type H3Stream

type H3Stream = internal.H3Stream

type HCall added in v0.1.5

type HCall = internal.HCall

type HExchan added in v0.1.3

type HExchan = internal.HExchan

type HRPCBackend added in v0.1.5

type HRPCBackend = internal.HRPCBackend

type HRPCOutgate added in v0.1.5

type HRPCOutgate = internal.HRPCOutgate

type HReq added in v0.1.5

type HReq = internal.HReq

type HRequest added in v0.1.3

type HRequest = internal.HRequest

type HResp added in v0.1.5

type HResp = internal.HResp

type HResponse added in v0.1.3

type HResponse = internal.HResponse

type HTTP1Backend

type HTTP1Backend = internal.HTTP1Backend

type HTTP1Outgate

type HTTP1Outgate = internal.HTTP1Outgate

type HTTP2Backend

type HTTP2Backend = internal.HTTP2Backend

type HTTP2Outgate

type HTTP2Outgate = internal.HTTP2Outgate

type HTTP3Backend

type HTTP3Backend = internal.HTTP3Backend

type HTTP3Outgate

type HTTP3Outgate = internal.HTTP3Outgate

type HWEBBackend added in v0.1.3

type HWEBBackend = internal.HWEBBackend

type HWEBOutgate added in v0.1.3

type HWEBOutgate = internal.HWEBOutgate

type Handle

type Handle = internal.Handle

type Handlet

type Handlet = internal.Handlet

type Handlet_

type Handlet_ = internal.Handlet_

type Hobject

type Hobject = internal.Hobject

type Piece

type Piece = internal.Piece

type QConnection added in v0.1.6

type QConnection = internal.QConnection

type QOneway added in v0.1.4

type QOneway = internal.QOneway

type QStream added in v0.1.4

type QStream = internal.QStream

type QUDSBackend added in v0.1.5

type QUDSBackend = internal.QUDSBackend

type QUDSOutgate added in v0.1.5

type QUDSOutgate = internal.QUDSOutgate

type QUICBackend

type QUICBackend = internal.QUICBackend

type QUICConnection added in v0.1.6

type QUICConnection = internal.QUICConnection

type QUICFilter added in v0.1.0

type QUICFilter = internal.QUICFilter

type QUICFilter_ added in v0.1.0

type QUICFilter_ = internal.QUICFilter_

type QUICMesher

type QUICMesher = internal.QUICMesher

type QUICOutgate

type QUICOutgate = internal.QUICOutgate

type Request

type Request = internal.Request

type Response

type Response = internal.Response

type Reviser

type Reviser = internal.Reviser

type Reviser_

type Reviser_ = internal.Reviser_

type Router

type Router = internal.Router

type Rule

type Rule = internal.Rule

type Runner added in v0.1.2

type Runner = internal.Runner

type Server

type Server = internal.Server

type Server_

type Server_ = internal.Server_

type Session

type Session = internal.Session

type Socket

type Socket = internal.Socket

type Socklet

type Socklet = internal.Socklet

type Socklet_

type Socklet_ = internal.Socklet_

type Stage

type Stage = internal.Stage

type Stater

type Stater = internal.Stater

type Stater_

type Stater_ = internal.Stater_

type Storer added in v0.1.6

type Storer = internal.Storer

type Storer_ added in v0.1.6

type Storer_ = internal.Storer_

type Svc

type Svc = internal.Svc

type TCPSBackend

type TCPSBackend = internal.TCPSBackend

type TCPSConn

type TCPSConn = internal.TCPSConn

type TCPSFilter added in v0.1.0

type TCPSFilter = internal.TCPSFilter

type TCPSFilter_ added in v0.1.0

type TCPSFilter_ = internal.TCPSFilter_

type TCPSMesher

type TCPSMesher = internal.TCPSMesher

type TCPSOutgate

type TCPSOutgate = internal.TCPSOutgate

type TConn

type TConn = internal.TConn

type TUDSBackend added in v0.1.5

type TUDSBackend = internal.TUDSBackend

type TUDSOutgate added in v0.1.5

type TUDSOutgate = internal.TUDSOutgate

type ThriftBridge added in v0.1.2

type ThriftBridge = internal.ThriftBridge // for implementing Thrift server in exts

type UDPSBackend

type UDPSBackend = internal.UDPSBackend

type UDPSFilter added in v0.1.0

type UDPSFilter = internal.UDPSFilter

type UDPSFilter_ added in v0.1.0

type UDPSFilter_ = internal.UDPSFilter_
type UDPSLink = internal.UDPSLink

type UDPSMesher

type UDPSMesher = internal.UDPSMesher

type UDPSOutgate

type UDPSOutgate = internal.UDPSOutgate
type ULink = internal.ULink

type UUDSBackend added in v0.1.5

type UUDSBackend = internal.UUDSBackend

type UUDSOutgate added in v0.1.5

type UUDSOutgate = internal.UUDSOutgate

type Upload

type Upload = internal.Upload

type XConn added in v0.1.0

type XConn = internal.XConn

type XConnection added in v0.1.6

type XConnection = internal.XConnection
type XLink = internal.XLink

type XOneway added in v0.1.6

type XOneway = internal.XOneway

type XStream added in v0.1.6

type XStream = internal.XStream

Jump to

Keyboard shortcuts

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