func (connection *EventStoreConnection) Close() error {
	connection.Mutex.Lock()
	connection.connected = false
	connection.Mutex.Unlock()
	log.Printf("[info] closing the connection (id: %+v) to event store...\n'", connection.ConnectionID)
	err := connection.Socket.Close()
	connection.Socket = nil
	if err != nil {
		log.Printf("[error] failed closing the connection to event store...%+v\n'", err)
	}
	closeConnection(connection)
	return err
}
Close attempts to close the connection to Event Store
package goes
import (
	"fmt"
	"log"
	"net"
	"time"
	"sync"
	uuid "github.com/gofrs/uuid"
	"github.com/golang/protobuf/proto"
	"github.com/pgermishuys/goes/protobuf"
)
type Configuration struct {
	Address             string
	Port                int
	Login               string
	Password            string
	ReconnectionDelay   int
	MaxReconnects       int
	MaxOperationRetries int
	EndpointDiscoverer  EndpointDiscoverer
}
type EventStoreConnection struct {
	Config        *Configuration
	Socket        *net.TCPConn
	connected     bool
	requests      map[uuid.UUID]chan<- TCPPackage
	subscriptions map[uuid.UUID]*Subscription
	ConnectionID  uuid.UUID
	Mutex         *sync.Mutex
}
func NewConfiguration() *Configuration {
	return &Configuration{
		ReconnectionDelay:   10000,
		MaxReconnects:       10,
		MaxOperationRetries: 10,
	}
}
func (connection *EventStoreConnection) Connect() error {
	connection.requests = make(map[uuid.UUID]chan<- TCPPackage)
	connection.subscriptions = make(map[uuid.UUID]*Subscription)
	return connectWithRetries(connection, connection.Config.MaxReconnects)
}