Documentation
¶
Index ¶
- func BytesGobStruct(f_b []byte, stur interface{})
- func BytesToUint16(buf []byte) uint16
- func BytesToUint32(buf []byte) uint32
- func BytesToUint64(buf []byte) uint64
- func BytesToUint8(buf []byte) uint8
- func DirMustEnd(dir string) string
- func FileExist(filename string) bool
- func GetConfig(sorc string) *goconfig.ConfigFile
- func GetSha1(data string) string
- func JsonToStruct(f_b string, stur interface{})
- func ReadSocketBytes(conn net.Conn, len uint64) (returnByte []byte, err error)
- func ReadSocketToFile(conn net.Conn, len uint64, file *os.File) (err error)
- func ResourceFileToTree(treepoint map[string]ResourceFileTreeStruct, path []string, ...)
- func SendSocketBytes(conn *net.TCPConn, bytes []byte, len uint64) error
- func SendSocketFile(conn net.Conn, fileSize uint64, fileName string) (err error)
- func StructGobBytes(e interface{}) []byte
- func StructToJson(e interface{}) string
- func Uint16ToBytes(i uint16) []byte
- func Uint32ToBytes(i uint32) []byte
- func Uint64ToBytes(i uint64) []byte
- func Uint8ToBytes(i uint8) []byte
- type GroupsTable
- type IsLoginInfo
- type IsLoginInfoBasic
- type OriginFileInfoFullStruct
- type OriginFileInfoStruct
- type ResourceFileTable
- type ResourceFileTreeStruct
- type ResourceGroupTable
- type ResourceGroupTable_MD
- type ResourceGroupTable_RSR
- type ResourceItemTable
- type ResourceRelationTable
- type ResourceStatusTable
- type ResourceTextTable
- type ResourceTypeTable
- type SelfLoginInfo
- type ServersFileInfoStruct
- type UnitsTable
- type UserIsLogin
- type UserPower
- type UsersTable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesGobStruct ¶
func BytesGobStruct(f_b []byte, stur interface{})
BytesGobStruct 将[]byte转成Gob再转成结构体
func ReadSocketBytes ¶
ReadSocketBytes 从socket读出一定长度的数据,放入[]byte中,保证完整读出
func ReadSocketToFile ¶
ReadSocketToFile 从soket读出文件,用带缓冲的方式写入文件里
func ResourceFileToTree ¶
func ResourceFileToTree(treepoint map[string]ResourceFileTreeStruct, path []string, name, hashid string)
ResourceFileToTree 将资源文件变成树状
func SendSocketFile ¶
SendSocketFile 发送一个文件
Types ¶
type GroupsTable ¶
type IsLoginInfo ¶
type IsLoginInfo struct { IsLoginInfoBasic LastTime time.Time }
func NewIsLoginInfo ¶
func NewIsLoginInfo(hashid string, id uint32, name string, groupid uint16, groupname string, unitid uint16, unitname string, lastTime time.Time) *IsLoginInfo
NewIsLoginInfo 是初始化一个人员信息,必须给定name, level, lastTime
func (*IsLoginInfo) NotTimeOut ¶
func (ili *IsLoginInfo) NotTimeOut(timeout int64) bool
NotTimeOut 根据给定的int类型的秒数,判断登录是否已经超时,没超时返回true,超时返回false
func (*IsLoginInfo) UpdateLastTime ¶
func (ili *IsLoginInfo) UpdateLastTime() time.Time
UpdateLastTime 已当前时间写入LastTime中进行更新,并返回写入的时间
type IsLoginInfoBasic ¶
type IsLoginInfoBasic struct { HashId string //登录的hashid Id uint32 //用户ID Name string //用户名 GroupId uint16 //所在组ID GroupName string //所在组名称 UnitId uint16 //所在机构ID UnitName string //所在机构名称 UPower UserPower }
IsLoginInfo 是一个记录单个已经登录的人员信息的表
type OriginFileInfoFullStruct ¶
type OriginFileInfoFullStruct struct { FullDir string //完整客户端本地路径 OriginFileInfoStruct }
type OriginFileInfoStruct ¶
type OriginFileInfoStruct struct { RelativeDir string //相对路径 FileName string //文件名(只是文件名) Size int64 //文件大小 Mode os.FileMode //文件权限 ModeTime time.Time //文件修改日期 }
OriginFileInfoStruct 源文件信息结构体,用于客户端获取本地需上传的文件的相关信息,并由服务端获得并解析。类似os.FileInfo的结构。
type ResourceFileTable ¶
type ResourceFileTreeStruct ¶
type ResourceGroupTable ¶
type ResourceGroupTable_MD ¶
MetaData
type ResourceGroupTable_RSR ¶
Related search results
type ResourceItemTable ¶
type ResourceRelationTable ¶
type ResourceStatusTable ¶
type ResourceTextTable ¶
type ResourceTextTable struct { ResourceItemTable ContentType string Conent string }
type ResourceTypeTable ¶
type SelfLoginInfo ¶
type SelfLoginInfo struct { IsLoginInfoBasic SID string }
type ServersFileInfoStruct ¶
type ServersFileInfoStruct struct { FileHash string //文件hash值 OriginFileInfoStruct }
ServersFileInfoStruct 服务器的文件信息结构体
type UnitsTable ¶
一组数据库表对应结构体
type UserIsLogin ¶
type UserIsLogin struct {
// contains filtered or unexported fields
}
UserIsLogin 是一个map,记录所有已经登录的人员信息
func (*UserIsLogin) Add ¶
func (uil *UserIsLogin) Add(ckcode string, hashid string, id uint32, name string, groupid uint16, groupname string, unitid uint16, unitname string, lastTime time.Time) (ili *IsLoginInfo, err error)
Add 增加一条用户信息,返回响应的IsLoginInfo,如果ckcode重复,则返回错误
func (*UserIsLogin) Clean ¶
func (uil *UserIsLogin) Clean(timeout int64)
Clean 清理已经过期的条目,实际清理的过期时间是设置的两倍
func (*UserIsLogin) Get ¶
func (uil *UserIsLogin) Get(ckcode string) (ili *IsLoginInfo, err error)
Get 获得ckode的用户登录信息,如果err不为nil则为找不到
type UserPower ¶
UserPower 用户具体权限为[权限大类][权限小类]权限级别
func (UserPower) CheckPowerLevel ¶
CheckPowerLevel 检查UPower的权限