v.io: v.io/x/ref/runtime/factories/fake Index | Files

package fake

import "v.io/x/ref/runtime/factories/fake"

Package fake implements a fake RuntimeFactory, useful in tests for mocking out certain components.

Index

Package Files

fake.go naming.go rpc.go runtime.go

func Init Uses

func Init(ctx *context.T) (v23.Runtime, *context.T, v23.Shutdown, error)

func InjectRuntime Uses

func InjectRuntime(runtime v23.Runtime, ctx *context.T, shutdown v23.Shutdown)

InjectRuntime allows packages to inject whichever runtime, ctx, and shutdown. This allows a package that needs different runtimes in tests to swap them as needed. The injected runtime will be valid until the shutdown returned from v23.Init is called.

func SetClientFactory Uses

func SetClientFactory(ctx *context.T, factory func(ctx *context.T, opts ...rpc.ClientOpt) rpc.Client) *context.T

SetClientFactory can be used to inject a mock Client implementation into the context. When v23.WithNewClient is called passed function will be invoked.

func SetFlowManagerFactory Uses

func SetFlowManagerFactory(ctx *context.T, factory func(ctx *context.T, channelTimeout time.Duration) flow.Manager) *context.T

SetFlowManagerFactory can be used to inject a mock FlowManager implementation into the context. When v23.NewFlowManager is called passed function will be invoked.

func SetServerFactory Uses

func SetServerFactory(ctx *context.T, factory func(*context.T, string, interface{}, security.Authorizer, ...rpc.ServerOpt) (*context.T, rpc.Server)) *context.T

SetServerFactory can be used to inject a mock Server implementation into the context. When v23.WithNewServer is called the passed function will be invoked.

type Runtime Uses

type Runtime struct {
    // contains filtered or unexported fields
}

func (*Runtime) GetBackgroundContext Uses

func (r *Runtime) GetBackgroundContext(ctx *context.T) *context.T

func (*Runtime) GetClient Uses

func (r *Runtime) GetClient(ctx *context.T) rpc.Client

func (*Runtime) GetListenSpec Uses

func (r *Runtime) GetListenSpec(ctx *context.T) rpc.ListenSpec

func (*Runtime) GetNamespace Uses

func (r *Runtime) GetNamespace(ctx *context.T) namespace.T

func (*Runtime) GetPermissionsSpec Uses

func (r *Runtime) GetPermissionsSpec(ctx *context.T) access.PermissionsSpec

func (*Runtime) GetPrincipal Uses

func (r *Runtime) GetPrincipal(ctx *context.T) security.Principal

func (*Runtime) GetReservedNameDispatcher Uses

func (*Runtime) GetReservedNameDispatcher(ctx *context.T) rpc.Dispatcher

func (*Runtime) Init Uses

func (r *Runtime) Init(ctx *context.T) error

func (*Runtime) NewDiscovery Uses

func (r *Runtime) NewDiscovery(ctx *context.T) (discovery.T, error)

func (*Runtime) NewFlowManager Uses

func (r *Runtime) NewFlowManager(ctx *context.T, channelTimeout time.Duration) (flow.Manager, error)

func (*Runtime) WithBackgroundContext Uses

func (r *Runtime) WithBackgroundContext(ctx *context.T) *context.T

func (*Runtime) WithListenSpec Uses

func (r *Runtime) WithListenSpec(ctx *context.T, ls rpc.ListenSpec) *context.T

func (*Runtime) WithNewClient Uses

func (r *Runtime) WithNewClient(ctx *context.T, opts ...rpc.ClientOpt) (*context.T, rpc.Client, error)

func (*Runtime) WithNewDispatchingServer Uses

func (r *Runtime) WithNewDispatchingServer(ctx *context.T, name string, disp rpc.Dispatcher, opts ...rpc.ServerOpt) (*context.T, rpc.Server, error)

func (*Runtime) WithNewNamespace Uses

func (r *Runtime) WithNewNamespace(ctx *context.T, roots ...string) (*context.T, namespace.T, error)

func (*Runtime) WithNewServer Uses

func (r *Runtime) WithNewServer(ctx *context.T, name string, object interface{}, auth security.Authorizer, opts ...rpc.ServerOpt) (*context.T, rpc.Server, error)

func (*Runtime) WithPrincipal Uses

func (r *Runtime) WithPrincipal(ctx *context.T, principal security.Principal) (*context.T, error)

func (*Runtime) WithReservedNameDispatcher Uses

func (*Runtime) WithReservedNameDispatcher(ctx *context.T, d rpc.Dispatcher) *context.T

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