Skip to content
Snippets Groups Projects
mock_client.go 1.11 KiB
Newer Older
package routingtable

import (
	"fmt"

	"github.com/bio-routing/bio-rd/net"
	"github.com/bio-routing/bio-rd/route"
)

type RemovePathParams struct {
	Pfx  net.Prefix
	Path *route.Path
}

type RTMockClient struct {
	removed []*RemovePathParams
	return &RTMockClient{
		removed: make([]*RemovePathParams, 0),
	}
func (m *RTMockClient) Removed() []*RemovePathParams {
	return m.removed
}

func (m *RTMockClient) AddPath(pfx net.Prefix, p *route.Path) error {
	return nil
}

func (m *RTMockClient) UpdateNewClient(client RouteTableClient) error {
	return fmt.Errorf("Not implemented")
}

func (m *RTMockClient) Register(RouteTableClient) {
	return
}

func (m *RTMockClient) RegisterWithOptions(RouteTableClient, ClientOptions) {
	return
}

func (m *RTMockClient) Unregister(RouteTableClient) {
	return
}

// RemovePath removes the path for prefix `pfx`
func (m *RTMockClient) RemovePath(pfx net.Prefix, p *route.Path) bool {
	params := &RemovePathParams{
		Path: p,
		Pfx:  pfx,
	}
	m.removed = append(m.removed, params)

Oliver Herms's avatar
Oliver Herms committed

func (m *RTMockClient) RouteCount() int64 {
	return 0
}