{"modulePath":"github.com/hyperhq/hypercli","version":"v1.10.16","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package server\n\n## Types\n\n```go\ntype Addr struct {\n\tProto string\n\tAddr  string\n}\n```\nAddr contains string representation of address and its protocol (tcp, unix...).\n\n```go\ntype Config struct {\n\tLogging                  bool\n\tEnableCors               bool\n\tCorsHeaders              string\n\tAuthorizationPluginNames []string\n\tVersion                  string\n\tSocketGroup              string\n\tTLSConfig                *tls.Config\n\tAddrs                    []Addr\n}\n```\nConfig provides the configuration for the API server\n\n```go\ntype HTTPServer struct {\n\t// contains filtered or unexported fields\n}\n```\nHTTPServer contains an instance of http server and the listener. srv \\*http.Server, contains configuration to create a http server and a mux router with all api end points. l   net.Listener, is a TCP or Socket listener that dispatches incoming request to the router.\n\n```go\nfunc (s *HTTPServer) Close() error\n```\nClose closes the HTTPServer from listening for the inbound requests.\n\n```go\nfunc (s *HTTPServer) Serve() error\n```\nServe starts listening for inbound requests.\n\n```go\ntype Server struct {\n\t// contains filtered or unexported fields\n}\n```\nServer contains instance details for the server\n\n```go\nfunc New(cfg *Config) (*Server, error)\n```\nNew returns a new instance of the server based on the specified configuration. It allocates resources which will be needed for ServeAPI(ports, unix-sockets).\n\n```go\nfunc (s *Server) Close()\n```\nClose closes servers and thus stop receiving requests\n\n```go\nfunc (s *Server) InitRouters(d *daemon.Daemon)\n```\nInitRouters initializes a list of routers for the server.\n\n```go\nfunc (s *Server) Reload(config *daemon.Config)\n```\nReload reads configuration changes and modifies the server according to those changes. Currently, only the --debug configuration is taken into account.\n\n```go\nfunc (s *Server) Wait(waitChan chan error)\n```\nWait blocks the server goroutine until it exits. It sends an error message if there is any error during the API execution.\n\n","path":"github.com/hyperhq/hypercli/api/server","name":"server","synopsis":"","isRedistributable":true}
