v.io: v.io/x/ref/lib/discovery/testutil Index | Files

package testutil

import "v.io/x/ref/lib/discovery/testutil"

Package testutil defines helpers for discovery tests.


Package Files

mock_server.go util.go

func Advertise(ctx *context.T, d discovery.T, visibility []security.BlessingPattern, ads ...*discovery.Advertisement) (func(), error)

func MatchFound Uses

func MatchFound(ctx *context.T, updates []discovery.Update, wants ...discovery.Advertisement) bool

func MatchLost Uses

func MatchLost(ctx *context.T, updates []discovery.Update, wants ...discovery.Advertisement) bool

func Scan Uses

func Scan(ctx *context.T, d discovery.T, query string) (<-chan discovery.Update, func(), error)

func ScanAndMatch Uses

func ScanAndMatch(ctx *context.T, d discovery.T, query string, wants ...discovery.Advertisement) error

func ToEndpoints Uses

func ToEndpoints(addrs ...string) []naming.Endpoint

func UpdateEqual Uses

func UpdateEqual(ctx *context.T, update discovery.Update, ad discovery.Advertisement) bool

func WithPrincipal Uses

func WithPrincipal(ctx *context.T, extension string) (*context.T, error)

WithPrincipal creates a new principal with an extension of the default blessing of the principal in the returned context.

func WithPrivateKey Uses

func WithPrivateKey(ctx *context.T, root *bcrypter.Root, blessing string) (*context.T, error)

WithPrivateKey creates a new principal with the provided blessing and stores the private key of the blessing in the returned context.

type MockServer Uses

type MockServer struct {
    // contains filtered or unexported fields

func NewMockServer Uses

func NewMockServer(eps []naming.Endpoint) *MockServer

func (*MockServer) AddName Uses

func (s *MockServer) AddName(string) error

func (*MockServer) Closed Uses

func (s *MockServer) Closed() <-chan struct{}

func (*MockServer) RemoveName Uses

func (s *MockServer) RemoveName(string)

func (*MockServer) Status Uses

func (s *MockServer) Status() rpc.ServerStatus

func (*MockServer) UpdateNetwork Uses

func (s *MockServer) UpdateNetwork(eps []naming.Endpoint)

Package testutil imports 16 packages (graph). Updated 2020-10-22. Refresh now. Tools for package owners.