all: assert internal objects implement interfaces

This commit is contained in:
Dan Williams
2016-12-14 17:09:01 -06:00
parent 20ae9e156d
commit 5852c60bc4
6 changed files with 22 additions and 0 deletions

View File

@ -20,6 +20,8 @@ import (
"net"
"os"
"path/filepath"
"github.com/containernetworking/cni/plugins/ipam/host-local/backend"
)
const lastIPFile = "last_reserved_ip"
@ -31,6 +33,9 @@ type Store struct {
dataDir string
}
// Store implements the Store interface
var _ backend.Store = &Store{}
func New(network, dataDir string) (*Store, error) {
if dataDir == "" {
dataDir = defaultDataDir

View File

@ -16,6 +16,8 @@ package testing
import (
"net"
"github.com/containernetworking/cni/plugins/ipam/host-local/backend"
)
type FakeStore struct {
@ -23,6 +25,9 @@ type FakeStore struct {
lastReservedIP net.IP
}
// FakeStore implements the Store interface
var _ backend.Store = &FakeStore{}
func NewFakeStore(ipmap map[string]string, lastIP net.IP) *FakeStore {
return &FakeStore{ipmap, lastIP}
}