Extracting out duplicated structs
diff --git a/rackspace/lb/v1/lbs/requests.go b/rackspace/lb/v1/lbs/requests.go
index 38f109f..6e1d614 100644
--- a/rackspace/lb/v1/lbs/requests.go
+++ b/rackspace/lb/v1/lbs/requests.go
@@ -9,6 +9,7 @@
"github.com/rackspace/gophercloud/pagination"
"github.com/rackspace/gophercloud/rackspace/lb/v1"
"github.com/rackspace/gophercloud/rackspace/lb/v1/nodes"
+ "github.com/rackspace/gophercloud/rackspace/lb/v1/sessions"
"github.com/rackspace/gophercloud/rackspace/lb/v1/vips"
)
@@ -128,7 +129,7 @@
// Optional - specifies whether multiple requests from clients are directed
// to the same node.
- SessionPersistence *SessionPersistence
+ SessionPersistence *sessions.SessionPersistence
// Optional - enables or disables HTTP to HTTPS redirection for the load
// balancer. When enabled, any HTTP request returns status code 301 (Moved
diff --git a/rackspace/lb/v1/lbs/requests_test.go b/rackspace/lb/v1/lbs/requests_test.go
index 47d96d7..dafbda9 100644
--- a/rackspace/lb/v1/lbs/requests_test.go
+++ b/rackspace/lb/v1/lbs/requests_test.go
@@ -5,6 +5,7 @@
"github.com/rackspace/gophercloud/pagination"
"github.com/rackspace/gophercloud/rackspace/lb/v1/nodes"
+ "github.com/rackspace/gophercloud/rackspace/lb/v1/sessions"
"github.com/rackspace/gophercloud/rackspace/lb/v1/vips"
th "github.com/rackspace/gophercloud/testhelper"
"github.com/rackspace/gophercloud/testhelper/client"
@@ -186,7 +187,7 @@
Condition: "ENABLED",
},
},
- SessionPersistence: SessionPersistence{Type: "HTTP_COOKIE"},
+ SessionPersistence: sessions.SessionPersistence{Type: "HTTP_COOKIE"},
ConnectionThrottle: ConnectionThrottle{
MinConns: 10,
MaxConns: 100,
diff --git a/rackspace/lb/v1/lbs/results.go b/rackspace/lb/v1/lbs/results.go
index a556f21..0ad998a 100644
--- a/rackspace/lb/v1/lbs/results.go
+++ b/rackspace/lb/v1/lbs/results.go
@@ -6,6 +6,7 @@
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
"github.com/rackspace/gophercloud/rackspace/lb/v1/nodes"
+ "github.com/rackspace/gophercloud/rackspace/lb/v1/sessions"
"github.com/rackspace/gophercloud/rackspace/lb/v1/vips"
)
@@ -119,7 +120,7 @@
// SessionPersistence specifies whether multiple requests from clients are
// directed to the same node.
- SessionPersistence SessionPersistence
+ SessionPersistence sessions.SessionPersistence
// ConnectionThrottle specifies a limit on the number of connections per IP
// address to help mitigate malicious or abusive traffic to your applications.
@@ -137,11 +138,6 @@
IPv6Private string `json:"ipv6Servicenet" mapstructure:"ipv6Servicenet"`
}
-// SessionPersistence - temp
-type SessionPersistence struct {
- Type string `json:"persistenceType" mapstructure:"persistenceType"`
-}
-
// ConnectionThrottle - temp
type ConnectionThrottle struct {
MinConns int `json:"minConnections" mapstructure:"minConnections"`