berty: berty.tech/berty/go/internal/testutil Index | Files

package testutil

import "berty.tech/berty/go/internal/testutil"

Package testutil contains testing helpers (logging, slow skipping).

Index

Package Files

doc.go logging.go service.go skip.go testutil.pb.go

func FilterSpeed Uses

func FilterSpeed(t *testing.T, speed Speed)

func FilterStability Uses

func FilterStability(t *testing.T, stability Stability)

func FilterStabilityAndSpeed Uses

func FilterStabilityAndSpeed(t *testing.T, stability Stability, speed Speed)

func Logger Uses

func Logger(t testing.TB) (*zap.Logger, func())

func RegisterTestServiceServer Uses

func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer)

func TestingNewServiceClient Uses

func TestingNewServiceClient(ctx context.Context, t *testing.T, opts *Options) (*grpc.ClientConn, *grpc.Server)

type EchoDuplexTest Uses

type EchoDuplexTest struct {
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*EchoDuplexTest) Descriptor Uses

func (*EchoDuplexTest) Descriptor() ([]byte, []int)

func (*EchoDuplexTest) ProtoMessage Uses

func (*EchoDuplexTest) ProtoMessage()

func (*EchoDuplexTest) Reset Uses

func (m *EchoDuplexTest) Reset()

func (*EchoDuplexTest) String Uses

func (m *EchoDuplexTest) String() string

func (*EchoDuplexTest) XXX_DiscardUnknown Uses

func (m *EchoDuplexTest) XXX_DiscardUnknown()

func (*EchoDuplexTest) XXX_Marshal Uses

func (m *EchoDuplexTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EchoDuplexTest) XXX_Merge Uses

func (m *EchoDuplexTest) XXX_Merge(src proto.Message)

func (*EchoDuplexTest) XXX_Size Uses

func (m *EchoDuplexTest) XXX_Size() int

func (*EchoDuplexTest) XXX_Unmarshal Uses

func (m *EchoDuplexTest) XXX_Unmarshal(b []byte) error

type EchoDuplexTest_Reply Uses

