Documentation ¶
Index ¶
- Constants
- Variables
- func Convert(x string, src, dst Type) string
- func KeySize(fieldNumber int, wire Wire) int
- func KeyValue(fieldNumber int, wire Wire) uint32
- func WireString(t Type) string
- type Class
- type Enum
- type EnumField
- type EnumType
- type Flag
- type ImportedType
- type Message
- type MessageField
- func (f *MessageField) Conv(dst Type) string
- func (f *MessageField) Elem() *MessageField
- func (f *MessageField) Ftype() (s string)
- func (f *MessageField) GoName() string
- func (f *MessageField) GoType() string
- func (f *MessageField) IsPtr() bool
- func (f *MessageField) IsRepeated() bool
- func (f *MessageField) Null() string
- func (f *MessageField) Rtype() string
- func (f *MessageField) Selector(deref bool) string
- type MessageType
- type Object
- type Package
- type ScalarValueType
- type Scope
- func (s *Scope) Copy(parent *Scope) *Scope
- func (s *Scope) Lookup(name string) *Object
- func (s *Scope) LookupEnum(m *proto.Enum) (msg *Enum)
- func (s *Scope) LookupMessage(m *proto.Message) (msg *Message)
- func (s *Scope) LookupOK(name string) (*Object, bool)
- func (s *Scope) LookupParent(name string) (*Scope, *Object)
- func (s *Scope) ResolveName(name string) string
- func (s *Scope) Type(t string) (Type, error)
- type Type
- type UnknownTypeError
- type Wire
Constants ¶
View Source
const (
TUINT64 = 3
)
Variables ¶
View Source
var ScalarValueTypes = [...]ScalarValueType{
{"int32", "int32", "varint"},
{"uint32", "uint32", "varint"},
{"int64", "int64", "varint"},
{"uint64", "uint64", "varint"},
{"sint32", "int32", "zigzag32"},
{"sint64", "int64", "zigzag64"},
{"float32", "float32", "fixed32"},
{"float64", "float64", "fixed64"},
{"fixed32", "uint32", "fixed32"},
{"fixed64", "uint64", "fixed64"},
{"bool", "bool", "varint"},
{"bytes", "[]byte", "bytes"},
{"string", "string", "bytes"},
}
Functions ¶
func WireString ¶
Types ¶
type EnumType ¶
type EnumType struct {
// contains filtered or unexported fields
}
func (*EnumType) ScopeClass ¶
type ImportedType ¶
func (*ImportedType) GoType ¶
func (i *ImportedType) GoType() string
func (*ImportedType) Name ¶
func (i *ImportedType) Name() string
func (*ImportedType) ScopeClass ¶
func (i *ImportedType) ScopeClass() Class
type Message ¶
type Message struct { Name string Fields []*MessageField // contains filtered or unexported fields }
type MessageField ¶
func (*MessageField) Conv ¶
func (f *MessageField) Conv(dst Type) string
Conv converts the filed to dst Type.
func (*MessageField) Elem ¶
func (f *MessageField) Elem() *MessageField
func (*MessageField) Ftype ¶
func (f *MessageField) Ftype() (s string)
Ftype is type of the field in struct field definition
func (*MessageField) GoName ¶
func (f *MessageField) GoName() string
func (*MessageField) GoType ¶
func (f *MessageField) GoType() string
func (*MessageField) IsPtr ¶
func (f *MessageField) IsPtr() bool
func (*MessageField) IsRepeated ¶
func (f *MessageField) IsRepeated() bool
func (*MessageField) Null ¶
func (f *MessageField) Null() string
Null returns the null value of the field.
func (*MessageField) Rtype ¶
func (f *MessageField) Rtype() string
Rtype is return type of the field
func (*MessageField) Selector ¶
func (f *MessageField) Selector(deref bool) string
type MessageType ¶
type MessageType struct {
// contains filtered or unexported fields
}
func (*MessageType) GoType ¶
func (m *MessageType) GoType() string
func (*MessageType) Name ¶
func (m *MessageType) Name() string
func (*MessageType) ScopeClass ¶
func (m *MessageType) ScopeClass() Class
type ScalarValueType ¶
type ScalarValueType struct {
// contains filtered or unexported fields
}
func (ScalarValueType) GoType ¶
func (b ScalarValueType) GoType() string
func (ScalarValueType) Name ¶
func (b ScalarValueType) Name() string
func (ScalarValueType) ScopeClass ¶
func (b ScalarValueType) ScopeClass() Class
func (ScalarValueType) WireType ¶
func (b ScalarValueType) WireType() Wire
type Scope ¶
type Scope struct { Children []*Scope Elems map[string]*Object // contains filtered or unexported fields }
func (*Scope) ResolveName ¶
type UnknownTypeError ¶
type UnknownTypeError struct {
Type string
}
func (*UnknownTypeError) Error ¶
func (e *UnknownTypeError) Error() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.