protocol

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Package protocol implements the Subscriber protocol

Index

Constants

View Source
const (
	// ProtocolID is the protocol ID for the Subscriber protocol
	ProtocolID = 0x6E

	// MethodHello is the method ID for the method Hello
	MethodHello = 0x1

	// MethodPostContent is the method ID for the method PostContent
	MethodPostContent = 0x2

	// MethodGetContent is the method ID for the method GetContent
	MethodGetContent = 0x3

	// MethodFollow is the method ID for the method Follow
	MethodFollow = 0x4

	// MethodUnfollowAllAndFollow is the method ID for the method UnfollowAllAndFollow
	MethodUnfollowAllAndFollow = 0x5

	// MethodUnfollow is the method ID for the method Unfollow
	MethodUnfollow = 0x6

	// MethodGetFollowing is the method ID for the method GetFollowing
	MethodGetFollowing = 0x7

	// MethodGetFollower is the method ID for the method GetFollower
	MethodGetFollower = 0x8

	// MethodGetNumFollowers is the method ID for the method GetNumFollowers
	MethodGetNumFollowers = 0x9

	// MethodGetTimeline is the method ID for the method GetTimeline
	MethodGetTimeline = 0xA

	// MethodDeleteContent is the method ID for the method DeleteContent
	MethodDeleteContent = 0xB

	// MethodGetContentMulti is the method ID for the method GetContentMulti
	MethodGetContentMulti = 0xC

	// MethodUpdateUserStatus is the method ID for the method UpdateUserStatus
	MethodUpdateUserStatus = 0xD

	// MethodGetFriendUserStatuses is the method ID for the method GetFriendUserStatuses
	MethodGetFriendUserStatuses = 0xE

	// MethodGetUserStatuses is the method ID for the method GetUserStatuses
	MethodGetUserStatuses = 0xF
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Endpoint() nex.EndpointInterface
	SetEndpoint(endpoint nex.EndpointInterface)
	SetHandlerHello(handler func(err error, packet nex.PacketInterface, callID uint32, unknown *types.String) (*nex.RMCMessage, *nex.Error))
	SetHandlerPostContent(handler func(err error, packet nex.PacketInterface, callID uint32, param *subscriber_types.SubscriberPostContentParam) (*nex.RMCMessage, *nex.Error))
	SetHandlerGetContent(handler func(err error, packet nex.PacketInterface, callID uint32, param *subscriber_types.SubscriberGetContentParam) (*nex.RMCMessage, *nex.Error))
	SetHandlerFollow(handler func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error))
	SetHandlerUnfollowAllAndFollow(handler func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error))
	SetHandlerUnfollow(handler func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error))
	SetHandlerGetFollowing(handler func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error))
	SetHandlerGetFollower(handler func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error))
	SetHandlerGetNumFollowers(handler func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error))
	SetHandlerGetTimeline(handler func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error))
	SetHandlerDeleteContent(handler func(err error, packet nex.PacketInterface, callID uint32, unknown1 *types.List[*types.String], unknown2 *types.PrimitiveU64) (*nex.RMCMessage, *nex.Error))
	SetHandlerGetContentMulti(handler func(err error, packet nex.PacketInterface, callID uint32, params *types.List[*subscriber_types.SubscriberGetContentParam]) (*nex.RMCMessage, *nex.Error))
	SetHandlerUpdateUserStatus(handler func(err error, packet nex.PacketInterface, callID uint32, unknown1 *types.List[*subscriber_types.Unknown], unknown2 *types.List[*types.PrimitiveU8]) (*nex.RMCMessage, *nex.Error))
	SetHandlerGetFriendUserStatuses(handler func(err error, packet nex.PacketInterface, callID uint32, unknown *types.List[*types.PrimitiveU8]) (*nex.RMCMessage, *nex.Error))
	SetHandlerGetUserStatuses(handler func(err error, packet nex.PacketInterface, callID uint32, pids *types.List[*types.PID], unknown *types.List[*types.PrimitiveU8]) (*nex.RMCMessage, *nex.Error))
}

Interface implements the methods present on the Subscriber protocol struct

type Protocol

type Protocol struct {
	Hello                 func(err error, packet nex.PacketInterface, callID uint32, unknown *types.String) (*nex.RMCMessage, *nex.Error)
	PostContent           func(err error, packet nex.PacketInterface, callID uint32, param *subscriber_types.SubscriberPostContentParam) (*nex.RMCMessage, *nex.Error)
	GetContent            func(err error, packet nex.PacketInterface, callID uint32, param *subscriber_types.SubscriberGetContentParam) (*nex.RMCMessage, *nex.Error)
	Follow                func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error)
	UnfollowAllAndFollow  func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error)
	Unfollow              func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error)
	GetFollowing          func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error)
	GetFollower           func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error)
	GetNumFollowers       func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error)
	GetTimeline           func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error)
	DeleteContent         func(err error, packet nex.PacketInterface, callID uint32, unknown1 *types.List[*types.String], unknown2 *types.PrimitiveU64) (*nex.RMCMessage, *nex.Error)
	GetContentMulti       func(err error, packet nex.PacketInterface, callID uint32, params *types.List[*subscriber_types.SubscriberGetContentParam]) (*nex.RMCMessage, *nex.Error)
	UpdateUserStatus      func(err error, packet nex.PacketInterface, callID uint32, unknown1 *types.List[*subscriber_types.Unknown], unknown2 *types.List[*types.PrimitiveU8]) (*nex.RMCMessage, *nex.Error)
	GetFriendUserStatuses func(err error, packet nex.PacketInterface, callID uint32, unknown *types.List[*types.PrimitiveU8]) (*nex.RMCMessage, *nex.Error)
	GetUserStatuses       func(err error, packet nex.PacketInterface, callID uint32, pids *types.List[*types.PID], unknown *types.List[*types.PrimitiveU8]) (*nex.RMCMessage, *nex.Error)
	Patches               nex.ServiceProtocol
	PatchedMethods        []uint32
	// contains filtered or unexported fields
}

