-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
15 changed files
with
222 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@host = http://localhost:19876 | ||
|
||
### | ||
# @name: List all flags | ||
# | ||
GET {{ host }}/admin/flags/ | ||
|
||
### | ||
# @name: Get flag by id | ||
|
||
@featureId = feature-2 | ||
|
||
GET {{ host }}/admin/flags/{{featureId}} | ||
|
||
### | ||
# @name: Update flag by id | ||
|
||
PUT {{ host }}/admin/flags/{{featureId}} | ||
Content-Type: application/json | ||
|
||
{ | ||
"status": "enabled" | ||
} |
21 changes: 0 additions & 21 deletions
21
modules/flags/src/main/scala/pillars/flags/FeatureFlag.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
modules/flags/src/main/scala/pillars/flags/endpoints.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package pillars.flags | ||
|
||
import io.github.iltotore.iron.* | ||
import io.github.iltotore.iron.constraint.all.* | ||
|
||
final case class FeatureFlag(name: Flag, status: Status): | ||
def isEnabled: Boolean = status.isEnabled | ||
|
||
private type FlagConstraint = Not[Blank] DescribedAs "Name must not be blank" | ||
opaque type Flag <: String = String :| FlagConstraint | ||
|
||
object Flag extends RefinedTypeOps[String, FlagConstraint, Flag] | ||
|
||
enum Status: | ||
case Enabled, Disabled | ||
|
||
def isEnabled: Boolean = this match | ||
case Enabled => true | ||
case Disabled => false | ||
end Status |
Oops, something went wrong.