You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to make more sense of the structs and their names and function, we should rename OpenControl to Workspace / LocalWorkspace.
To the external user of the go code, if they import the code. It's not obvious what OpenControl means. Also, right now it represents the in-memory data for all the collected resources via the get command which essentially creates a workspace.
And rename things like NewOpenControl to NewWorkspace
LocalWorkspace should implement an interface called Workspace.
That interface will have methods like:
// not the exact code interface but just a rough ideatypeWorkspaceinterface {
GetComponents() Components// return the interface of Components which needs to be done.GetCertifications() Certifications// return the interface of Certifications which needs to be done....// and so on
}
So... Why have an interface and struct? It makes it easier for external projects to use the interface in tests. Instead of 1) having to load same fixture data from this repo in their project or 2) having to import all the concrete structs and their different versions (e.g. different component.yaml versions), they can just use the interface and mock it with https://godoc.org/github.com/stretchr/testify/mock
The text was updated successfully, but these errors were encountered:
In order to make more sense of the structs and their names and function, we should rename
OpenControl
toWorkspace
/LocalWorkspace
.To the external user of the go code, if they import the code. It's not obvious what
OpenControl
means. Also, right now it represents the in-memory data for all the collected resources via theget
command which essentially creates a workspace.And rename things like
NewOpenControl
toNewWorkspace
LocalWorkspace
- Rename opencontrol to workspace #206 @jcscottiiiLocalWorkspace
should implement an interface calledWorkspace
.That interface will have methods like:
So... Why have an interface and struct? It makes it easier for external projects to use the interface in tests. Instead of 1) having to load same fixture data from this repo in their project or 2) having to import all the concrete structs and their different versions (e.g. different component.yaml versions), they can just use the interface and mock it with https://godoc.org/github.com/stretchr/testify/mock
The text was updated successfully, but these errors were encountered: