mocks

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenMockServer

func ListenMockServer(mockServer pb.StreamServiceServer, ipAddress string) (*grpc.Server, net.Listener)

func MockStoreKey

func MockStoreKey(key bifrost.Key, keyDirPath string) error

func NewMockConnection

func NewMockConnection(targetIP string) (bifrost.Connection, error)

func NewMockCrypto

func NewMockCrypto() bifrost.Crypto

func NewMockKeyOpts

func NewMockKeyOpts() bifrost.KeyOpts

func NewMockKeyPair

func NewMockKeyPair() (pri bifrost.Key, pub bifrost.Key, err error)

func NewMockServer

func NewMockServer() *server.Server

Types

type CloseCallBack

type CloseCallBack func()

type MockCloseHandler

type MockCloseHandler func()

type MockConnectionHandler

type MockConnectionHandler func(stream pb.StreamService_BifrostStreamServer)

type MockECDSAKeyRecoverer

type MockECDSAKeyRecoverer struct {
}

func (*MockECDSAKeyRecoverer) RecoverKeyFromByte

func (recoverer *MockECDSAKeyRecoverer) RecoverKeyFromByte(keyBytes []byte, isPrivateKey bool) (bifrost.Key, error)

type MockECDSASigner

type MockECDSASigner struct {
	KeyID      string
	KeyDirPath string
}

func (*MockECDSASigner) Sign

func (signer *MockECDSASigner) Sign(message []byte) ([]byte, error)

type MockECDSAVerifier

type MockECDSAVerifier struct {
}

func (*MockECDSAVerifier) Verify

func (verifier *MockECDSAVerifier) Verify(peerKey bifrost.Key, signature []byte, message []byte) (bool, error)

type MockHandler

type MockHandler struct{}

func (MockHandler) ServeError

func (h MockHandler) ServeError(conn bifrost.Connection, err error)

func (MockHandler) ServeRequest

func (h MockHandler) ServeRequest(message bifrost.Message)

type MockPriKey

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

func (*MockPriKey) ID

func (mockPriKey *MockPriKey) ID() bifrost.KeyID

func (*MockPriKey) IsPrivate

func (mockPriKey *MockPriKey) IsPrivate() bool

func (*MockPriKey) KeyGenOpt

func (mockPriKey *MockPriKey) KeyGenOpt() string

func (*MockPriKey) ToByte

func (mockPriKey *MockPriKey) ToByte() ([]byte, error)

type MockPubKey

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

func (*MockPubKey) ID

func (mockPubKey *MockPubKey) ID() bifrost.KeyID

func (*MockPubKey) IsPrivate

func (mockPubKey *MockPubKey) IsPrivate() bool

func (*MockPubKey) KeyGenOpt

func (mockPubKey *MockPubKey) KeyGenOpt() string

func (*MockPubKey) ToByte

func (mockPubKey *MockPubKey) ToByte() ([]byte, error)

type MockRecvHandler

type MockRecvHandler func(envelope *pb.Envelope)

type MockServer

type MockServer struct {
	Rh  MockRecvHandler
	Ch  MockConnectionHandler
	Clh MockCloseHandler
}

func (MockServer) BifrostStream

func (ms MockServer) BifrostStream(stream pb.StreamService_BifrostStreamServer) error

type MockStreamServer

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

func NewMockStreamServer

func NewMockStreamServer(peerInfo bifrost.PeerInfo) *MockStreamServer

func (MockStreamServer) Context

func (MockStreamServer) Context() context.Context

func (*MockStreamServer) Recv

func (s *MockStreamServer) Recv() (*pb.Envelope, error)

func (MockStreamServer) RecvMsg

func (MockStreamServer) RecvMsg(m interface{}) error

func (*MockStreamServer) Send

func (s *MockStreamServer) Send(envelope *pb.Envelope) error

func (MockStreamServer) SendHeader

func (MockStreamServer) SendHeader(metadata.MD) error

func (MockStreamServer) SendMsg

func (MockStreamServer) SendMsg(m interface{}) error

func (MockStreamServer) SetHeader

func (MockStreamServer) SetHeader(metadata.MD) error

func (MockStreamServer) SetTrailer

func (MockStreamServer) SetTrailer(metadata.MD)

type MockStreamWrapper

type MockStreamWrapper struct {
	SendCallBack  SendCallBack
	CloseCallBack CloseCallBack
}

func (MockStreamWrapper) Close

func (msw MockStreamWrapper) Close()

func (MockStreamWrapper) GetStream

func (MockStreamWrapper) GetStream() bifrost.Stream

func (MockStreamWrapper) Recv

func (MockStreamWrapper) Recv() (*pb.Envelope, error)

func (MockStreamWrapper) Send

func (msw MockStreamWrapper) Send(envelope *pb.Envelope) error

type MockvalueCtx

type MockvalueCtx struct {
	context.Context
	// contains filtered or unexported fields
}

func (*MockvalueCtx) String

func (c *MockvalueCtx) String() string

func (*MockvalueCtx) Value

func (c *MockvalueCtx) Value(key interface{}) interface{}

type SendCallBack

type SendCallBack func(envelope *pb.Envelope)

Jump to

Keyboard shortcuts

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