github.com/TeaOSLab/EdgeNode@v1.3.8/internal/nodes/client_conn_interface.go (about) 1 // Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. 2 3 package nodes 4 5 type ClientConnInterface interface { 6 // IsClosed 是否已关闭 7 IsClosed() bool 8 9 // IsBound 是否已绑定服务 10 IsBound() bool 11 12 // Bind 绑定服务 13 Bind(serverId int64, remoteAddr string, maxConnsPerServer int, maxConnsPerIP int) bool 14 15 // ServerId 获取服务ID 16 ServerId() int64 17 18 // SetServerId 设置服务ID 19 SetServerId(serverId int64) (goNext bool) 20 21 // SetUserId 设置所属网站的用户ID 22 SetUserId(userId int64) 23 24 // SetUserPlanId 设置 25 SetUserPlanId(userPlanId int64) 26 27 // UserId 获取当前连接所属服务的用户ID 28 UserId() int64 29 30 // SetIsPersistent 设置是否为持久化 31 SetIsPersistent(isPersistent bool) 32 33 // SetFingerprint 设置指纹信息 34 SetFingerprint(fingerprint []byte) 35 36 // Fingerprint 读取指纹信息 37 Fingerprint() []byte 38 39 // LastRequestBytes 读取上一次请求发送的字节数 40 LastRequestBytes() int64 41 }