123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345 |
- // Copyright 2018 The Go Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style.
- // license that can be found in the LICENSE file.
- // Code generated by generate-types. DO NOT EDIT.
- package filedesc
- import (
- "fmt"
- "sync"
- "google.golang.org/protobuf/internal/descfmt"
- "google.golang.org/protobuf/internal/pragma"
- "google.golang.org/protobuf/reflect/protoreflect"
- )
- type Enums struct {
- List []Enum
- once sync.Once
- byName map[protoreflect.Name]*Enum // protected by once
- }
- func (p *Enums) Len() int {
- return len(p.List)
- }
- func (p *Enums) Get(i int) protoreflect.EnumDescriptor {
- return &p.List[i]
- }
- func (p *Enums) ByName(s protoreflect.Name) protoreflect.EnumDescriptor {
- if d := p.lazyInit().byName[s]; d != nil {
- return d
- }
- return nil
- }
- func (p *Enums) Format(s fmt.State, r rune) {
- descfmt.FormatList(s, r, p)
- }
- func (p *Enums) ProtoInternal(pragma.DoNotImplement) {}
- func (p *Enums) lazyInit() *Enums {
- p.once.Do(func() {
- if len(p.List) > 0 {
- p.byName = make(map[protoreflect.Name]*Enum, len(p.List))
- for i := range p.List {
- d := &p.List[i]
- if _, ok := p.byName[d.Name()]; !ok {
- p.byName[d.Name()] = d
- }
- }
- }
- })
- return p
- }
- type EnumValues struct {
- List []EnumValue
- once sync.Once
- byName map[protoreflect.Name]*EnumValue // protected by once
- byNum map[protoreflect.EnumNumber]*EnumValue // protected by once
- }
- func (p *EnumValues) Len() int {
- return len(p.List)
- }
- func (p *EnumValues) Get(i int) protoreflect.EnumValueDescriptor {
- return &p.List[i]
- }
- func (p *EnumValues) ByName(s protoreflect.Name) protoreflect.EnumValueDescriptor {
- if d := p.lazyInit().byName[s]; d != nil {
- return d
- }
- return nil
- }
- func (p *EnumValues) ByNumber(n protoreflect.EnumNumber) protoreflect.EnumValueDescriptor {
- if d := p.lazyInit().byNum[n]; d != nil {
- return d
- }
- return nil
- }
- func (p *EnumValues) Format(s fmt.State, r rune) {
- descfmt.FormatList(s, r, p)
- }
- func (p *EnumValues) ProtoInternal(pragma.DoNotImplement) {}
- func (p *EnumValues) lazyInit() *EnumValues {
- p.once.Do(func() {
- if len(p.List) > 0 {
- p.byName = make(map[protoreflect.Name]*EnumValue, len(p.List))
- p.byNum = make(map[protoreflect.EnumNumber]*EnumValue, len(p.List))
- for i := range p.List {
- d := &p.List[i]
- if _, ok := p.byName[d.Name()]; !ok {
- p.byName[d.Name()] = d
- }
- if _, ok := p.byNum[d.Number()]; !ok {
- p.byNum[d.Number()] = d
- }
- }
- }
- })
- return p
- }
- type Messages struct {
- List []Message
- once sync.Once
- byName map[protoreflect.Name]*Message // protected by once
- }
- func (p *Messages) Len() int {
- return len(p.List)
- }
- func (p *Messages) Get(i int) protoreflect.MessageDescriptor {
- return &p.List[i]
- }
- func (p *Messages) ByName(s protoreflect.Name) protoreflect.MessageDescriptor {
- if d := p.lazyInit().byName[s]; d != nil {
- return d
- }
- return nil
- }
- func (p *Messages) Format(s fmt.State, r rune) {
- descfmt.FormatList(s, r, p)
- }
- func (p *Messages) ProtoInternal(pragma.DoNotImplement) {}
- func (p *Messages) lazyInit() *Messages {
- p.once.Do(func() {
- if len(p.List) > 0 {
- p.byName = make(map[protoreflect.Name]*Message, len(p.List))
- for i := range p.List {
- d := &p.List[i]
- if _, ok := p.byName[d.Name()]; !ok {
- p.byName[d.Name()] = d
- }
- }
- }
- })
- return p
- }
- type Fields struct {
- List []Field
- once sync.Once
- byName map[protoreflect.Name]*Field // protected by once
- byJSON map[string]*Field // protected by once
- byNum map[protoreflect.FieldNumber]*Field // protected by once
- }
- func (p *Fields) Len() int {
- return len(p.List)
- }
- func (p *Fields) Get(i int) protoreflect.FieldDescriptor {
- return &p.List[i]
- }
- func (p *Fields) ByName(s protoreflect.Name) protoreflect.FieldDescriptor {
- if d := p.lazyInit().byName[s]; d != nil {
- return d
- }
- return nil
- }
- func (p *Fields) ByJSONName(s string) protoreflect.FieldDescriptor {
- if d := p.lazyInit().byJSON[s]; d != nil {
- return d
- }
- return nil
- }
- func (p *Fields) ByNumber(n protoreflect.FieldNumber) protoreflect.FieldDescriptor {
- if d := p.lazyInit().byNum[n]; d != nil {
- return d
- }
- return nil
- }
- func (p *Fields) Format(s fmt.State, r rune) {
- descfmt.FormatList(s, r, p)
- }
- func (p *Fields) ProtoInternal(pragma.DoNotImplement) {}
- func (p *Fields) lazyInit() *Fields {
- p.once.Do(func() {
- if len(p.List) > 0 {
- p.byName = make(map[protoreflect.Name]*Field, len(p.List))
- p.byJSON = make(map[string]*Field, len(p.List))
- p.byNum = make(map[protoreflect.FieldNumber]*Field, len(p.List))
- for i := range p.List {
- d := &p.List[i]
- if _, ok := p.byName[d.Name()]; !ok {
- p.byName[d.Name()] = d
- }
- if _, ok := p.byJSON[d.JSONName()]; !ok {
- p.byJSON[d.JSONName()] = d
- }
- if _, ok := p.byNum[d.Number()]; !ok {
- p.byNum[d.Number()] = d
- }
- }
- }
- })
- return p
- }
- type Oneofs struct {
- List []Oneof
- once sync.Once
- byName map[protoreflect.Name]*Oneof // protected by once
- }
- func (p *Oneofs) Len() int {
- return len(p.List)
- }
- func (p *Oneofs) Get(i int) protoreflect.OneofDescriptor {
- return &p.List[i]
- }
- func (p *Oneofs) ByName(s protoreflect.Name) protoreflect.OneofDescriptor {
- if d := p.lazyInit().byName[s]; d != nil {
- return d
- }
- return nil
- }
- func (p *Oneofs) Format(s fmt.State, r rune) {
- descfmt.FormatList(s, r, p)
- }
- func (p *Oneofs) ProtoInternal(pragma.DoNotImplement) {}
- func (p *Oneofs) lazyInit() *Oneofs {
- p.once.Do(func() {
- if len(p.List) > 0 {
- p.byName = make(map[protoreflect.Name]*Oneof, len(p.List))
- for i := range p.List {
- d := &p.List[i]
- if _, ok := p.byName[d.Name()]; !ok {
- p.byName[d.Name()] = d
- }
- }
- }
- })
- return p
- }
- type Extensions struct {
- List []Extension
- once sync.Once
- byName map[protoreflect.Name]*Extension // protected by once
- }
- func (p *Extensions) Len() int {
- return len(p.List)
- }
- func (p *Extensions) Get(i int) protoreflect.ExtensionDescriptor {
- return &p.List[i]
- }
- func (p *Extensions) ByName(s protoreflect.Name) protoreflect.ExtensionDescriptor {
- if d := p.lazyInit().byName[s]; d != nil {
- return d
- }
- return nil
- }
- func (p *Extensions) Format(s fmt.State, r rune) {
- descfmt.FormatList(s, r, p)
- }
- func (p *Extensions) ProtoInternal(pragma.DoNotImplement) {}
- func (p *Extensions) lazyInit() *Extensions {
- p.once.Do(func() {
- if len(p.List) > 0 {
- p.byName = make(map[protoreflect.Name]*Extension, len(p.List))
- for i := range p.List {
- d := &p.List[i]
- if _, ok := p.byName[d.Name()]; !ok {
- p.byName[d.Name()] = d
- }
- }
- }
- })
- return p
- }
- type Services struct {
- List []Service
- once sync.Once
- byName map[protoreflect.Name]*Service // protected by once
- }
- func (p *Services) Len() int {
- return len(p.List)
- }
- func (p *Services) Get(i int) protoreflect.ServiceDescriptor {
- return &p.List[i]
- }
- func (p *Services) ByName(s protoreflect.Name) protoreflect.ServiceDescriptor {
- if d := p.lazyInit().byName[s]; d != nil {
- return d
- }
- return nil
- }
- func (p *Services) Format(s fmt.State, r rune) {
- descfmt.FormatList(s, r, p)
- }
- func (p *Services) ProtoInternal(pragma.DoNotImplement) {}
- func (p *Services) lazyInit() *Services {
- p.once.Do(func() {
- if len(p.List) > 0 {
- p.byName = make(map[protoreflect.Name]*Service, len(p.List))
- for i := range p.List {
- d := &p.List[i]
- if _, ok := p.byName[d.Name()]; !ok {
- p.byName[d.Name()] = d
- }
- }
- }
- })
- return p
- }
- type Methods struct {
- List []Method
- once sync.Once
- byName map[protoreflect.Name]*Method // protected by once
- }
- func (p *Methods) Len() int {
- return len(p.List)
- }
- func (p *Methods) Get(i int) protoreflect.MethodDescriptor {
- return &p.List[i]
- }
- func (p *Methods) ByName(s protoreflect.Name) protoreflect.MethodDescriptor {
- if d := p.lazyInit().byName[s]; d != nil {
- return d
- }
- return nil
- }
- func (p *Methods) Format(s fmt.State, r rune) {
- descfmt.FormatList(s, r, p)
- }
- func (p *Methods) ProtoInternal(pragma.DoNotImplement) {}
- func (p *Methods) lazyInit() *Methods {
- p.once.Do(func() {
- if len(p.List) > 0 {
- p.byName = make(map[protoreflect.Name]*Method, len(p.List))
- for i := range p.List {
- d := &p.List[i]
- if _, ok := p.byName[d.Name()]; !ok {
- p.byName[d.Name()] = d
- }
- }
- }
- })
- return p
- }
|