register

package
v0.0.0-...-6fa03d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package register contains lookup table to get an instance of test.Subscribe. Exported NewSubscribeTest function is used by individual tests to register.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSubscribeTest

func GetSubscribeTest(i interface{}, args *tpb.Test) (subscribe.Subscribe, error)

GetSubscribeTest returns an instance of the test.

func NewSubscribeTest

func NewSubscribeTest(te interface{}, f SubscribeFunc)

NewSubscribeTest registers given test to the framework. First argument is an instance of oneof field type in tests proto. Second argument is a factory function that creates an instance of the test. Registration is illustrated below for SubscribeTest_FirstTest (corresponding field in the proto is written as "first_test")

register.NewSubscribeTest(&tests_pb.SubscribeTest_FirstTest{}, someFunc)

Types

type SubscribeFunc

type SubscribeFunc func(args *tpb.Test) (subscribe.Subscribe, error)

SubscribeFunc is used by test framework to instantiate a new instance of the test.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL