mock

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	MockMatch       func(msg *dns.Msg) bool
	MockIsFallback  func() bool
	MockHandle      func(req *dns.Msg) *dns.Msg
	MockPostProcess func(req, resp *dns.Msg)
	MockStart       func(resolver dns.Handler)
	MockStop        func()
	MockName        func() string
	MockString      func() string
}

func (Group) Handle

func (m Group) Handle(req *dns.Msg) *dns.Msg

func (Group) IsFallback

func (m Group) IsFallback() bool

func (Group) Match

func (m Group) Match(req *dns.Msg) bool

func (Group) Name

func (m Group) Name() string

func (Group) PostProcess

func (m Group) PostProcess(req *dns.Msg, resp *dns.Msg)

func (Group) Start

func (m Group) Start(resolver dns.Handler)

func (Group) Stop

func (m Group) Stop()

func (Group) String

func (m Group) String() string

type Mocker

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

Mocker gomonkey的封装

func (*Mocker) Func

func (m *Mocker) Func(target interface{}, double interface{})

Func gomonkey.ApplyFunc的封装

func (*Mocker) FuncSeq

func (m *Mocker) FuncSeq(target interface{}, outputs []gomonkey.Params)

FuncSeq gomonkey.ApplyFuncSeq的封装

func (*Mocker) Method

func (m *Mocker) Method(target interface{}, method string, double interface{})

Method gomonkey.ApplyMethod的封装

func (*Mocker) MethodSeq

func (m *Mocker) MethodSeq(target interface{}, method string, outputs []gomonkey.Params)

MethodSeq gomonkey.ApplyMethodSeq的封装

func (*Mocker) Reset

func (m *Mocker) Reset()

Reset 重置所有mock

Jump to

Keyboard shortcuts

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