amimock

package
v0.0.0-...-dae6f91 Latest Latest
Warning

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

Go to latest
Published: May 10, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmiAdvMockAction

type AmiAdvMockAction func(conn *AmiConn, params textproto.MIMEHeader, super *AmiMocker) textproto.MIMEHeader

type AmiConn

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

AmiConn for mocking Asterisk AMI

func NewAmiConn

func NewAmiConn(ctx context.Context, conn io.ReadWriteCloser, c *AmiServer) *AmiConn

func (*AmiConn) Close

func (conn *AmiConn) Close()

func (*AmiConn) Emit

func (conn *AmiConn) Emit(packet textproto.MIMEHeader)

Emit: emits packet to connection

type AmiMockAction

type AmiMockAction func(conn *AmiConn, params textproto.MIMEHeader) textproto.MIMEHeader

type AmiMocker

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

func (*AmiMocker) Call

func (mocker *AmiMocker) Call(conn *AmiConn, params textproto.MIMEHeader) textproto.MIMEHeader

type AmiServer

type AmiServer struct {
	sync.RWMutex
	context.Context

	Addr string
	// contains filtered or unexported fields
}

AmiServer for mocking Asterisk AMI

func NewAmiServer

func NewAmiServer(ctx context.Context) *AmiServer

NewAmiServer: Creats an ami mock server

func (*AmiServer) AdvMock

func (c *AmiServer) AdvMock(action string, cb AmiAdvMockAction)

AdvMock: adds an action to mock with super support

func (*AmiServer) Clear

func (c *AmiServer) Clear()

Clear: clears all actions from mocking

func (*AmiServer) Close

func (c *AmiServer) Close()

func (*AmiServer) CloseCons

func (c *AmiServer) CloseCons()

func (*AmiServer) Emit

func (c *AmiServer) Emit(packet textproto.MIMEHeader)

Emit: emits packet to all connections

func (*AmiServer) Mock

func (c *AmiServer) Mock(action string, cb AmiMockAction)

Mock: adds an action to mock

func (*AmiServer) Unmock

func (c *AmiServer) Unmock(action string)

Unmock: removes an action from mocking

Jump to

Keyboard shortcuts

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