// Client is exported for testing subpackages func Client(resp string) (*clients.Client, *httptest.Server) { handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, resp) }) server := httptest.NewServer(handler) client, _ := clients.NewClient(&clients.Connection{Host: "localhost", Port: 8000, Username: "******", Password: "******", AuthenticationType: clients.BasicAuth}) client.SetBase(server.URL) return client, server }
// Client is exported for testing subpackages func Client(resp string) (*clients.Client, *httptest.Server) { handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, resp) }) server := httptest.NewServer(handler) client, _ := clients.NewClient("localhost", 8000, "admin", "admin", clients.BasicAuth) client.SetBase(server.URL) return client, server }
// NewClient creates the Client struct used for searching, etc. func NewClient(host string, port int64, username string, password string, authType int) (*Client, error) { client, err := clients.NewClient(&clients.Connection{Host: host, Port: port, Username: username, Password: password, AuthenticationType: authType}) return convertToClient(client), err }
// NewClient creates the Client struct used for searching, etc. func NewClient(host string, port int64, username string, password string, authType int) (*Client, error) { client, err := clients.NewClient(host, port, username, password, authType) return convertToClient(client), err }