service: add ChosenService function.
This commit is contained in:
+5
-4
@@ -155,8 +155,6 @@ func (kv KeyValue) float64(name string, defaultValue float64) float64 {
|
|||||||
return defaultValue
|
return defaultValue
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Do these really need to be package level?
|
|
||||||
|
|
||||||
// Platform returns a description of the system service.
|
// Platform returns a description of the system service.
|
||||||
func Platform() string {
|
func Platform() string {
|
||||||
if system == nil {
|
if system == nil {
|
||||||
@@ -184,8 +182,6 @@ func newSystem() System {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Choose system could return the choosen system.
|
|
||||||
|
|
||||||
// ChooseSystem chooses a system from the given system services.
|
// ChooseSystem chooses a system from the given system services.
|
||||||
// SystemServices are considered in the order they are suggested.
|
// SystemServices are considered in the order they are suggested.
|
||||||
// Calling this may change what Interactive and Platform return.
|
// Calling this may change what Interactive and Platform return.
|
||||||
@@ -194,6 +190,11 @@ func ChooseSystem(a ...System) {
|
|||||||
system = newSystem()
|
system = newSystem()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ChosenSystem returns the system that service will use.
|
||||||
|
func ChosenSystem() System {
|
||||||
|
return system
|
||||||
|
}
|
||||||
|
|
||||||
// AvailableSystems returns the list of system services considered
|
// AvailableSystems returns the list of system services considered
|
||||||
// when choosing the system service.
|
// when choosing the system service.
|
||||||
func AvailableSystems() []System {
|
func AvailableSystems() []System {
|
||||||
|
|||||||
Reference in New Issue
Block a user