Documentation ¶
Index ¶
- Variables
- func ErrorBotExist(format string, args ...interface{}) *errors.Error
- func ErrorContentMissing(format string, args ...interface{}) *errors.Error
- func ErrorCopierCov(format string, args ...interface{}) *errors.Error
- func ErrorSubscriptionIdNotExist(format string, args ...interface{}) *errors.Error
- func ErrorSubscriptionNotExist(format string, args ...interface{}) *errors.Error
- func ErrorTemplateNotFound(format string, args ...interface{}) *errors.Error
- func ErrorUserNotFound(format string, args ...interface{}) *errors.Error
- func IsBotExist(err error) bool
- func IsContentMissing(err error) bool
- func IsCopierCov(err error) bool
- func IsSubscriptionIdNotExist(err error) bool
- func IsSubscriptionNotExist(err error) bool
- func IsTemplateNotFound(err error) bool
- func IsUserNotFound(err error) bool
- type Bot
- func (*Bot) Descriptor() ([]byte, []int)deprecated
- func (x *Bot) GetBotId() string
- func (x *Bot) GetDriverType() string
- func (x *Bot) GetId() uint64
- func (x *Bot) GetNotifyTemplate() string
- func (x *Bot) GetSource() BotSource
- func (x *Bot) GetSubId() string
- func (x *Bot) GetTemplateId() uint64
- func (*Bot) ProtoMessage()
- func (x *Bot) ProtoReflect() protoreflect.Message
- func (x *Bot) Reset()
- func (x *Bot) String() string
- func (m *Bot) Validate() error
- func (m *Bot) ValidateAll() error
- type BotMultiError
- type BotSource
- type BotValidationError
- type ErrorReason
- func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
- func (x ErrorReason) Enum() *ErrorReason
- func (ErrorReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x ErrorReason) Number() protoreflect.EnumNumber
- func (x ErrorReason) String() string
- func (ErrorReason) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( ErrorReason_name = map[int32]string{ 0: "USER_NOT_FOUND", 1: "CONTENT_MISSING", 2: "BOT_EXIST", 3: "SUBSCRIPTION_NOT_EXIST", 4: "SUBSCRIPTION_ID_NOT_EXIST", 5: "TEMPLATE_NOT_FOUND", 6: "COPIER_COV", } ErrorReason_value = map[string]int32{ "USER_NOT_FOUND": 0, "CONTENT_MISSING": 1, "BOT_EXIST": 2, "SUBSCRIPTION_NOT_EXIST": 3, "SUBSCRIPTION_ID_NOT_EXIST": 4, "TEMPLATE_NOT_FOUND": 5, "COPIER_COV": 6, } )
Enum value maps for ErrorReason.
var ( BotSource_name = map[int32]string{ 0: "ChainBot", } BotSource_value = map[string]int32{ "ChainBot": 0, } )
Enum value maps for BotSource.
var File_api_helloworld_ecode_proto protoreflect.FileDescriptor
var File_api_helloworld_types_proto protoreflect.FileDescriptor
Functions ¶
func ErrorBotExist ¶
func ErrorContentMissing ¶
func ErrorCopierCov ¶
func ErrorTemplateNotFound ¶
func ErrorUserNotFound ¶
为某个枚举单独设置错误码
func IsBotExist ¶
func IsContentMissing ¶
func IsCopierCov ¶
func IsSubscriptionNotExist ¶
func IsTemplateNotFound ¶
Types ¶
type Bot ¶
type Bot struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Source BotSource `protobuf:"varint,2,opt,name=source,proto3,enum=api.helloworld.BotSource" json:"source,omitempty"` BotId string `protobuf:"bytes,3,opt,name=botId,proto3" json:"botId,omitempty"` SubId string `protobuf:"bytes,4,opt,name=subId,proto3" json:"subId,omitempty"` DriverType string `protobuf:"bytes,5,opt,name=driverType,proto3" json:"driverType,omitempty"` NotifyTemplate string `protobuf:"bytes,6,opt,name=notifyTemplate,proto3" json:"notifyTemplate,omitempty"` TemplateId uint64 `protobuf:"varint,7,opt,name=templateId,proto3" json:"templateId,omitempty"` // contains filtered or unexported fields }
func (*Bot) Descriptor
deprecated
func (*Bot) GetDriverType ¶
func (*Bot) GetNotifyTemplate ¶
func (*Bot) GetTemplateId ¶
func (*Bot) ProtoMessage ¶
func (*Bot) ProtoMessage()
func (*Bot) ProtoReflect ¶
func (x *Bot) ProtoReflect() protoreflect.Message
func (*Bot) Validate ¶
Validate checks the field values on Bot with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Bot) ValidateAll ¶
ValidateAll checks the field values on Bot with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in BotMultiError, or nil if none found.
type BotMultiError ¶
type BotMultiError []error
BotMultiError is an error wrapping multiple validation errors returned by Bot.ValidateAll() if the designated constraints aren't met.
func (BotMultiError) AllErrors ¶
func (m BotMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (BotMultiError) Error ¶
func (m BotMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type BotSource ¶
type BotSource int32
const (
BotSource_ChainBot BotSource = 0
)
func (BotSource) Descriptor ¶
func (BotSource) Descriptor() protoreflect.EnumDescriptor
func (BotSource) EnumDescriptor
deprecated
func (BotSource) Number ¶
func (x BotSource) Number() protoreflect.EnumNumber
func (BotSource) Type ¶
func (BotSource) Type() protoreflect.EnumType
type BotValidationError ¶
type BotValidationError struct {
// contains filtered or unexported fields
}
BotValidationError is the validation error returned by Bot.Validate if the designated constraints aren't met.
func (BotValidationError) Cause ¶
func (e BotValidationError) Cause() error
Cause function returns cause value.
func (BotValidationError) Error ¶
func (e BotValidationError) Error() string
Error satisfies the builtin error interface
func (BotValidationError) ErrorName ¶
func (e BotValidationError) ErrorName() string
ErrorName returns error name.
func (BotValidationError) Field ¶
func (e BotValidationError) Field() string
Field function returns field value.
func (BotValidationError) Key ¶
func (e BotValidationError) Key() bool
Key function returns key value.
func (BotValidationError) Reason ¶
func (e BotValidationError) Reason() string
Reason function returns reason value.
type ErrorReason ¶
type ErrorReason int32
const ( // 为某个枚举单独设置错误码 ErrorReason_USER_NOT_FOUND ErrorReason = 0 ErrorReason_CONTENT_MISSING ErrorReason = 1 ErrorReason_BOT_EXIST ErrorReason = 2 ErrorReason_SUBSCRIPTION_NOT_EXIST ErrorReason = 3 ErrorReason_SUBSCRIPTION_ID_NOT_EXIST ErrorReason = 4 ErrorReason_TEMPLATE_NOT_FOUND ErrorReason = 5 ErrorReason_COPIER_COV ErrorReason = 6 )
func (ErrorReason) Descriptor ¶
func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
func (ErrorReason) Enum ¶
func (x ErrorReason) Enum() *ErrorReason
func (ErrorReason) EnumDescriptor
deprecated
func (ErrorReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use ErrorReason.Descriptor instead.
func (ErrorReason) Number ¶
func (x ErrorReason) Number() protoreflect.EnumNumber
func (ErrorReason) String ¶
func (x ErrorReason) String() string
func (ErrorReason) Type ¶
func (ErrorReason) Type() protoreflect.EnumType