client: add unexported method to Client interface

This allows adding methods to the interface without breaking users.

If an interface has an unexported method, then users cannot implement
it directly because they have no way of implementing that method. That
means that adding a method to the interface is not a breaking change.

Change-Id: I17bbed4306d062c528b35440a56571a217bbbd75
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/358414
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
diff --git a/client/client.go b/client/client.go
index 88c8333..77eb2d5 100644
--- a/client/client.go
+++ b/client/client.go
@@ -60,6 +60,8 @@
 
 	// ListIDs returns the IDs of all entries in the database.
 	ListIDs() ([]string, error)
+
+	unexported() // ensures that adding a method won't break users
 }
 
 type source interface {
@@ -71,6 +73,8 @@
 	dir string
 }
 
+func (*localSource) unexported() {}
+
 func (ls *localSource) GetByModule(module string) ([]*osv.Entry, error) {
 	content, err := ioutil.ReadFile(filepath.Join(ls.dir, module+".json"))
 	if os.IsNotExist(err) {
@@ -192,6 +196,8 @@
 	return index, nil
 }
 
+func (*httpSource) unexported() {}
+
 func (hs *httpSource) GetByModule(module string) ([]*osv.Entry, error) {
 	index, err := hs.Index()
 	if err != nil {
@@ -316,6 +322,8 @@
 	return c, nil
 }
 
+func (*client) unexported() {}
+
 func (c *client) GetByModule(module string) ([]*osv.Entry, error) {
 	var entries []*osv.Entry
 	// probably should be parallelized