Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { // Servers are the servers to create. The key of each server must be // a unique name identifying the server for your own convenience; // the order of servers does not matter. Servers map[string]*Server `json:"servers,omitempty"` }
App is a Kengine app that operates closest to layer 4 of the OSI model.
type MatchSNI ¶
type MatchSNI []string
MatchSNI matches based on SNI (server name indication). ref; https://khulnasoft.com/docs/modules/tls.handshake_match.sni
type Route ¶
type Route struct { // Matchers define the conditions upon which to execute the handlers. // All matchers within the same set must match, and at least one set // must match; in other words, matchers are AND'ed together within a // set, but multiple sets are OR'ed together. No matchers matches all. MatcherSets []Match `json:"match,omitempty"` // Handlers define the behavior for handling the stream. They are // executed in sequential order if the route's matchers match. Handlers []Handler `json:"handle,omitempty"` }
Route represents a collection of handlers that are gated by matching logic. A route is invoked if its matchers match the byte stream. In an equivalent "if...then" statement, matchers are like the "if" clause and handlers are the "then" clause: if the matchers match, then the handlers will be executed.
type RouteList ¶
type RouteList []*Route
RouteList is a list of connection routes that can create a middleware chain. Routes are evaluated in sequential order: for the first route, the matchers will be evaluated, and if matched, the handlers invoked; and so on for the second route, etc.
type Server ¶
type Server struct { // The network address to bind to. Any Kengine network address // is an acceptable value: // https://khulnasoft.com/docs/conventions#network-addresses Listen []string `json:"listen,omitempty"` // Routes express composable logic for handling byte streams. Routes RouteList `json:"routes,omitempty"` // Maximum time connections have to complete the matching phase (the first terminal handler is matched). Default: 3s. MatchingTimeout kengine.Duration `json:"matching_timeout,omitempty"` }
Server represents a Kengine layer4 server.