Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTypeName ¶
func GetTypeName(dummyInstance interface{}) (name string)
GetTypeName 返回任务类型名称, 作为任务类型的唯一标准
Types ¶
type PackFormatOrSignatureFormatNotMatchError ¶
type PackFormatOrSignatureFormatNotMatchError struct {
// contains filtered or unexported fields
}
PackFormatOrSignatureFormatNotMatchError 是传入 TaskTypeManager 的 Packer 所给输出的格式与预期格式不匹配时返回的错误
func (PackFormatOrSignatureFormatNotMatchError) Error ¶
func (e PackFormatOrSignatureFormatNotMatchError) Error() string
type SignatureNotMatchError ¶
type SignatureNotMatchError struct { Name string // contains filtered or unexported fields }
SignatureNotMatchError 是当尝试注册任务类型, 但其签名与数据库中所存的任务类型的签名不符时, 返回的错误
func (SignatureNotMatchError) Error ¶
func (e SignatureNotMatchError) Error() string
type TypeManager ¶
type TypeManager struct {
// contains filtered or unexported fields
}
TypeManager 管理任务类型
func OpenTypeManager ¶
func OpenTypeManager(path string, packer datapacker.Packer) (m *TypeManager, err error)
OpenTypeManager 打开一个 TypeManager 若其并不存在, 创建之
func (TypeManager) Pack ¶
func (m TypeManager) Pack(task interface{}) (packed []byte, err error)
Pack 打包任务
func (*TypeManager) Register ¶
func (m *TypeManager) Register(dummyInstance interface{}) (err error)
Register 在 TypeManager 中注册一个任务类型
type TypeNotRegisteredError ¶
type TypeNotRegisteredError struct {
Name string
}
TypeNotRegisteredError 是尝试打包/解包任务, 但任务类型并没有被注册时返回的错误
func (TypeNotRegisteredError) Error ¶
func (e TypeNotRegisteredError) Error() string
type TypeRecord ¶
TypeRecord 记录了任务类型
Click to show internal directories.
Click to hide internal directories.