Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider making ovsdb.Operation an interface #178

Open
dave-tucker opened this issue Jun 24, 2021 · 0 comments
Open

Consider making ovsdb.Operation an interface #178

dave-tucker opened this issue Jun 24, 2021 · 0 comments

Comments

@dave-tucker
Copy link
Collaborator

It's used a lot as a return type (e.g client.Create return []ovsdb.Operation and as a parameter in client.Transact

Since there are a number of optional fields, constructing operations yourself can be error prone (and annoying when having to create temporary variables to assign to a *string as literals can't be indirected). To avoid leaking this datastructure outside the OVSDB package, we should consider providing an intermediate type in the client package - like we've done for Condition or Mutation for example:

package client

type Operation interface {
    json.Marshaler
    json.Unmarshaler
}

We'd also want functions to create new Operations, e.g NewInsertOperation, NewDeleteOperation, NewCommentOperation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant