mocks

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PortValue           uint16
	InboundConfigValue  *ConnectionConfig
	OutboundConfigValue *ConnectionConfig
}

func (*Config) InboundConfig

func (config *Config) InboundConfig() core.ConnectionConfig

func (*Config) OutboundConfig

func (config *Config) OutboundConfig() core.ConnectionConfig

func (*Config) Port

func (config *Config) Port() uint16

type ConnectionConfig

type ConnectionConfig struct {
	ProtocolValue string
	ContentValue  []byte
}

func (*ConnectionConfig) Content

func (config *ConnectionConfig) Content() []byte

func (*ConnectionConfig) Protocol

func (config *ConnectionConfig) Protocol() string

type InboundConnectionHandler

type InboundConnectionHandler struct {
	Data2Send    []byte
	DataReturned *bytes.Buffer
	Port         uint16
	Server       *core.Point
}

func (*InboundConnectionHandler) Communicate

func (handler *InboundConnectionHandler) Communicate(packet v2net.Packet) error

func (*InboundConnectionHandler) Create

func (handler *InboundConnectionHandler) Create(point *core.Point, config []byte) (core.InboundConnectionHandler, error)

func (*InboundConnectionHandler) Listen

func (handler *InboundConnectionHandler) Listen(port uint16) error

type MockUserSet

type MockUserSet struct {
	UserIds    []user.ID
	UserHashes map[string]int
	Timestamps map[string]int64
}

func (*MockUserSet) AddUser

func (us *MockUserSet) AddUser(user user.User) error

func (*MockUserSet) GetUser

func (us *MockUserSet) GetUser(userhash []byte) (*user.ID, int64, bool)

type OutboundConnectionHandler

type OutboundConnectionHandler struct {
	Data2Send   *bytes.Buffer
	Data2Return []byte
	Destination v2net.Destination
}

func (*OutboundConnectionHandler) Create

func (handler *OutboundConnectionHandler) Create(point *core.Point, packet v2net.Packet) (core.OutboundConnectionHandler, error)

func (*OutboundConnectionHandler) Initialize

func (handler *OutboundConnectionHandler) Initialize(config []byte) error

func (*OutboundConnectionHandler) Start

func (handler *OutboundConnectionHandler) Start(ray core.OutboundRay) error

Jump to

Keyboard shortcuts

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