Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //DefaultPortRangeMin - Default min port range DefaultPortRangeMin = 8000 //DefaultPortRangeMax - Default max port range DefaultPortRangeMax = 9000 //ServicePool - ServerPoolEntry slice ServicePool []*ServerPoolEntry //ConfigPort - Default configuration handler port ConfigPort = 50660 )
Functions ¶
func CheckIfPortFree ¶
CheckIfPortFree - Checks a given port to see if anything is currently using it.
func ConfigHandler ¶
ConfigHandler - function to output server pool config
func GetAvailablePort ¶
func GetAvailablePort() int
GetAvailablePort - Gets the next available port from a range
func InstantiateServerPool ¶
InstantiateServerPool - This will configure and start the services passed via the functions parameter.
func Listen ¶
func Listen(n *ServerPoolEntry)
Listen - initializes a handler service, this function also starts a given listener.
Types ¶
type ConfigResponse ¶
type ConfigResponse struct {
ServicePool []Service
}
ConfigResponse -
func (*ConfigResponse) ToJSON ¶
func (c *ConfigResponse) ToJSON() []byte
ToJSON - Converts object to JSON
type ServerPoolEntry ¶
type ServerPoolEntry struct { Name string PortAllocated int Handler func(string, string) []byte IsActive bool HasError error }
ServerPoolEntry - contains server pool entry information.
func (*ServerPoolEntry) ListenAsync ¶
func (n *ServerPoolEntry) ListenAsync()
ListenAsync - initializes a handler service, this function also starts a given listener as a go func.
Click to show internal directories.
Click to hide internal directories.