Esempio n. 1
0
// ManagementClient is exported for testing subpackages
func ManagementClient(resp string) (*clients.ManagementClient, *httptest.Server) {
	handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		fmt.Fprintln(w, resp)
	})
	server := httptest.NewServer(handler)
	client, _ := clients.NewManagementClient(&clients.Connection{Host: "localhost", Username: "******", Password: "******", AuthenticationType: clients.BasicAuth})
	client.SetBase(server.URL)
	return client, server
}
Esempio n. 2
0
// ManagementClient is exported for testing subpackages
func ManagementClient(resp string) (*clients.ManagementClient, *httptest.Server) {
	handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		fmt.Fprintln(w, resp)
	})
	server := httptest.NewServer(handler)
	client, _ := clients.NewManagementClient("localhost", "admin", "admin", clients.BasicAuth)
	client.SetBase(server.URL)
	return client, server
}
Esempio n. 3
0
// NewManagementClient creates the Client struct used for managing databases, etc.
func NewManagementClient(host string, username string, password string, authType int) (*ManagementClient, error) {
	client, err := clients.NewManagementClient(host, username, password, authType)
	return convertToManageClient(client), err
}
Esempio n. 4
0
// NewManagementClient creates the Client struct used for managing databases, etc.
func NewManagementClient(host string, username string, password string, authType int) (*ManagementClient, error) {
	client, err := clients.NewManagementClient(&clients.Connection{Host: host, Username: username, Password: password, AuthenticationType: authType})
	return convertToManageClient(client), err
}