-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(metadata): implement Unit of Measure (UoM) ADR (#4119)
* feat(metadata): implement Unit of Measure (UoM) ADR Signed-off-by: Chris Hung <chris@iotechsys.com> * fix(snap): fix PR snap test error Signed-off-by: Chris Hung <chris@iotechsys.com> Signed-off-by: Chris Hung <chris@iotechsys.com>
- Loading branch information
Chris Hung
authored
Aug 12, 2022
1 parent
e3ca38a
commit 03487ec
Showing
15 changed files
with
314 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Uom] | ||
Source="reference to source for all UoM if not specified below" | ||
[Uom.Units] | ||
[Uom.Units.temperature] | ||
Source="www.weather.com" | ||
Values=["C","F","K"] | ||
[Uom.Units.weights] | ||
Source="www.usa.gov/federal-agencies/weights-and-measures-division" | ||
Values=["lbs","ounces","kilos","grams"] |
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,20 @@ | ||
// | ||
// Copyright (C) 2022 IOTech Ltd | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package container | ||
|
||
import ( | ||
"github.com/edgexfoundry/go-mod-bootstrap/v2/di" | ||
|
||
"github.com/edgexfoundry/edgex-go/internal/core/metadata/infrastructure/interfaces" | ||
) | ||
|
||
// UnitsOfMeasureInterfaceName contains the name of the interfaces.UnitsOfMeasure implementation in the DIC. | ||
var UnitsOfMeasureInterfaceName = di.TypeInstanceToName((*interfaces.UnitsOfMeasure)(nil)) | ||
|
||
// UnitsOfMeasureFrom helper function queries the DIC and returns the interfaces.UnitsOfMeasure implementation. | ||
func UnitsOfMeasureFrom(get di.Get) interfaces.UnitsOfMeasure { | ||
return get(UnitsOfMeasureInterfaceName).(interfaces.UnitsOfMeasure) | ||
} |
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
24 changes: 24 additions & 0 deletions
24
internal/core/metadata/infrastructure/interfaces/mocks/UnitsOfMeasure.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.