rpc

package
v0.0.0-...-261bb52 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() (err error)

Init is func to initial LogicRPC server

func ParseNetwork

func ParseNetwork(str string) (network, addr string, err error)

ParseNetwork is func to parse network string

Types

type ConnectArg

type ConnectArg struct {
	Auth     string
	RoomID   string
	ServerID string
}

ConnectArg is struct of connect arg

type ConnectReply

type ConnectReply struct {
	UID string
}

ConnectReply is struct of connect reply

type DisconnectArg

type DisconnectArg struct {
	RoomID string
	UID    string
}

DisconnectArg is struct of disconnect arg

type DisconnectReply

type DisconnectReply struct {
	Has bool
}

DisconnectReply is struct of disconnect reply

type Member

type Member struct {
	ID     int    `json:"member_id"`
	AppID  string `json:"app_id"`
	OpenID string `json:"open_id"`
	Scene  string `json:"scene"`
	//SgID     int32  `json:"sg_id"`
	Nickname string `json:"nick_name"`
	Avatar   string `json:"avatar"`
}

Member is struct of token payload

func JwtParseMember

func JwtParseMember(tokenString string) (*Member, error)

JwtParseMember is func to parse and valid token

type MemberStdClaims

type MemberStdClaims struct {
	jwt.StandardClaims
	*Member
}

MemberStdClaims is struct for more payload

type Server

type Server int

Server is struct of logic rpc server

func (*Server) Connect

func (rpc *Server) Connect(_ context.Context, args *ConnectArg, reply *ConnectReply) (err error)

Connect is api for connect

func (*Server) Disconnect

func (rpc *Server) Disconnect(_ context.Context, args *DisconnectArg, reply *DisconnectReply) (err error)

Disconnect if func to remove room user

Jump to

Keyboard shortcuts

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