| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // SetClient can be used to inject a mock client implementation into the context. |
| func SetClient(ctx *context.T, client rpc.Client) *context.T { |
| return context.WithValue(ctx, clientKey, client) |
| func (r *Runtime) SetNewClient(ctx *context.T, opts ...rpc.ClientOpt) (*context.T, rpc.Client, error) { |
| func (r *Runtime) GetClient(ctx *context.T) rpc.Client { |
| c, _ := ctx.Value(clientKey).(rpc.Client) |
| func (r *Runtime) NewServer(ctx *context.T, opts ...rpc.ServerOpt) (rpc.Server, error) { |
| func (r *Runtime) SetNewStreamManager(ctx *context.T) (*context.T, error) { |
| func (r *Runtime) GetListenSpec(ctx *context.T) rpc.ListenSpec { |