mock

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

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

Mock is a fake OpenSIPS mi_datagram socket

func New

func New(response []byte, sleep time.Duration) (m *Mock, err error)

New creates a new Mock with given response. Before responding the Mock will sleep for a moment.

func (*Mock) Close

func (m *Mock) Close() error

Close removes the resources created for Mock.

func (*Mock) Run

func (m *Mock) Run(count int, deadline time.Time) error

Run handles a given number of requests within the deadline.

func (*Mock) Socket

func (m *Mock) Socket() string

Socket returns the Mock's socket address

Jump to

Keyboard shortcuts

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