Documentation
¶
Index ¶
- func AnchorFilter(str string) string
- func CommandBuild() *cobra.Command
- func ExecuteCommand(target, output string) (string, error)
- func IncFilter(content int) template.HTML
- func NoBrFilter(content string) template.HTML
- func PFilter(content string) template.HTML
- func ParaFilter(content string) string
- func RawFilter(content string) template.HTML
- type Enum
- type EnumValue
- type File
- type FileExtension
- type Message
- type MessageExtension
- type MessageField
- type Object
- type Options
- type Package
- type Renderer
- type ScalarValue
- type Service
- type ServiceMethod
- type Template
- type ValidatorExtension
- type ValidatorRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnchorFilter ¶
AnchorFilter replaces all special characters with URL friendly dashes
func CommandBuild ¶
CommandBuild is used to compile proto files proto-gen-doc build -o ../doc ../proto
func ExecuteCommand ¶
func NoBrFilter ¶
NoBrFilter removes single CR and LF from content.
func ParaFilter ¶
ParaFilter splits the content by new lines and wraps each one in a <para> tag.
Types ¶
type Enum ¶
type Enum struct { File *File `json:"-"` Name string `json:"name"` LongName string `json:"longName"` FullName string `json:"fullName"` Description string `json:"description"` Values []*EnumValue `json:"values"` Options Options `json:"options,omitempty"` }
Enum TODO
func (Enum) Option ¶
func (e Enum) Option(name string) *ValidatorExtension
Option returns the named option.
func (Enum) ValueOptions ¶
ValueOptions returns all options that are set on the values in this enum.
func (Enum) ValuesWithOption ¶
ValuesWithOption returns all values that have the given option set. If no single value has the option set, this returns nil.
type EnumValue ¶
type EnumValue struct { Name string `json:"name"` Number string `json:"number"` Description string `json:"description"` Options Options `json:"options,omitempty"` }
EnumValue TODO
func (EnumValue) Option ¶
func (v EnumValue) Option(name string) *ValidatorExtension
Option returns the named option.
type File ¶
type File struct { Dir string `json:"-"` Name string `json:"name"` Description string `json:"description"` Package string `json:"package"` HasEnums bool `json:"hasEnums"` HasExtensions bool `json:"hasExtensions"` HasMessages bool `json:"hasMessages"` HasServices bool `json:"hasServices"` Enums []*Enum `json:"enums"` Extensions []*FileExtension `json:"extensions"` Messages []*Message `json:"messages"` Services []*Service `json:"services"` Options Options `json:"options,omitempty"` }
File TODO
func (File) Option ¶
func (f File) Option(name string) *ValidatorExtension
Option returns the named option.
type FileExtension ¶
type FileExtension struct { File *File `json:"-"` Name string `json:"name"` LongName string `json:"longName"` FullName string `json:"fullName"` Description string `json:"description"` Label string `json:"label"` Type string `json:"type"` LongType string `json:"longType"` FullType string `json:"fullType"` Number int `json:"number"` DefaultValue string `json:"defaultValue"` ContainingType string `json:"containingType"` ContainingLongType string `json:"containingLongType"` ContainingFullType string `json:"containingFullType"` }
FileExtension contains details about top-level extensions within a proto(2) file.
type Message ¶
type Message struct { File *File `json:"-"` Name string `json:"name"` LongName string `json:"longName"` FullName string `json:"fullName"` Description string `json:"description"` HasExtensions bool `json:"hasExtensions"` HasFields bool `json:"hasFields"` HasOneofs bool `json:"hasOneofs"` Extensions []*MessageExtension `json:"extensions"` Fields []*MessageField `json:"fields"` Options Options `json:"options,omitempty"` Ismapentry bool `json:"-"` JSONObject map[string]interface{} `json:"-"` }
Message TODO
func (Message) FieldOptions ¶
FieldOptions returns all options that are set on the fields in this message.
func (Message) FieldsWithOption ¶
func (m Message) FieldsWithOption(optionName string) []*MessageField
FieldsWithOption returns all fields that have the given option set. If no single value has the option set, this returns nil.
func (Message) Option ¶
func (m Message) Option(name string) *ValidatorExtension
Option returns the named option.
type MessageExtension ¶
type MessageExtension struct { FileExtension ScopeType string `json:"scopeType"` ScopeLongType string `json:"scopeLongType"` ScopeFullType string `json:"scopeFullType"` }
MessageExtension contains details about message-scoped extensions in proto(2) files.
type MessageField ¶
type MessageField struct { Message *Message `json:"-"` Name string `json:"name"` Description string `json:"description"` Label string `json:"label"` Type string `json:"type"` LongType string `json:"longType"` FullType string `json:"fullType"` Ismap bool `json:"ismap"` Isoneof bool `json:"isoneof"` Oneofdecl string `json:"oneofdecl"` DefaultValue string `json:"defaultValue"` Options Options `json:"options,omitempty"` Done bool `json:"-"` Isarray bool `json:"-"` KeyType string `json:"-"` KeyLongType string `json:"-"` KeyFullType string `json:"-"` }
MessageField TODO
func (MessageField) Option ¶
func (f MessageField) Option(name string) *ValidatorExtension
Option returns the named option.
type Renderer ¶
type Renderer struct { ErrFile *File Packages []*Package // contains filtered or unexported fields }
Renderer TODO
type ScalarValue ¶
type ScalarValue struct { ProtoType string `json:"protoType"` Notes string `json:"notes"` CppType string `json:"cppType"` CSharp string `json:"csType"` GoType string `json:"goType"` JavaType string `json:"javaType"` PhpType string `json:"phpType"` PythonType string `json:"pythonType"` RubyType string `json:"rubyType"` }
ScalarValue contains information about scalar value types in protobuf. The common use case for this type is to know which language specific type maps to the protobuf type.
For example, the protobuf type `int64` maps to `long` in C#, and `Bignum` in Ruby. For the full list, take a look at https://developers.google.com/protocol-buffers/docs/proto3#scalar
type Service ¶
type Service struct { File *File `json:"-"` Name string `json:"name"` LongName string `json:"longName"` FullName string `json:"fullName"` Description string `json:"description"` Methods []*ServiceMethod `json:"methods"` Options Options `json:"options,omitempty"` }
Service TODO
func (Service) MethodOptions ¶
MethodOptions returns all options that are set on the methods in this service.
func (Service) MethodsWithOption ¶
func (s Service) MethodsWithOption(optionName string) []*ServiceMethod
MethodsWithOption returns all methods that have the given option set. If no single method has the option set, this returns nil.
func (Service) Option ¶
func (s Service) Option(name string) *ValidatorExtension
Option returns the named option.
type ServiceMethod ¶
type ServiceMethod struct { Service *Service `json:"-"` Name string `json:"name"` Description string `json:"description"` RequestType string `json:"requestType"` RequestLongType string `json:"requestLongType"` RequestFullType string `json:"requestFullType"` RequestStreaming bool `json:"requestStreaming"` ResponseType string `json:"responseType"` ResponseLongType string `json:"responseLongType"` ResponseFullType string `json:"responseFullType"` ResponseStreaming bool `json:"responseStreaming"` Options Options `json:"options,omitempty"` }
ServiceMethod TODO
func (ServiceMethod) Option ¶
func (m ServiceMethod) Option(name string) *ValidatorExtension
Option returns the named option.
type Template ¶
type Template struct { Files []*File `json:"files"` Scalars []*ScalarValue `json:"scalarValueTypes"` }
Template TODO
func (*Template) ParseFiles ¶
ParseFiles TODO
type ValidatorExtension ¶
type ValidatorExtension struct {
// contains filtered or unexported fields
}
ValidatorExtension TODO
type ValidatorRule ¶
type ValidatorRule struct { Name string `json:"name"` Value interface{} `json:"value"` }
ValidatorRule TODO