all: assert internal objects implement interfaces
This commit is contained in:
@ -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
|
||||
|
@ -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}
|
||||
}
|
||||
|
Reference in New Issue
Block a user