You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2018/04/11 22:30:32 UTC

[GitHub] rob05c commented on issue #2124: Add TO Go GET deliveryservices routes

rob05c commented on issue #2124: Add TO Go GET deliveryservices routes
URL: https://github.com/apache/incubator-trafficcontrol/pull/2124#issuecomment-380616330
 
 
   @DylanVolz What do you think of this versioning scheme?
   
   The highlights are: 
   
   Structs are versioned via anonymous members:
   ```type DeliveryServiceNullableV13 struct {
   	DeliveryServiceNullableV12
   	DeepCachingType   *DeepCachingType `json:"deepCachingType" db:"deep_caching_type"`
   ```
   
   There's a `GetRefType` for each different version:
   ```func GetRefTypeV12() *TODeliveryServiceV12 {
   	return &refTypeV12
   }
   
   {1.3, http.MethodGet, `deliveryservices/?(\.json)?$`, api.ReadHandler(deliveryservice.GetRefTypeV13()...
   ```
   (This still isn't necessary for routes that don't change, e.g. `divisions` can still only have `{1.2, http.MethodGet, `divisions/?(\.json)?$`, api.ReadHandler(deliveryservice.GetRefType()...` [which implicitly serves `1.3`])
   
   And functions on each API alias that don't change can be reused:
   ```func (ds *TODeliveryServiceV13) GetType() string {
   	v12 := TODeliveryServiceV12(ds.DeliveryServiceNullableV12)
   	return v12.GetType()
   }```

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


With regards,
Apache Git Services