public
Created

versioning idea

  • Download Gist
versioning.scala
Scala
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
package versioning
 
// version 1 defined 2 actions here
trait V1 {
val SetOptOut = EmailPreferenceActions.SetOptOut
val GetSailthruEmail = EmailPreferenceActions.GetSailthruEmail
}
object V1Api extends V1
 
// version 2 need to replace SetOptOut with SetOptOutImproved
// while keeping the other ones the same as V1
trait V2 extends V1 {
override val SetOptOut = EmailPreferenceActions.SetOptOutImproved
}
object V2Api extends V2
 
 
object EmailPreferenceActions {
case class SetOptOut ...
case class GetSailthruEmail ...
 
case class SetOptOutImproved ...
}
 
 
object EmailPreferenceActionsWithRedis {
case class SetOptOutImproved ...
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.