Source File
proto.go
Belonging Package
google.golang.org/protobuf/reflect/protoreflect
package protoreflect
import (
)
type doNotImplement pragma.DoNotImplement
type ProtoMessage interface{ ProtoReflect() Message }
type Cardinality cardinality
type cardinality int8 // keep exact type opaque as the int type may change
const (
Optional Cardinality = 1 // appears zero or one times
Required Cardinality = 2 // appears exactly one time; invalid with Proto3
Repeated Cardinality = 3 // appears zero or more times
)
const (
BoolKind Kind = 8
EnumKind Kind = 14
Int32Kind Kind = 5
Sint32Kind Kind = 17
Uint32Kind Kind = 13
Int64Kind Kind = 3
Sint64Kind Kind = 18
Uint64Kind Kind = 4
Sfixed32Kind Kind = 15
Fixed32Kind Kind = 7
FloatKind Kind = 2
Sfixed64Kind Kind = 16
Fixed64Kind Kind = 6
DoubleKind Kind = 1
StringKind Kind = 9
BytesKind Kind = 12
MessageKind Kind = 11
GroupKind Kind = 10
)
func ( Kind) () bool {
switch {
case BoolKind, EnumKind,
Int32Kind, Sint32Kind, Uint32Kind,
Int64Kind, Sint64Kind, Uint64Kind,
Sfixed32Kind, Fixed32Kind, FloatKind,
Sfixed64Kind, Fixed64Kind, DoubleKind,
StringKind, BytesKind, MessageKind, GroupKind:
return true
default:
return false
}
}
func ( Kind) () string {
switch {
case BoolKind:
return "bool"
case EnumKind:
return "enum"
case Int32Kind:
return "int32"
case Sint32Kind:
return "sint32"
case Uint32Kind:
return "uint32"
case Int64Kind:
return "int64"
case Sint64Kind:
return "sint64"
case Uint64Kind:
return "uint64"
case Sfixed32Kind:
return "sfixed32"
case Fixed32Kind:
return "fixed32"
case FloatKind:
return "float"
case Sfixed64Kind:
return "sfixed64"
case Fixed64Kind:
return "fixed64"
case DoubleKind:
return "double"
case StringKind:
return "string"
case BytesKind:
return "bytes"
case MessageKind:
return "message"
case GroupKind:
return "group"
default:
return fmt.Sprintf("<unknown:%d>", )
}
}
func ( Kind) () string {
switch {
case BoolKind:
return "BoolKind"
case EnumKind:
return "EnumKind"
case Int32Kind:
return "Int32Kind"
case Sint32Kind:
return "Sint32Kind"
case Uint32Kind:
return "Uint32Kind"
case Int64Kind:
return "Int64Kind"
case Sint64Kind:
return "Sint64Kind"
case Uint64Kind:
return "Uint64Kind"
case Sfixed32Kind:
return "Sfixed32Kind"
case Fixed32Kind:
return "Fixed32Kind"
case FloatKind:
return "FloatKind"
case Sfixed64Kind:
return "Sfixed64Kind"
case Fixed64Kind:
return "Fixed64Kind"
case DoubleKind:
return "DoubleKind"
case StringKind:
return "StringKind"
case BytesKind:
return "BytesKind"
case MessageKind:
return "MessageKind"
case GroupKind:
return "GroupKind"
default:
return fmt.Sprintf("Kind(%d)", )
}
}
type FieldNumber = protowire.Number
Has(n FieldNumber) bool
doNotImplement
}
Has(n FieldNumber) bool
doNotImplement
}
type EnumNumber int32
Has(n EnumNumber) bool
doNotImplement
}
func ( Name) () bool {
return consumeIdent(string()) == len()
}
Has(s Name) bool
doNotImplement
}
func ( FullName) () bool {
:= consumeIdent(string())
if < 0 {
return false
}
for len() > {
if [] != '.' {
return false
}
++
:= consumeIdent(string([:]))
if < 0 {
return false
}
+=
}
return true
}
func ( string) ( int) {
if len() == 0 || !isLetter([]) {
return -1
}
++
for len() > && isLetterDigit([]) {
++
}
return
}
func ( byte) bool {
return == '_' || ('a' <= && <= 'z') || ('A' <= && <= 'Z')
}
func ( byte) bool {
return isLetter() || ('0' <= && <= '9')
}
func ( FullName) () FullName {
if := strings.LastIndexByte(string(), '.'); >= 0 {
return [:]
}
return ""
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |