Documentation ¶
Index ¶
- Variables
- func BuildAPI(m *MinihyperProxy) *mux.Router
- type CreateHopperRequest
- type CreateHopperResponse
- type CreateIncomingHopRequest
- type CreateOutgoingHopRequest
- type CreateProxyRequest
- type CreateProxyResponse
- type CreateRouteRequest
- type CreateRouteResponse
- type EmptyRequest
- type GetHopsRequest
- type GetHopsResponse
- type GetIncomingHopsResponse
- type GetOutgoingHopsResponse
- type GetServerRequest
- type HopInfo
- type HopperServer
- func (h *HopperServer) BuildNewIncomingHop(target *url.URL, hop *url.URL)
- func (h *HopperServer) BuildNewOutgoingHop(target *url.URL, hop *url.URL)
- func (s *HopperServer) Info() *map[string]interface{}
- func (h *HopperServer) Name() string
- func (h *HopperServer) Serve()
- func (h *HopperServer) Stop()
- func (h *HopperServer) Type() string
- type HttpError
- type ListServersResponse
- type MinihyperProxy
- func (m *MinihyperProxy) AddHop(serverName string, target *url.URL, hop *url.URL) (httpErr *HttpError)
- func (m *MinihyperProxy) GetHopperInfo(Name string) (serverInfo ServerInfo, httpErr *HttpError)
- func (m *MinihyperProxy) GetHoppersInfo() (serversInfo []ServerInfo)
- func (m *MinihyperProxy) GetIncomingHops(serverName string) (hops map[string]*url.URL, httpErr *HttpError)
- func (m *MinihyperProxy) GetOutgoingHops(serverName string) (hops map[string]*url.URL, httpErr *HttpError)
- func (m *MinihyperProxy) GetProxiesInfo() (serversInfo []ServerInfo)
- func (m *MinihyperProxy) GetProxyInfo(Name string) (serverInfo ServerInfo, httpErr *HttpError)
- func (m *MinihyperProxy) GetProxyMap(serverName string) (proxyMap map[string]string, httpErr *HttpError)
- func (m *MinihyperProxy) GetServerInfo(Name string) (serverInfo ServerInfo, httpErr *HttpError)
- func (m *MinihyperProxy) GetServersInfo() (serversInfo []ServerInfo)
- func (m *MinihyperProxy) ReceiveHop(serverName string, target *url.URL, hop *url.URL) (httpErr *HttpError)
- type ProxyInfo
- type ProxyMapResponse
- type ProxyServer
- func (s *ProxyServer) DeleteProxy(route *url.URL)
- func (s *ProxyServer) Info() *map[string]interface{}
- func (s *ProxyServer) NewProxy(route *url.URL, target *url.URL)
- func (s *ProxyServer) Serve()
- func (s *ProxyServer) StartIncomingHopProxy(director func(*http.Request), ...)
- func (s *ProxyServer) StartOutgoingHopProxy(director func(*http.Request), ...)
- func (s *ProxyServer) Stop()
- func (s *ProxyServer) Type() string
- type RouteFunction
- type Server
- type ServerInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var BodyUnmarshallError = &HttpError{ErrString: "Error unmarshalling body", code: 422}
View Source
var EmptyFieldError = &HttpError{ErrString: "Required field is empty", code: 422}
View Source
var InvalidBodyError = &HttpError{ErrString: "Invalid body structure", code: 422}
View Source
var NoServerFoundError = &HttpError{ErrString: "Server not Found", code: 500}
View Source
var RequestUnmarshallError = &HttpError{ErrString: "Error unmarshalling request", code: 422}
View Source
var ServerHostnamePortTakenError = &HttpError{ErrString: "Server with provided hostname and port already exists", code: 500}
View Source
var ServerNameAlreadyExistsError = &HttpError{ErrString: "Server with provided name already exists", code: 500}
View Source
var URLParsingError = &HttpError{ErrString: "Can't parse given URL", code: 500}
View Source
var WrongServerTypeError = &HttpError{ErrString: "Wrong server Type", code: 500}
Functions ¶
func BuildAPI ¶
func BuildAPI(m *MinihyperProxy) *mux.Router
Types ¶
type CreateHopperRequest ¶
type CreateHopperResponse ¶
type CreateProxyRequest ¶
type CreateProxyResponse ¶
type CreateRouteRequest ¶
type CreateRouteResponse ¶
type CreateRouteResponse CreateRouteRequest
type EmptyRequest ¶
type EmptyRequest struct { }
type GetHopsRequest ¶
type GetHopsRequest struct {
Name string `json:"Name"`
}
type GetHopsResponse ¶
type GetIncomingHopsResponse ¶
type GetOutgoingHopsResponse ¶
type GetServerRequest ¶
type GetServerRequest struct {
Name string `json:"Name"`
}
type HopperServer ¶
type HopperServer struct { ServerName string Hostname string IncomingHopsReference map[string]*url.URL OutgoingHopsReference map[string]*url.URL IncomingHopProxy *ProxyServer OutgoingHopProxy *ProxyServer Status string // contains filtered or unexported fields }
func NewHopperServer ¶
func NewHopperServer(serverName string, hostname string, incomingHopPort string, outgoingHopPort string) *HopperServer
func (*HopperServer) BuildNewIncomingHop ¶
func (h *HopperServer) BuildNewIncomingHop(target *url.URL, hop *url.URL)
func (*HopperServer) BuildNewOutgoingHop ¶
func (h *HopperServer) BuildNewOutgoingHop(target *url.URL, hop *url.URL)
func (*HopperServer) Info ¶
func (s *HopperServer) Info() *map[string]interface{}
func (*HopperServer) Name ¶
func (h *HopperServer) Name() string
func (*HopperServer) Serve ¶
func (h *HopperServer) Serve()
func (*HopperServer) Stop ¶
func (h *HopperServer) Stop()
func (*HopperServer) Type ¶
func (h *HopperServer) Type() string
type HttpError ¶
type HttpError struct { ErrString string `json:"Error"` // contains filtered or unexported fields }
type ListServersResponse ¶
type ListServersResponse struct {
Info []ServerInfo `json:"Info"`
}
type MinihyperProxy ¶
type MinihyperProxy struct { ErrorLog *log.Logger WarnLog *log.Logger InfoLog *log.Logger Servers map[string]*Server ServersNameReference map[string]bool // contains filtered or unexported fields }
func NewMinihyperProxy ¶
func NewMinihyperProxy() (m *MinihyperProxy)
func (*MinihyperProxy) GetHopperInfo ¶
func (m *MinihyperProxy) GetHopperInfo(Name string) (serverInfo ServerInfo, httpErr *HttpError)
func (*MinihyperProxy) GetHoppersInfo ¶
func (m *MinihyperProxy) GetHoppersInfo() (serversInfo []ServerInfo)
func (*MinihyperProxy) GetIncomingHops ¶
func (*MinihyperProxy) GetOutgoingHops ¶
func (*MinihyperProxy) GetProxiesInfo ¶
func (m *MinihyperProxy) GetProxiesInfo() (serversInfo []ServerInfo)
func (*MinihyperProxy) GetProxyInfo ¶
func (m *MinihyperProxy) GetProxyInfo(Name string) (serverInfo ServerInfo, httpErr *HttpError)
func (*MinihyperProxy) GetProxyMap ¶
func (m *MinihyperProxy) GetProxyMap(serverName string) (proxyMap map[string]string, httpErr *HttpError)
func (*MinihyperProxy) GetServerInfo ¶
func (m *MinihyperProxy) GetServerInfo(Name string) (serverInfo ServerInfo, httpErr *HttpError)
func (*MinihyperProxy) GetServersInfo ¶
func (m *MinihyperProxy) GetServersInfo() (serversInfo []ServerInfo)
func (*MinihyperProxy) ReceiveHop ¶
type ProxyMapResponse ¶
type ProxyServer ¶
type ProxyServer struct { ServerName string Hostname string ServerPort string Status string ProxyReference map[string]string ProxyMap map[string]func(w http.ResponseWriter, r *http.Request) // contains filtered or unexported fields }
func NewProxyServer ¶
func NewProxyServer(serverName string, hostname string, port string) *ProxyServer
func (*ProxyServer) DeleteProxy ¶
func (s *ProxyServer) DeleteProxy(route *url.URL)
func (*ProxyServer) Info ¶
func (s *ProxyServer) Info() *map[string]interface{}
func (*ProxyServer) Serve ¶
func (s *ProxyServer) Serve()
func (*ProxyServer) StartIncomingHopProxy ¶
func (s *ProxyServer) StartIncomingHopProxy(director func(*http.Request), serveFunc func(*httputil.ReverseProxy, http.ResponseWriter, *http.Request))
func (*ProxyServer) StartOutgoingHopProxy ¶
func (s *ProxyServer) StartOutgoingHopProxy(director func(*http.Request), serveFunc func(*httputil.ReverseProxy, http.ResponseWriter, *http.Request))
func (*ProxyServer) Stop ¶
func (s *ProxyServer) Stop()
func (*ProxyServer) Type ¶
func (s *ProxyServer) Type() string
type RouteFunction ¶
type RouteFunction func(interface{}, *MinihyperProxy) (reponse interface{}, httpErr *HttpError)
type ServerInfo ¶
type ServerInfo *map[string]interface{}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.