6.2 KiB
6.2 KiB
server
import "github.com/Akilan1999/p2p-rendering-computation/server"
source:https://github.com/afoley587/go-rev-proxy/tree/main
Index
- Variables
- func GetScheme(c *gin.Context) string
- func MapPort(port string, domainName string, serverAddress string) (string, string, error)
- func Proxy(c *gin.Context)
- func ProxyRun(port string)
- func SaveRegistration(OutsideHost string, InsideHost string) error
- func Server() (*gin.Engine, error)
- type Gpu
- type GpuClock
- type GpuTemperature
- type GpuUtilization
- type Query
- type RegistrationRequest
- type ReverseProxy
- type SysInfo
Variables
var (
//RunPort = 2002 // The server port to run on
//ReverseServerAddr = fmt.Sprint("0.0.0.0:", RunPort) // this is our reverse server ip address
//InsideProxyHostname = fmt.Sprint("proxy:", RunPort) // Requests from private network
//OutsideProxyHostname = fmt.Sprint("registration.localhost:", RunPort) // Requests from public network
KnownAddresses = map[string]string{} // Known Addresses
)
ReverseProxies Reverse to the map such as ReverseProxies[<domain nane>]ReverseProxy type
var ReverseProxies map[string]ReverseProxy
func GetScheme
func GetScheme(c *gin.Context) string
This function checks if TLS was enabled on the request and translates it to the proper scheme (http or https)
func MapPort
func MapPort(port string, domainName string, serverAddress string) (string, string, error)
func Proxy
func Proxy(c *gin.Context)
Proxy runs the actual proxy and will look at the hostnames requested from the received request. It will then translate that to the inside hostname and forward the request
func ProxyRun
func ProxyRun(port string)
func SaveRegistration
func SaveRegistration(OutsideHost string, InsideHost string) error
SaveRegistration Creates registration of proxy node
func Server
func Server() (*gin.Engine, error)
type Gpu
type Gpu struct {
GpuName string `xml:"product_name"`
BiosVersion string `xml:"vbios_version"`
FanSpeed string `xml:"fan_speed"`
Utilization GpuUtilization `xml:"utilization"`
Temperature GpuTemperature `xml:"temperature"`
Clock GpuClock `xml:"clocks"`
}
type GpuClock
type GpuClock struct {
GpuClock string `xml:"graphics_clock"`
GpuMemClock string `xml:"mem_clock"`
}
type GpuTemperature
type GpuTemperature struct {
GpuTemp string `xml:"gpu_temp"`
}
type GpuUtilization
type GpuUtilization struct {
GpuUsage string `xml:"gpu_util"`
MemoryUsage string `xml:"memory_util"`
}
type Query
type Query struct {
DriveVersion string `xml:"driver_version"`
Gpu Gpu `xml:"gpu"`
}
func GPUInfo
func GPUInfo() (*Query, error)
Gets GPU information by calling nvidia-smi in XML output
type RegistrationRequest
type RegistrationRequest struct {
OutsideHost string // Outside host address. The hostname or IP on the public network. For example foo.bar.com or foo.localhost
InsideHost string // Inside host address. The hostname or IP on the internal network. For example 192.168.10.5
}
type ReverseProxy
type ReverseProxy struct {
IPAddress string
Port string
}
type SysInfo
SysInfo saves the basic system information
type SysInfo struct {
Hostname string `bson:hostname`
Platform string `bson:platform`
CPU string `bson:cpu`
RAM uint64 `bson:ram`
Disk uint64 `bson:disk`
GPU *Query `xml: GpuInfo`
}
func ServerInfo
func ServerInfo() *SysInfo
Generated by gomarkdoc