urange

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func I2i

func I2i(target, source, targetKey, sourceKey, compareKey interface{})

I2i 遍历对接rpc拿过来的数据。附加source的数据到target的对应字段里 target 需要遍历的数据,source rpc过来的数据 目前仅支持string,uint类型 (rs.Data, suser.Data, "Avatar,NickName", "", "UserId,Uid")

func I2iKey

func I2iKey(target, source, targetKey, sourceKey, compareKey interface{}, subkey string)

I2i 遍历对接rpc拿过来的数据。附加source的数据到target的对应字段里 target 需要遍历的数据,source rpc过来的数据 目前仅支持string,uint类型 targetKey 目标key,sourceKey 资源key。如果sourceKey为空,则使用targetKey。 compareKey对比key subkey二级struct名字 urange.I2iKey(data, suser.Data, "Avatar,NickName", "", "FriendId,Uid", "worker")

func ROuint32

func ROuint32(source interface{}, key string) []uint32

ROuint32 原始的,没有去重复的遍历数据

func ROuint64

func ROuint64(source interface{}, key string) []uint64

原始

func Rstring

func Rstring(source interface{}, key string) string

拼接成 'bbb','xxx'

func Rstrings

func Rstrings(source interface{}, key string) []string

拼接成 ['xxx','xxx']

func Ruint32

func Ruint32(source interface{}, key string) []uint32

Ruint32 遍历给定对象返回一个uint32 slice

	type Source struct { Id uint32 }
	var rs []*Source
	rs = append(rs, &Source{Id: 111})
	rs = append(rs, &Source{Id: 222})
 uid := Ruint32(rs, "Id")

对象的key区分大小写。返回结果已经去重复

func Ruint64

func Ruint64(source interface{}, key string) []uint64

去重

Types

This section is empty.

Jump to

Keyboard shortcuts

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