mocks: Index | Files

package mocks

import ""


Package Files


type Addr Uses

type Addr struct {
    Net, Addr string

Mocks a network address

func (Addr) Network Uses

func (m Addr) Network() string

func (Addr) String Uses

func (m Addr) String() string

type Conn Uses

type Conn struct {
    // Local network & address for the connection
    LNet, LAddr string
    // Remote network & address for the connection
    RNet, RAddr string
    // In messages will be written to this buffer
    In  io.Writer
    // Out messages will be read from this buffer
    Out io.Reader
    // contains filtered or unexported fields

Mocks a network connection. Implements the net.Conn interface

func Pipe Uses

func Pipe(c1, c2 *Conn) (*Conn, *Conn)

Pipe turns two mock connections into a full-duplex connection similar to net.Pipe to allow pipe's with (fake) addresses.

func (*Conn) Close Uses

func (c *Conn) Close() error

func (Conn) LocalAddr Uses

func (c Conn) LocalAddr() net.Addr

func (*Conn) Read Uses

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

func (Conn) RemoteAddr Uses

func (c Conn) RemoteAddr() net.Addr

func (Conn) SetDeadline Uses

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

Not implemented

func (Conn) SetReadDeadline Uses

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

func (Conn) SetWriteDeadline Uses

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

func (*Conn) Write Uses

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

Package mocks imports 4 packages (graph). Updated 2016-08-02. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).