mock

package
v0.0.0-...-5d0d25f Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cipher

type Cipher struct {
	CapacityFn func() int
	EncryptFn  func(plaintext []byte) (ciphertext []byte, err error)
	DecryptFn  func(ciphertext []byte) (plaintext, remainder []byte, err error)
}

func (*Cipher) Capacity

func (m *Cipher) Capacity() int

func (*Cipher) Decrypt

func (m *Cipher) Decrypt(ciphertext []byte) (plaintext, remainder []byte, err error)

func (*Cipher) Encrypt

func (m *Cipher) Encrypt(plaintext []byte) (ciphertext []byte, err error)

type Conn

type Conn struct {
	ReadFn             func(b []byte) (n int, err error)
	WriteFn            func(b []byte) (n int, err error)
	CloseFn            func() error
	LocalAddrFn        func() net.Addr
	RemoteAddrFn       func() net.Addr
	SetDeadlineFn      func(t time.Time) error
	SetReadDeadlineFn  func(t time.Time) error
	SetWriteDeadlineFn func(t time.Time) error
}

func DefaultConn

func DefaultConn() Conn

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

func (*Conn) Read

func (c *Conn) Read(b []byte) (n int, err error)

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

func (*Conn) SetDeadline

func (c *Conn) SetDeadline(t time.Time) error

func (*Conn) SetReadDeadline

func (c *Conn) SetReadDeadline(t time.Time) error

func (*Conn) SetWriteDeadline

func (c *Conn) SetWriteDeadline(t time.Time) error

func (*Conn) Write

func (c *Conn) Write(b []byte) (n int, err error)

type DFA

type DFA struct {
	CapacityFn        func() int
	RankFn            func(s string) (rank *big.Int, err error)
	UnrankFn          func(rank *big.Int) (ret string, err error)
	NumWordsInSliceFn func(n int) (numWords *big.Int, err error)
}

func (*DFA) Capacity

func (m *DFA) Capacity() int

func (*DFA) NumWordsInSlice

func (m *DFA) NumWordsInSlice(n int) (numWords *big.Int, err error)

func (*DFA) Rank

func (m *DFA) Rank(s string) (rank *big.Int, err error)

func (*DFA) Unrank

func (m *DFA) Unrank(rank *big.Int) (ret string, err error)

type FSM

type FSM struct {
	CloseFn         func() error
	UUIDFn          func() int
	InstanceIDFn    func() int
	SetInstanceIDFn func(int)
	HostFn          func() string
	PartyFn         func() string
	PortFn          func() int
	StateFn         func() string
	DeadFn          func() bool
	NextFn          func(ctx context.Context) error
	ExecuteFn       func(ctx context.Context) error
	ResetFn         func()
	ListenFn        func() (int, error)
	ConnFn          func() *marionette.BufferedConn
	StreamSetFn     func() *marionette.StreamSet
	CipherFn        func(regex string, n int) (marionette.Cipher, error)
	DFAFn           func(regex string, n int) (marionette.DFA, error)
	SetVarFn        func(key string, value interface{})
	VarFn           func(key string) interface{}
	CloneFn         func(doc *mar.Document) marionette.FSM
	LoggerFn        func() *zap.Logger

	BufferedConn *marionette.BufferedConn
}

func NewFSM

func NewFSM(conn net.Conn, streamSet *marionette.StreamSet) FSM

NewFSM returns an instance of FSM with conn and streamSet attached.

func (*FSM) Cipher

func (m *FSM) Cipher(regex string, n int) (marionette.Cipher, error)

func (*FSM) Clone

func (m *FSM) Clone(doc *mar.Document) marionette.FSM

func (*FSM) Close

func (m *FSM) Close() error

func (*FSM) Conn

func (m *FSM) Conn() *marionette.BufferedConn

func (*FSM) DFA

func (m *FSM) DFA(regex string, msgLen int) (marionette.DFA, error)

func (*FSM) Dead

func (m *FSM) Dead() bool

func (*FSM) Execute

func (m *FSM) Execute(ctx context.Context) error

func (*FSM) Host

func (m *FSM) Host() string

func (*FSM) InstanceID

func (m *FSM) InstanceID() int

func (*FSM) Listen

func (m *FSM) Listen() (int, error)

func (*FSM) Logger

func (m *FSM) Logger() *zap.Logger

func (*FSM) Next

func (m *FSM) Next(ctx context.Context) error

func (*FSM) Party

func (m *FSM) Party() string

func (*FSM) Port

func (m *FSM) Port() int

func (*FSM) Reset

func (m *FSM) Reset()

func (*FSM) SetInstanceID

func (m *FSM) SetInstanceID(id int)

func (*FSM) SetVar

func (m *FSM) SetVar(key string, value interface{})

func (*FSM) State

func (m *FSM) State() string

func (*FSM) StreamSet

func (m *FSM) StreamSet() *marionette.StreamSet

func (*FSM) UUID

func (m *FSM) UUID() int

func (*FSM) Var

func (m *FSM) Var(key string) interface{}

Jump to

Keyboard shortcuts

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