Protocol stores all the RMC method handlers for the Subscriber protocol and listens for requests

func NewProtocol

func NewProtocol() *Protocol

NewProtocol returns a new Subscriber protocol

func (*Protocol) Endpoint

func (protocol *Protocol) Endpoint() nex.EndpointInterface

Endpoint returns the endpoint implementing the protocol

func (*Protocol) HandlePacket

func (protocol *Protocol) HandlePacket(packet nex.PacketInterface)

HandlePacket sends the packet to the correct RMC method handler

func (*Protocol) SetEndpoint

func (protocol *Protocol) SetEndpoint(endpoint nex.EndpointInterface)

SetEndpoint sets the endpoint implementing the protocol

func (*Protocol) SetHandlerDeleteContent

func (protocol *Protocol) SetHandlerDeleteContent(handler func(err error, packet nex.PacketInterface, callID uint32, unknown1 *types.List[*types.String], unknown2 *types.PrimitiveU64) (*nex.RMCMessage, *nex.Error))

SetHandlerDeleteContent sets the handler for the DeleteContent method

func (*Protocol) SetHandlerFollow

func (protocol *Protocol) SetHandlerFollow(handler func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error))

SetHandlerFollow sets the handler for the Follow method

func (*Protocol) SetHandlerGetContent

func (protocol *Protocol) SetHandlerGetContent(handler func(err error, packet nex.PacketInterface, callID uint32, param *subscriber_types.SubscriberGetContentParam) (*nex.RMCMessage, *nex.Error))

SetHandlerGetContent sets the handler for the GetContent method

func (*Protocol) SetHandlerGetContentMulti

func (protocol *Protocol) SetHandlerGetContentMulti(handler func(err error, packet nex.PacketInterface, callID uint32, params *types.List[*subscriber_types.SubscriberGetContentParam]) (*nex.RMCMessage, *nex.Error))

SetHandlerGetContentMulti sets the handler for the GetContentMulti method

func (*Protocol) SetHandlerGetFollower

func (protocol *Protocol) SetHandlerGetFollower(handler func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error))

SetHandlerGetFollower sets the handler for the GetFollower method

func (*Protocol) SetHandlerGetFollowing

func (protocol *Protocol) SetHandlerGetFollowing(handler func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error))

SetHandlerGetFollowing sets the handler for the GetFollowing method

func (*Protocol) SetHandlerGetFriendUserStatuses

func (protocol *Protocol) SetHandlerGetFriendUserStatuses(handler func(err error, packet nex.PacketInterface, callID uint32, unknown *types.List[*types.PrimitiveU8]) (*nex.RMCMessage, *nex.Error))

SetHandlerGetFriendUserStatuses sets the handler for the GetFriendUserStatuses method

func (*Protocol) SetHandlerGetNumFollowers

func (protocol *Protocol) SetHandlerGetNumFollowers(handler func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error))

SetHandlerGetNumFollowers sets the handler for the GetNumFollowers method

func (*Protocol) SetHandlerGetTimeline

func (protocol *Protocol) SetHandlerGetTimeline(handler func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error))

SetHandlerGetTimeline sets the handler for the GetTimeline method

func (*Protocol) SetHandlerGetUserStatuses

func (protocol *Protocol) SetHandlerGetUserStatuses(handler func(err error, packet nex.PacketInterface, callID uint32, pids *types.List[*types.PID], unknown *types.List[*types.PrimitiveU8]) (*nex.RMCMessage, *nex.Error))

SetHandlerGetUserStatuses sets the handler for the GetUserStatuses method

func (*Protocol) SetHandlerHello

func (protocol *Protocol) SetHandlerHello(handler func(err error, packet nex.PacketInterface, callID uint32, unknown *types.String) (*nex.RMCMessage, *nex.Error))

SetHandlerHello sets the handler for the Hello method

func (*Protocol) SetHandlerPostContent

func (protocol *Protocol) SetHandlerPostContent(handler func(err error, packet nex.PacketInterface, callID uint32, param *subscriber_types.SubscriberPostContentParam) (*nex.RMCMessage, *nex.Error))

SetHandlerPostContent sets the handler for the PostContent method

func (*Protocol) SetHandlerUnfollow

func (protocol *Protocol) SetHandlerUnfollow(handler func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error))

SetHandlerUnfollow sets the handler for the Unfollow method

func (*Protocol) SetHandlerUnfollowAllAndFollow

func (protocol *Protocol) SetHandlerUnfollowAllAndFollow(handler func(err error, packet nex.PacketInterface, callID uint32, packetPayload []byte) (*nex.RMCMessage, *nex.Error))

SetHandlerUnfollowAllAndFollow sets the handler for the UnfollowAllAndFollow method

func (*Protocol) SetHandlerUpdateUserStatus

func (protocol *Protocol) SetHandlerUpdateUserStatus(handler func(err error, packet nex.PacketInterface, callID uint32, unknown1 *types.List[*subscriber_types.Unknown], unknown2 *types.List[*types.PrimitiveU8]) (*nex.RMCMessage, *nex.Error))

SetHandlerUpdateUserStatus sets the handler for the UpdateUserStatus method

Directories

Path Synopsis
Package types implements all the types used by the Shop protocol
Package types implements all the types used by the Shop protocol

Jump to

Keyboard shortcuts

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