Documentation
¶
Index ¶
Constants ¶
View Source
const ID_STATUS_CHOKED = 0
// // PWP MESSAGE ID TABLE // // Status
View Source
const ID_STATUS_INTERESTED = 2
View Source
const ID_STATUS_NOT_INTERESTED = 3
View Source
const ID_STATUS_UNCHOKED = 1
View Source
const STATUS_TYPE_CHOKED = 0
View Source
const STATUS_TYPE_INTERESTED = 1
Variables ¶
This section is empty.
Functions ¶
func Encode ¶
func Encode(message PWPMessage) []byte
func IsStatusMessage ¶
Types ¶
type MessageWithBody ¶
type MessageWithBody struct {
// contains filtered or unexported fields
}
func NewPWPMessageWithBody ¶
func NewPWPMessageWithBody(id int, length int, payload interface{}) *MessageWithBody
func (*MessageWithBody) GetId ¶
func (m *MessageWithBody) GetId() int
func (*MessageWithBody) GetLength ¶
func (m *MessageWithBody) GetLength() int
func (*MessageWithBody) GetPayload ¶
func (m *MessageWithBody) GetPayload() interface{}
func (*MessageWithBody) ToString ¶
func (m *MessageWithBody) ToString() string
type PWPMessage ¶
type PWPMessage interface {
GetId() int
GetLength() int
GetPayload() interface{}
ToString() string
}
func Decode ¶
func Decode(data []byte) PWPMessage
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
func GetStatusFromId ¶
func (*Status) GetPayload ¶
func (sm *Status) GetPayload() interface{}
type StatusTuple ¶
func GetStatusTupleFromId ¶
func GetStatusTupleFromId(id int) *StatusTuple
Click to show internal directories.
Click to hide internal directories.