Documentation ¶
Overview ¶
Package testutil defines helpers for discovery tests.
Index ¶
- func Advertise(ctx *context.T, d discovery.T, visibility []security.BlessingPattern, ...) (func(), error)
- func MatchFound(ctx *context.T, updates []discovery.Update, wants ...discovery.Advertisement) bool
- func MatchLost(ctx *context.T, updates []discovery.Update, wants ...discovery.Advertisement) bool
- func Scan(ctx *context.T, d discovery.T, query string) (<-chan discovery.Update, func(), error)
- func ScanAndMatch(ctx *context.T, d discovery.T, query string, wants ...discovery.Advertisement) error
- func ToEndpoints(addrs ...string) []naming.Endpoint
- func UpdateEqual(ctx *context.T, update discovery.Update, ad discovery.Advertisement) bool
- func WithPrincipal(ctx *context.T, extension string) (*context.T, error)
- func WithPrivateKey(ctx *context.T, root *bcrypter.Root, blessing string) (*context.T, error)
- type MockServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Advertise ¶
func Advertise(ctx *context.T, d discovery.T, visibility []security.BlessingPattern, ads ...*discovery.Advertisement) (func(), error)
func MatchFound ¶
func ScanAndMatch ¶
func ToEndpoints ¶
func UpdateEqual ¶
func WithPrincipal ¶
WithPrincipal creates a new principal with an extension of the default blessing of the principal in the returned context.
Types ¶
type MockServer ¶
type MockServer struct {
// contains filtered or unexported fields
}
func NewMockServer ¶
func NewMockServer(eps []naming.Endpoint) *MockServer
func (*MockServer) AddName ¶
func (s *MockServer) AddName(string) error
func (*MockServer) Closed ¶
func (s *MockServer) Closed() <-chan struct{}
func (*MockServer) RemoveName ¶
func (s *MockServer) RemoveName(string)
func (*MockServer) Status ¶
func (s *MockServer) Status() rpc.ServerStatus
func (*MockServer) UpdateNetwork ¶
func (s *MockServer) UpdateNetwork(eps []naming.Endpoint)
Click to show internal directories.
Click to hide internal directories.