func GetServerAndClient() (*mockserver.Server, *client.Client, error) {
	var (
		server *mockserver.Server
		err    error
	)
	authName := os.Getenv("GRAYLOG_AUTH_NAME")
	authPass := os.Getenv("GRAYLOG_AUTH_PASSWORD")
	if authName == "" {
		authName = adminName
	}
	if authPass == "" {
		authPass = "admin"
	}
	endpoint := os.Getenv("GRAYLOG_WEB_ENDPOINT_URI")
	if endpoint == "" {
		server, err = mockserver.NewServer("", nil)
		if err != nil {
			return nil, nil, errors.Wrap(err, "Failed to get Mock Server")
		}
		server.SetAuth(true)
		endpoint = server.Endpoint()
	}
	client, err := client.NewClient(endpoint, authName, authPass)
	if err != nil {
		if server != nil {
			server.Close()
		}
		return nil, nil, errors.Wrap(err, "NewClient is failure")
	}
	if server != nil {
		server.Start()
	}
	return server, client, nil
}
// GetServerAndClient returns server and client.
GetServerAndClient returns server and client.
// GetServerAndClient returns server and client .
func GetServerAndClient() (*mockserver.Server, *client.Client, error) {
	var (
		server *mockserver.Server
		err    error
	)
	authName := os.Getenv("GRAYLOG_AUTH_NAME")
	authPass := os.Getenv("GRAYLOG_AUTH_PASSWORD")
	if authName == "" {
		authName = adminName
	}
	if authPass == "" {
		authPass = "admin"
	}
	endpoint := os.Getenv("GRAYLOG_WEB_ENDPOINT_URI")
	if endpoint == "" {
		server, err = mockserver.NewServer("", nil)
		if err != nil {
			return nil, nil, errors.Wrap(err, "Failed to get Mock Server")
		}
		server.SetAuth(true)
		endpoint = server.Endpoint()
	}
	client, err := client.NewClient(endpoint, authName, authPass)
	if err != nil {
		if server != nil {
			server.Close()
		}
		return nil, nil, errors.Wrap(err, "NewClient is failure")
	}
	if server != nil {
		server.Start()
	}
	return server, client, nil
}
func GetServerAndClient ( ) ( * mockserver . Server , * client . Client , error ) { var ( server * mockserver . Server err error ) authName := os . Getenv ( " " ) authPass := os . Getenv ( " " ) if authName == " " { authName = adminName } if authPass == " " { authPass = " " } endpoint := os . Getenv ( " " ) if endpoint == " " { server , err = mockserver . NewServer ( " " , nil ) if err != nil { return nil , nil , errors . Wrap ( err , " " ) } server . SetAuth ( true ) endpoint = server . Endpoint ( ) } client , err := client . NewClient ( endpoint , authName , authPass ) if err != nil { if server != nil { server . Close ( ) } return nil , nil , errors . Wrap ( err , " " ) } if server != nil { server . Start ( ) } return server , client , nil }
GetServerAndClient returns server and client.
GetServerAndClient returns server and client .