github.com/joomcode/pegomock@v2.9.2-0.20220414140958-14f53b6b2a6c+incompatible/types.go (about) 1 package pegomock 2 3 type FailHandler func(message string, callerSkip ...int) 4 5 type Mock interface { 6 SetFailHandler(FailHandler) 7 FailHandler() FailHandler 8 } 9 type Param interface{} 10 type ReturnValue interface{} 11 type ReturnValues []ReturnValue 12 13 type Option interface{ Apply(Mock) } 14 15 type OptionFunc func(mock Mock) 16 17 func (f OptionFunc) Apply(mock Mock) { f(mock) } 18 19 func WithFailHandler(fail FailHandler) Option { 20 return OptionFunc(func(mock Mock) { mock.SetFailHandler(fail) }) 21 }