func (m MockPeer) Roles() []ttnpb.ClusterRole {
	if m.RolesFunc == nil {
		panic("Roles called, but not set")
	}
	return m.RolesFunc()
}
Roles calls RolesFunc if set and panics otherwise.
package test
import (
	"context"
	"reflect"
	"go.thethings.network/lorawan-stack/v3/pkg/cluster"
	"go.thethings.network/lorawan-stack/v3/pkg/rpcclient"
	"go.thethings.network/lorawan-stack/v3/pkg/rpcserver"
	"go.thethings.network/lorawan-stack/v3/pkg/ttnpb"
	"google.golang.org/grpc"
)
type MockPeer struct {
	NameFunc    func() string
	ConnFunc    func() (*grpc.ClientConn, error)
	HasRoleFunc func(ttnpb.ClusterRole) bool
	RolesFunc   func() []ttnpb.ClusterRole
	TagsFunc    func() map[string]string
}
func (m MockPeer) Name() string {
	if m.NameFunc == nil {
		panic("Name called, but not set")
	}
	return m.NameFunc()
}
func (m MockPeer) Conn() (*grpc.ClientConn, error) {
	if m.ConnFunc == nil {
		panic("Conn called, but not set")
	}
	return m.ConnFunc()
}
func (m MockPeer) HasRole(r ttnpb.ClusterRole) bool {
	if m.HasRoleFunc == nil {
		panic("HasRole called, but not set")
	}
	return m.HasRoleFunc(r)
}