type EchoDuplexTest_Reply struct {
    Echo                 string   `protobuf:"bytes,1,opt,name=echo,proto3" json:"echo,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*EchoDuplexTest_Reply) Descriptor Uses

func (*EchoDuplexTest_Reply) Descriptor() ([]byte, []int)

func (*EchoDuplexTest_Reply) GetEcho Uses

func (m *EchoDuplexTest_Reply) GetEcho() string

func (*EchoDuplexTest_Reply) ProtoMessage Uses

func (*EchoDuplexTest_Reply) ProtoMessage()

func (*EchoDuplexTest_Reply) Reset Uses

func (m *EchoDuplexTest_Reply) Reset()

func (*EchoDuplexTest_Reply) String Uses

func (m *EchoDuplexTest_Reply) String() string

func (*EchoDuplexTest_Reply) XXX_DiscardUnknown Uses

func (m *EchoDuplexTest_Reply) XXX_DiscardUnknown()

func (*EchoDuplexTest_Reply) XXX_Marshal Uses

func (m *EchoDuplexTest_Reply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EchoDuplexTest_Reply) XXX_Merge Uses

func (m *EchoDuplexTest_Reply) XXX_Merge(src proto.Message)

func (*EchoDuplexTest_Reply) XXX_Size Uses

func (m *EchoDuplexTest_Reply) XXX_Size() int

func (*EchoDuplexTest_Reply) XXX_Unmarshal Uses

func (m *EchoDuplexTest_Reply) XXX_Unmarshal(b []byte) error

type EchoDuplexTest_Request Uses

type EchoDuplexTest_Request struct {
    Echo                 string   `protobuf:"bytes,1,opt,name=echo,proto3" json:"echo,omitempty"`
    TriggerError         bool     `protobuf:"varint,2,opt,name=trigger_error,json=triggerError,proto3" json:"trigger_error,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*EchoDuplexTest_Request) Descriptor Uses

func (*EchoDuplexTest_Request) Descriptor() ([]byte, []int)

func (*EchoDuplexTest_Request) GetEcho Uses

func (m *EchoDuplexTest_Request) GetEcho() string

func (*EchoDuplexTest_Request) GetTriggerError Uses

func (m *EchoDuplexTest_Request) GetTriggerError() bool

func (*EchoDuplexTest_Request) ProtoMessage Uses

func (*EchoDuplexTest_Request) ProtoMessage()

func (*EchoDuplexTest_Request) Reset Uses

func (m *EchoDuplexTest_Request) Reset()

func (*EchoDuplexTest_Request) String Uses

func (m *EchoDuplexTest_Request) String() string

func (*EchoDuplexTest_Request) XXX_DiscardUnknown Uses

func (m *EchoDuplexTest_Request) XXX_DiscardUnknown()

func (*EchoDuplexTest_Request) XXX_Marshal Uses

func (m *EchoDuplexTest_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EchoDuplexTest_Request) XXX_Merge Uses

func (m *EchoDuplexTest_Request) XXX_Merge(src proto.Message)

func (*EchoDuplexTest_Request) XXX_Size Uses

func (m *EchoDuplexTest_Request) XXX_Size() int

func (*EchoDuplexTest_Request) XXX_Unmarshal Uses

func (m *EchoDuplexTest_Request) XXX_Unmarshal(b []byte) error

type EchoStreamTest Uses

type EchoStreamTest struct {
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*EchoStreamTest) Descriptor Uses

func (*EchoStreamTest) Descriptor() ([]byte, []int)

func (*EchoStreamTest) ProtoMessage Uses

func (*EchoStreamTest) ProtoMessage()

func (*EchoStreamTest) Reset Uses

func (m *EchoStreamTest) Reset()

func (*EchoStreamTest) String Uses

func (m *EchoStreamTest) String() string

func (*EchoStreamTest) XXX_DiscardUnknown Uses

func (m *EchoStreamTest) XXX_DiscardUnknown()

func (*EchoStreamTest) XXX_Marshal Uses

func (m *EchoStreamTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EchoStreamTest) XXX_Merge Uses

func (m *EchoStreamTest) XXX_Merge(src proto.Message)

func (*EchoStreamTest) XXX_Size Uses

func (m *EchoStreamTest) XXX_Size() int

func (*EchoStreamTest) XXX_Unmarshal Uses

func (m *EchoStreamTest) XXX_Unmarshal(b []byte) error

type EchoStreamTest_Reply Uses

type EchoStreamTest_Reply struct {
    Echo                 string   `protobuf:"bytes,1,opt,name=echo,proto3" json:"echo,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*EchoStreamTest_Reply) Descriptor Uses

func (*EchoStreamTest_Reply) Descriptor() ([]byte, []int)

func (*EchoStreamTest_Reply) GetEcho Uses

func (m *EchoStreamTest_Reply) GetEcho() string

func (*EchoStreamTest_Reply) ProtoMessage Uses

func (*EchoStreamTest_Reply) ProtoMessage()

func (*EchoStreamTest_Reply) Reset Uses

func (m *EchoStreamTest_Reply) Reset()

func (*EchoStreamTest_Reply) String Uses

func (m *EchoStreamTest_Reply) String() string

func (*EchoStreamTest_Reply) XXX_DiscardUnknown Uses

func (m *EchoStreamTest_Reply) XXX_DiscardUnknown()

func (*EchoStreamTest_Reply) XXX_Marshal Uses

func (m *EchoStreamTest_Reply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EchoStreamTest_Reply) XXX_Merge Uses

func (m *EchoStreamTest_Reply) XXX_Merge(src proto.Message)

func (*EchoStreamTest_Reply) XXX_Size Uses

func (m *EchoStreamTest_Reply) XXX_Size() int

func (*EchoStreamTest_Reply) XXX_Unmarshal Uses

func (m *EchoStreamTest_Reply) XXX_Unmarshal(b []byte) error

type EchoStreamTest_Request Uses

type EchoStreamTest_Request struct {
    Delay                uint64   `protobuf:"varint,1,opt,name=delay,proto3" json:"delay,omitempty"`
    Echo                 string   `protobuf:"bytes,2,opt,name=echo,proto3" json:"echo,omitempty"`
    TriggerError         bool     `protobuf:"varint,3,opt,name=trigger_error,json=triggerError,proto3" json:"trigger_error,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*EchoStreamTest_Request) Descriptor Uses

func (*EchoStreamTest_Request) Descriptor() ([]byte, []int)

func (*EchoStreamTest_Request) GetDelay Uses

func (m *EchoStreamTest_Request) GetDelay() uint64

func (*EchoStreamTest_Request) GetEcho Uses

func (m *EchoStreamTest_Request) GetEcho() string

func (*EchoStreamTest_Request) GetTriggerError Uses

func (m *EchoStreamTest_Request) GetTriggerError() bool

func (*EchoStreamTest_Request) ProtoMessage Uses

func (*EchoStreamTest_Request) ProtoMessage()

func (*EchoStreamTest_Request) Reset Uses

func (m *EchoStreamTest_Request) Reset()

func (*EchoStreamTest_Request) String Uses

func (m *EchoStreamTest_Request) String() string

func (*EchoStreamTest_Request) XXX_DiscardUnknown Uses

func (m *EchoStreamTest_Request) XXX_DiscardUnknown()

func (*EchoStreamTest_Request) XXX_Marshal Uses

func (m *EchoStreamTest_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EchoStreamTest_Request) XXX_Merge Uses

func (m *EchoStreamTest_Request) XXX_Merge(src proto.Message)

func (*EchoStreamTest_Request) XXX_Size Uses

func (m *EchoStreamTest_Request) XXX_Size() int

func (*EchoStreamTest_Request) XXX_Unmarshal Uses

func (m *EchoStreamTest_Request) XXX_Unmarshal(b []byte) error

type EchoTest Uses

type EchoTest struct {
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*EchoTest) Descriptor Uses

func (*EchoTest) Descriptor() ([]byte, []int)

func (*EchoTest) ProtoMessage Uses

func (*EchoTest) ProtoMessage()

func (*EchoTest) Reset Uses

func (m *EchoTest) Reset()

func (*EchoTest) String Uses

func (m *EchoTest) String() string

func (*EchoTest) XXX_DiscardUnknown Uses

func (m *EchoTest) XXX_DiscardUnknown()

func (*EchoTest) XXX_Marshal Uses

func (m *EchoTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EchoTest) XXX_Merge Uses

func (m *EchoTest) XXX_Merge(src proto.Message)

func (*EchoTest) XXX_Size Uses

func (m *EchoTest) XXX_Size() int

func (*EchoTest) XXX_Unmarshal Uses

func (m *EchoTest) XXX_Unmarshal(b []byte) error

type EchoTest_Reply Uses

type EchoTest_Reply struct {
    Echo                 string   `protobuf:"bytes,1,opt,name=echo,proto3" json:"echo,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*EchoTest_Reply) Descriptor Uses

func (*EchoTest_Reply) Descriptor() ([]byte, []int)

func (*EchoTest_Reply) GetEcho Uses

func (m *EchoTest_Reply) GetEcho() string

func (*EchoTest_Reply) ProtoMessage Uses

func (*EchoTest_Reply) ProtoMessage()

func (*EchoTest_Reply) Reset Uses

func (m *EchoTest_Reply) Reset()

func (*EchoTest_Reply) String Uses

func (m *EchoTest_Reply) String() string

func (*EchoTest_Reply) XXX_DiscardUnknown Uses

func (m *EchoTest_Reply) XXX_DiscardUnknown()

func (*EchoTest_Reply) XXX_Marshal Uses

func (m *EchoTest_Reply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EchoTest_Reply) XXX_Merge Uses

func (m *EchoTest_Reply) XXX_Merge(src proto.Message)

func (*EchoTest_Reply) XXX_Size Uses

func (m *EchoTest_Reply) XXX_Size() int

func (*EchoTest_Reply) XXX_Unmarshal Uses

func (m *EchoTest_Reply) XXX_Unmarshal(b []byte) error

type EchoTest_Request Uses

type EchoTest_Request struct {
    Delay                uint64   `protobuf:"varint,1,opt,name=delay,proto3" json:"delay,omitempty"`
    Echo                 string   `protobuf:"bytes,2,opt,name=echo,proto3" json:"echo,omitempty"`
    TriggerError         bool     `protobuf:"varint,3,opt,name=trigger_error,json=triggerError,proto3" json:"trigger_error,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*EchoTest_Request) Descriptor Uses

func (*EchoTest_Request) Descriptor() ([]byte, []int)

func (*EchoTest_Request) GetDelay Uses

func (m *EchoTest_Request) GetDelay() uint64

func (*EchoTest_Request) GetEcho Uses

func (m *EchoTest_Request) GetEcho() string

func (*EchoTest_Request) GetTriggerError Uses

func (m *EchoTest_Request) GetTriggerError() bool

func (*EchoTest_Request) ProtoMessage Uses

func (*EchoTest_Request) ProtoMessage()

func (*EchoTest_Request) Reset Uses

func (m *EchoTest_Request) Reset()

func (*EchoTest_Request) String Uses

func (m *EchoTest_Request) String() string

func (*EchoTest_Request) XXX_DiscardUnknown Uses

func (m *EchoTest_Request) XXX_DiscardUnknown()

func (*EchoTest_Request) XXX_Marshal Uses

func (m *EchoTest_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EchoTest_Request) XXX_Merge Uses

func (m *EchoTest_Request) XXX_Merge(src proto.Message)

func (*EchoTest_Request) XXX_Size Uses

func (m *EchoTest_Request) XXX_Size() int

func (*EchoTest_Request) XXX_Unmarshal Uses

func (m *EchoTest_Request) XXX_Unmarshal(b []byte) error

type Options Uses

type Options struct {
    Logger *zap.Logger
}

type Speed Uses

type Speed string

Speed level enum

const (
    Fast     Speed = "fast"
    Slow     Speed = "slow"
    AnySpeed Speed = "any"
)

type Stability Uses

type Stability string

Stability level enum

const (
    Stable       Stability = "stable"
    Unstable     Stability = "unstable"
    Broken       Stability = "broken"
    AnyStability Stability = "any"
)

type TestServiceClient Uses

type TestServiceClient interface {
    // use to test unary
    EchoTest(ctx context.Context, in *EchoTest_Request, opts ...grpc.CallOption) (*EchoTest_Reply, error)
    // Use to test stream.
    EchoStreamTest(ctx context.Context, in *EchoStreamTest_Request, opts ...grpc.CallOption) (TestService_EchoStreamTestClient, error)
    // Use to test duplex stream.
    EchoDuplexTest(ctx context.Context, opts ...grpc.CallOption) (TestService_EchoDuplexTestClient, error)
}

TestServiceClient is the client API for TestService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTestServiceClient Uses

func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient

type TestServiceServer Uses

type TestServiceServer interface {
    // use to test unary
    EchoTest(context.Context, *EchoTest_Request) (*EchoTest_Reply, error)
    // Use to test stream.
    EchoStreamTest(*EchoStreamTest_Request, TestService_EchoStreamTestServer) error
    // Use to test duplex stream.
    EchoDuplexTest(TestService_EchoDuplexTestServer) error
}

TestServiceServer is the server API for TestService service.

func NewService Uses

func NewService(opts *Options) TestServiceServer

type TestService_EchoDuplexTestClient Uses

type TestService_EchoDuplexTestClient interface {
    Send(*EchoDuplexTest_Request) error
    Recv() (*EchoDuplexTest_Reply, error)
    grpc.ClientStream
}

type TestService_EchoDuplexTestServer Uses

type TestService_EchoDuplexTestServer interface {
    Send(*EchoDuplexTest_Reply) error
    Recv() (*EchoDuplexTest_Request, error)
    grpc.ServerStream
}

type TestService_EchoStreamTestClient Uses

type TestService_EchoStreamTestClient interface {
    Recv() (*EchoStreamTest_Reply, error)
    grpc.ClientStream
}

type TestService_EchoStreamTestServer Uses

type TestService_EchoStreamTestServer interface {
    Send(*EchoStreamTest_Reply) error
    grpc.ServerStream
}

type UnimplementedTestServiceServer Uses

type UnimplementedTestServiceServer struct {
}

UnimplementedTestServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedTestServiceServer) EchoDuplexTest Uses

func (*UnimplementedTestServiceServer) EchoDuplexTest(srv TestService_EchoDuplexTestServer) error

func (*UnimplementedTestServiceServer) EchoStreamTest Uses

func (*UnimplementedTestServiceServer) EchoStreamTest(req *EchoStreamTest_Request, srv TestService_EchoStreamTestServer) error

func (*UnimplementedTestServiceServer) EchoTest Uses

func (*UnimplementedTestServiceServer) EchoTest(ctx context.Context, req *EchoTest_Request) (*EchoTest_Reply, error)

Package testutil imports 18 packages (graph). Updated 2021-01-07. Refresh now. Tools for package owners.