Documentation
¶
Index ¶
- type AddrMock
- type ConnMock
- func (c ConnMock) Close() error
- func (c ConnMock) LocalAddr() net.Addr
- func (c ConnMock) Read(b []byte) (n int, err error)
- func (c ConnMock) RemoteAddr() net.Addr
- func (c ConnMock) SetDeadline(t time.Time) error
- func (c ConnMock) SetReadDeadline(t time.Time) error
- func (c *ConnMock) SetWriteDeadline(t time.Time) error
- func (c ConnMock) Write(b []byte) (n int, err error)
- type IssuerMock
- type LoggerMock
- func (mock *LoggerMock) Debug(msg string, fields ...map[string]interface{})
- func (mock *LoggerMock) DebugCalls() []struct{ ... }
- func (mock *LoggerMock) Error(msg string, fields ...map[string]interface{})
- func (mock *LoggerMock) ErrorCalls() []struct{ ... }
- func (mock *LoggerMock) Info(msg string, fields ...map[string]interface{})
- func (mock *LoggerMock) InfoCalls() []struct{ ... }
- func (mock *LoggerMock) Trace(msg string, fields ...map[string]interface{})
- func (mock *LoggerMock) TraceCalls() []struct{ ... }
- func (mock *LoggerMock) Warn(msg string, fields ...map[string]interface{})
- func (mock *LoggerMock) WarnCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnMock ¶ added in v1.4.0
func (ConnMock) RemoteAddr ¶ added in v1.4.0
func (ConnMock) SetReadDeadline ¶ added in v1.4.0
func (*ConnMock) SetWriteDeadline ¶ added in v1.4.0
type IssuerMock ¶
type IssuerMock struct {
// IssueFunc mocks the Issue method.
IssueFunc func(in1 context.Context, in2 string, in3 *certify.CertConfig) (*tls.Certificate, error)
// contains filtered or unexported fields
}
IssuerMock is a mock implementation of Issuer.
func TestSomethingThatUsesIssuer(t *testing.T) {
// make and configure a mocked Issuer
mockedIssuer := &IssuerMock{
IssueFunc: func(in1 context.Context, in2 string, in3 *certify.CertConfig) (*tls.Certificate, error) {
panic("mock out the Issue method")
},
}
// use mockedIssuer in code that requires Issuer
// and then make assertions.
}
func (*IssuerMock) Issue ¶
func (mock *IssuerMock) Issue(in1 context.Context, in2 string, in3 *certify.CertConfig) (*tls.Certificate, error)
Issue calls IssueFunc.
func (*IssuerMock) IssueCalls ¶
func (mock *IssuerMock) IssueCalls() []struct { In1 context.Context In2 string In3 *certify.CertConfig }
IssueCalls gets all the calls that were made to Issue. Check the length with:
len(mockedIssuer.IssueCalls())
type LoggerMock ¶ added in v1.4.0
type LoggerMock struct {
// DebugFunc mocks the Debug method.
DebugFunc func(msg string, fields ...map[string]interface{})
// ErrorFunc mocks the Error method.
ErrorFunc func(msg string, fields ...map[string]interface{})
// InfoFunc mocks the Info method.
InfoFunc func(msg string, fields ...map[string]interface{})
// TraceFunc mocks the Trace method.
TraceFunc func(msg string, fields ...map[string]interface{})
// WarnFunc mocks the Warn method.
WarnFunc func(msg string, fields ...map[string]interface{})
// contains filtered or unexported fields
}
LoggerMock is a mock implementation of Logger.
func TestSomethingThatUsesLogger(t *testing.T) {
// make and configure a mocked Logger
mockedLogger := &LoggerMock{
DebugFunc: func(msg string, fields ...map[string]interface{}) {
panic("mock out the Debug method")
},
ErrorFunc: func(msg string, fields ...map[string]interface{}) {
panic("mock out the Error method")
},
InfoFunc: func(msg string, fields ...map[string]interface{}) {
panic("mock out the Info method")
},
TraceFunc: func(msg string, fields ...map[string]interface{}) {
panic("mock out the Trace method")
},
WarnFunc: func(msg string, fields ...map[string]interface{}) {
panic("mock out the Warn method")
},
}
// use mockedLogger in code that requires Logger
// and then make assertions.
}
func (*LoggerMock) Debug ¶ added in v1.4.0
func (mock *LoggerMock) Debug(msg string, fields ...map[string]interface{})
Debug calls DebugFunc.
func (*LoggerMock) DebugCalls ¶ added in v1.4.0
func (mock *LoggerMock) DebugCalls() []struct { Msg string Fields []map[string]interface{} }
DebugCalls gets all the calls that were made to Debug. Check the length with:
len(mockedLogger.DebugCalls())
func (*LoggerMock) Error ¶ added in v1.4.0
func (mock *LoggerMock) Error(msg string, fields ...map[string]interface{})
Error calls ErrorFunc.
func (*LoggerMock) ErrorCalls ¶ added in v1.4.0
func (mock *LoggerMock) ErrorCalls() []struct { Msg string Fields []map[string]interface{} }
ErrorCalls gets all the calls that were made to Error. Check the length with:
len(mockedLogger.ErrorCalls())
func (*LoggerMock) Info ¶ added in v1.4.0
func (mock *LoggerMock) Info(msg string, fields ...map[string]interface{})
Info calls InfoFunc.
func (*LoggerMock) InfoCalls ¶ added in v1.4.0
func (mock *LoggerMock) InfoCalls() []struct { Msg string Fields []map[string]interface{} }
InfoCalls gets all the calls that were made to Info. Check the length with:
len(mockedLogger.InfoCalls())
func (*LoggerMock) Trace ¶ added in v1.4.0
func (mock *LoggerMock) Trace(msg string, fields ...map[string]interface{})
Trace calls TraceFunc.
func (*LoggerMock) TraceCalls ¶ added in v1.4.0
func (mock *LoggerMock) TraceCalls() []struct { Msg string Fields []map[string]interface{} }
TraceCalls gets all the calls that were made to Trace. Check the length with:
len(mockedLogger.TraceCalls())
func (*LoggerMock) Warn ¶ added in v1.4.0
func (mock *LoggerMock) Warn(msg string, fields ...map[string]interface{})
Warn calls WarnFunc.
func (*LoggerMock) WarnCalls ¶ added in v1.4.0
func (mock *LoggerMock) WarnCalls() []struct { Msg string Fields []map[string]interface{} }
WarnCalls gets all the calls that were made to Warn. Check the length with:
len(mockedLogger.WarnCalls())