代码拉取完成,页面将自动刷新
同步操作将从 YoMo/y3-codec-golang 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package y3
import (
"fmt"
)
// signal is builder for PrimitivePacketEncoder
type signal struct {
encoder *PrimitivePacketEncoder
}
// createSignal create a signal
func createSignal(key byte) *signal {
return &signal{encoder: NewPrimitivePacketEncoder(int(key))}
}
// SetString set a string Value for the signal
func (s *signal) SetString(v string) *signal {
s.encoder.SetStringValue(v)
return s
}
// SetString set a int64 Value for the signal
func (s *signal) SetInt64(v int64) *signal {
s.encoder.SetInt64Value(v)
return s
}
// SetString set a float64 Value for the signal
func (s *signal) SetFloat64(v float64) *signal {
s.encoder.SetFloat64Value(v)
return s
}
// ToEncoder return current PrimitivePacketEncoder, and checking legality
func (s *signal) ToEncoder(allow func(key byte) bool) *PrimitivePacketEncoder {
if allow != nil && !allow(byte(s.encoder.seqID)) {
panic(fmt.Errorf("it is not allowed to use this key to create a signal: %#x", byte(s.encoder.seqID)))
}
return s.encoder
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。