Documentation ¶
Index ¶
- Constants
- Variables
- func EqualsAfterFormat(doc1, doc2 string) error
- func FormatDocument(doc *parser.Document) (string, error)
- func MustFormat(tplText string, formatter any) string
- func MustFormatAnnotation(anno *parser.Annotation, isLast bool) string
- func MustFormatAnnotations(annotations *parser.Annotations) string
- func MustFormatCPPInclude(inc *parser.CPPInclude) string
- func MustFormatComments(comments []*parser.Comment, indent string) string
- func MustFormatConst(cst *parser.Const) string
- func MustFormatConstValue(cv *parser.ConstValue) string
- func MustFormatEndLineComments(comments []*parser.Comment, indent string) string
- func MustFormatEnum(enum *parser.Enum) string
- func MustFormatEnumValue(enumValue *parser.EnumValue, indent string) string
- func MustFormatEnumValues(values []*parser.EnumValue, indent string) string
- func MustFormatException(excep *parser.Exception) string
- func MustFormatField(field *parser.Field, space string, indent string) string
- func MustFormatFieldType(ft *parser.FieldType) string
- func MustFormatFields(fields []*parser.Field, indent string) string
- func MustFormatFunction(fn *parser.Function, indent string) string
- func MustFormatFunctions(fns []*parser.Function, indent string) string
- func MustFormatIdentifier(id *parser.Identifier) string
- func MustFormatInclude(inc *parser.Include) string
- func MustFormatKeyword(kw parser.Keyword) string
- func MustFormatLiteral(l *parser.Literal) string
- func MustFormatNamespace(ns *parser.Namespace) string
- func MustFormatOneLineFields(fields []*parser.Field) string
- func MustFormatService(svc *parser.Service) string
- func MustFormatStruct(st *parser.Struct) string
- func MustFormatThrows(throws *parser.Throws) string
- func MustFormatTypeName(tn *parser.TypeName) string
- func MustFormatTypedef(td *parser.Typedef) string
- func MustFormatUnion(union *parser.Union) string
- type ConstFormatter
- type EnumFormatter
- type ExceptionFormatter
- type FunctionFormatter
- type IncludeFormatter
- type NamespaceFormatter
- type ServiceFormatter
- type StructFormatter
- type ThrowFormatter
- type TypedefFormatter
- type UnionFormatter
Constants ¶
View Source
const (
Indent = " "
)
Variables ¶
View Source
var BadNodeError = errors.New("syntax error")
Functions ¶
func EqualsAfterFormat ¶
FormatedEquals is used to judge if documents has been changed after formated implementation: ignore all space charactor to compare two strings
func MustFormat ¶
func MustFormatAnnotation ¶
func MustFormatAnnotation(anno *parser.Annotation, isLast bool) string
func MustFormatAnnotations ¶
func MustFormatAnnotations(annotations *parser.Annotations) string
func MustFormatCPPInclude ¶
func MustFormatCPPInclude(inc *parser.CPPInclude) string
func MustFormatComments ¶
TODO(jpf): 多行注释,换行上还需要优化 MustFormatComments formats comments return string doesn't include '\n' end of line
func MustFormatConst ¶
func MustFormatConstValue ¶
func MustFormatConstValue(cv *parser.ConstValue) string
func MustFormatEnum ¶
func MustFormatEnumValue ¶
TODO(jpf): comments
func MustFormatEnumValues ¶
func MustFormatException ¶
func MustFormatField ¶
func MustFormatFieldType ¶
func MustFormatIdentifier ¶
func MustFormatIdentifier(id *parser.Identifier) string
func MustFormatInclude ¶
func MustFormatKeyword ¶
func MustFormatLiteral ¶
func MustFormatNamespace ¶
func MustFormatOneLineFields ¶
func MustFormatService ¶
func MustFormatStruct ¶
func MustFormatThrows ¶
func MustFormatTypeName ¶
func MustFormatTypedef ¶
func MustFormatUnion ¶
Types ¶
type ConstFormatter ¶
type EnumFormatter ¶
type ExceptionFormatter ¶
type FunctionFormatter ¶
type IncludeFormatter ¶
type NamespaceFormatter ¶
type ServiceFormatter ¶
type StructFormatter ¶
type ThrowFormatter ¶
type TypedefFormatter ¶
Click to show internal directories.
Click to hide internal directories.