Documentation ¶
Index ¶
- Constants
- func BuildRequest(method, host, path string, body interface{}) *http.Request
- func DoRequest(httpClient *http.Client, request *http.Request, responseBody interface{}) (int, *http.Response)
- func ExtractPathVar(r *http.Request, varName string) (varValue string)
- func NewRouter(prefix string, routes []Route) (r *mux.Router)
- func RandomString(n int) string
- func SendJSONReplyOK(w http.ResponseWriter, replyContent interface{})
- func StartServer(serviceName, hostPort string, port int, prefixPath string, routes []Route)
- type GenericClient
- type Node
- type Route
Constants ¶
View Source
const ( ServiceEnvVarName = "SERVICE_ID" InstanceEnvVarName = "INSTANCE_ID" )
View Source
const ( TCP string = "tcp" UDP string = "udp" )
View Source
const (
// LocalhostAddr contains the default interface address
LocalhostAddr = "0.0.0.0"
)
View Source
const (
// PathVarFormat format string to add vars to path
PathVarFormat = "{%s}"
)
Variables ¶
This section is empty.
Functions ¶
func BuildRequest ¶
func RandomString ¶
func SendJSONReplyOK ¶
func SendJSONReplyOK(w http.ResponseWriter, replyContent interface{})
Types ¶
type GenericClient ¶
func NewGenericClient ¶
func NewGenericClient(addr string, port int) *GenericClient
func (*GenericClient) SetHostPort ¶
func (c *GenericClient) SetHostPort(addr string, port int)
Click to show internal directories.
Click to hide internal directories.