blob: d80e1237f1353522a53f5279269aa275e922fef4 [file] [log] [blame]
Jiri Simsad7616c92015-03-24 23:44:30 -07001// Copyright 2015 The Vanadium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
Matt Rosencrantz94502cf2015-03-18 09:43:44 -07005package fake
6
7import (
8 "v.io/v23/context"
9 "v.io/v23/rpc"
Cosmos Nicolaouf3c19092015-05-27 17:53:37 -070010 "v.io/x/ref/lib/apilog"
Matt Rosencrantz94502cf2015-03-18 09:43:44 -070011)
12
13// SetClient can be used to inject a mock client implementation into the context.
14func SetClient(ctx *context.T, client rpc.Client) *context.T {
15 return context.WithValue(ctx, clientKey, client)
16}
Todd Wangad492042015-04-17 15:58:40 -070017func (r *Runtime) WithNewClient(ctx *context.T, opts ...rpc.ClientOpt) (*context.T, rpc.Client, error) {
Cosmos Nicolaouf3c19092015-05-27 17:53:37 -070018 defer apilog.LogCallf(ctx, "opts...=%v", opts)(ctx, "") // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
Matt Rosencrantz94502cf2015-03-18 09:43:44 -070019 panic("unimplemented")
20}
21func (r *Runtime) GetClient(ctx *context.T) rpc.Client {
Cosmos Nicolaouf3c19092015-05-27 17:53:37 -070022 defer apilog.LogCall(ctx)(ctx) // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
Matt Rosencrantz94502cf2015-03-18 09:43:44 -070023 c, _ := ctx.Value(clientKey).(rpc.Client)
24 return c
25}
26
27func (r *Runtime) NewServer(ctx *context.T, opts ...rpc.ServerOpt) (rpc.Server, error) {
Cosmos Nicolaouf3c19092015-05-27 17:53:37 -070028 defer apilog.LogCallf(ctx, "opts...=%v", opts)(ctx, "") // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
Matt Rosencrantz94502cf2015-03-18 09:43:44 -070029 panic("unimplemented")
30}
Todd Wangad492042015-04-17 15:58:40 -070031func (r *Runtime) WithNewStreamManager(ctx *context.T) (*context.T, error) {
Cosmos Nicolaouf3c19092015-05-27 17:53:37 -070032 defer apilog.LogCall(ctx)(ctx) // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
Matt Rosencrantz94502cf2015-03-18 09:43:44 -070033 panic("unimplemented")
34}
35
36func (r *Runtime) GetListenSpec(ctx *context.T) rpc.ListenSpec {
Cosmos Nicolaouf3c19092015-05-27 17:53:37 -070037 defer apilog.LogCall(ctx)(ctx) // gologcop: DO NOT EDIT, MUST BE FIRST STATEMENT
Matt Rosencrantz94502cf2015-03-18 09:43:44 -070038 return rpc.ListenSpec{}
39}