-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #214 from opencontrol/move-standards-interface
Move standards interface
- Loading branch information
Showing
19 changed files
with
412 additions
and
305 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
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 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,12 @@ | ||
package common | ||
|
||
// Control is the interface for getting all the attributes for a given control. | ||
// Schema info: https://github.com/opencontrol/schemas#standards-documentation | ||
// | ||
// GetName returns the string representation of the control. | ||
// | ||
// GetFamily returns which family the control belongs to. | ||
type Control interface { | ||
GetName() string | ||
GetFamily() string | ||
} |
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,71 @@ | ||
package mocks | ||
|
||
import "github.com/opencontrol/compliance-masonry/lib/common" | ||
import "github.com/stretchr/testify/mock" | ||
|
||
// Standard is an autogenerated mock type for the Standard type | ||
type Standard struct { | ||
mock.Mock | ||
} | ||
|
||
// GetControl provides a mock function with given fields: _a0 | ||
func (_m *Standard) GetControl(_a0 string) common.Control { | ||
ret := _m.Called(_a0) | ||
|
||
var r0 common.Control | ||
if rf, ok := ret.Get(0).(func(string) common.Control); ok { | ||
r0 = rf(_a0) | ||
} else { | ||
if ret.Get(0) != nil { | ||
r0 = ret.Get(0).(common.Control) | ||
} | ||
} | ||
|
||
return r0 | ||
} | ||
|
||
// GetControls provides a mock function with given fields: | ||
func (_m *Standard) GetControls() map[string]common.Control { | ||
ret := _m.Called() | ||
|
||
var r0 map[string]common.Control | ||
if rf, ok := ret.Get(0).(func() map[string]common.Control); ok { | ||
r0 = rf() | ||
} else { | ||
if ret.Get(0) != nil { | ||
r0 = ret.Get(0).(map[string]common.Control) | ||
} | ||
} | ||
|
||
return r0 | ||
} | ||
|
||
// GetName provides a mock function with given fields: | ||
func (_m *Standard) GetName() string { | ||
ret := _m.Called() | ||
|
||
var r0 string | ||
if rf, ok := ret.Get(0).(func() string); ok { | ||
r0 = rf() | ||
} else { | ||
r0 = ret.Get(0).(string) | ||
} | ||
|
||
return r0 | ||
} | ||
|
||
// GetSortedControls provides a mock function with given fields: | ||
func (_m *Standard) GetSortedControls() []string { | ||
ret := _m.Called() | ||
|
||
var r0 []string | ||
if rf, ok := ret.Get(0).(func() []string); ok { | ||
r0 = rf() | ||
} else { | ||
if ret.Get(0) != nil { | ||
r0 = ret.Get(0).([]string) | ||
} | ||
} | ||
|
||
return r0 | ||
} |
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,18 @@ | ||
package common | ||
|
||
// Standard is the container of all the information for a particular Standard. | ||
// Schema info: https://github.com/opencontrol/schemas#standards-documentation | ||
// | ||
// GetName returns the name | ||
// | ||
// GetControls returns all controls associated with the standard | ||
// | ||
// GetControl returns a particular control | ||
// | ||
// GetSortedControls returns a list of sorted controls | ||
type Standard interface { | ||
GetName() string | ||
GetControls() map[string]Control | ||
GetControl(string) Control | ||
GetSortedControls() []string | ||
} |
Oops, something went wrong.