helloworld

package
v0.0.0-...-99f5b83 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var (
	BotSource_name = map[int32]string{
		0: "ChainBot",
	}
	BotSource_value = map[string]int32{
		"ChainBot": 0,
	}
)

Enum value maps for BotSource.

View Source
var File_api_helloworld_ecode_proto protoreflect.FileDescriptor
View Source
var File_api_helloworld_types_proto protoreflect.FileDescriptor

Functions

func ErrorBotExist

func ErrorBotExist(format string, args ...interface{}) *errors.Error

func ErrorContentMissing

func ErrorContentMissing(format string, args ...interface{}) *errors.Error

func ErrorCopierCov

func ErrorCopierCov(format string, args ...interface{}) *errors.Error

func ErrorSubscriptionIdNotExist

func ErrorSubscriptionIdNotExist(format string, args ...interface{}) *errors.Error

func ErrorSubscriptionNotExist

func ErrorSubscriptionNotExist(format string, args ...interface{}) *errors.Error

func ErrorTemplateNotFound

func ErrorTemplateNotFound(format string, args ...interface{}) *errors.Error

func ErrorUserNotFound

func ErrorUserNotFound(format string, args ...interface{}) *errors.Error

为某个枚举单独设置错误码

func IsBotExist

func IsBotExist(err error) bool

func IsContentMissing

func IsContentMissing(err error) bool

func IsCopierCov

func IsCopierCov(err error) bool

func IsSubscriptionIdNotExist

func IsSubscriptionIdNotExist(err error) bool

func IsSubscriptionNotExist

func IsSubscriptionNotExist(err error) bool

func IsTemplateNotFound

func IsTemplateNotFound(err error) bool

func IsUserNotFound

func IsUserNotFound(err error) bool

为某个枚举单独设置错误码

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) Descriptor() ([]byte, []int)

Deprecated: Use Bot.ProtoReflect.Descriptor instead.

func (*Bot) GetBotId

func (x *Bot) GetBotId() string

func (*Bot) GetDriverType

func (x *Bot) GetDriverType() string

func (*Bot) GetId

func (x *Bot) GetId() uint64

func (*Bot) GetNotifyTemplate

func (x *Bot) GetNotifyTemplate() string

func (*Bot) GetSource

func (x *Bot) GetSource() BotSource

func (*Bot) GetSubId

func (x *Bot) GetSubId() string

func (*Bot) GetTemplateId

func (x *Bot) GetTemplateId() uint64

func (*Bot) ProtoMessage

func (*Bot) ProtoMessage()

func (*Bot) ProtoReflect

func (x *Bot) ProtoReflect() protoreflect.Message

func (*Bot) Reset

func (x *Bot) Reset()

func (*Bot) String

func (x *Bot) String() string

func (*Bot) Validate

func (m *Bot) Validate() error

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

func (m *Bot) ValidateAll() error

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) Enum

func (x BotSource) Enum() *BotSource

func (BotSource) EnumDescriptor deprecated

func (BotSource) EnumDescriptor() ([]byte, []int)

Deprecated: Use BotSource.Descriptor instead.

func (BotSource) Number

func (x BotSource) Number() protoreflect.EnumNumber

func (BotSource) String

func (x BotSource) String() string

func (BotSource) Type

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) 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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