mhoppa commented on a change in pull request #3947: Rewrite get federation 
deliveryservices to Go
URL: https://github.com/apache/trafficcontrol/pull/3947#discussion_r331524143
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/federations/ds.go
 ##########
 @@ -104,3 +105,37 @@ func getFedNameByID(tx *sql.Tx, id int) (string, bool, 
error) {
        }
        return name, true, nil
 }
+
+// TOFedDSes data structure to use on read of federation deliveryservices
+type TOFedDSes struct {
+       api.APIInfoImpl `json:"-"`
+       tc.FederationDeliveryServiceNullable
+}
+
+func (v *TOFedDSes) NewReadObj() interface{} { return 
&tc.FederationDeliveryServiceNullable{} }
+func (v *TOFedDSes) SelectQuery() string     { return selectQuery() }
+func (v *TOFedDSes) ParamColumns() map[string]dbhelpers.WhereColumnInfo {
+       return map[string]dbhelpers.WhereColumnInfo{
+               "id":   dbhelpers.WhereColumnInfo{"fds.federation", api.IsInt},
+               "dsID": dbhelpers.WhereColumnInfo{"fds.deliveryservice", 
api.IsInt},
+       }
+}
+func (v *TOFedDSes) GetType() string {
+       return "federation_deliveryservice"
+}
+
+func (v *TOFedDSes) Read() ([]interface{}, error, error, int) { return 
api.GenericRead(v) }
 
 Review comment:
   Ill defer to another PR 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to