Documentation ¶
Overview ¶
Package analyzer scanning source code and returns result of the scanning. Searches interfaces as a rpc description and returns list of the methods.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrGoSyntax returns when parsed packages contains errors. ErrGoSyntax = errors.New("go syntax") // ErrWrongNumberPackages returns when analyzer got unexpected number of packeges. ErrWrongNumberPackages = errors.New("wrong number of packages") // ErrProblemWithService returns when package not contains type with service methods or has some problems. ErrProblemWithService = errors.New("problem with service type") // ErrInvalidData generic error returns when we got unexpected data. ErrInvalidData = errors.New("invalid data") // ErrFieldSkippedByTag field should be skipped in json parser. ErrFieldSkippedByTag = errors.New("field skipped by tag") // ErrNotEnumType named type is not an enum type. ErrNotEnumType = errors.New("not enum type") // ErrMagicMethodSetErrorData error for magic method to set error data model. ErrMagicMethodSetErrorData = errors.New("magic method setErrorData") )
Functions ¶
func JoinComments ¶
func JoinComments(comments ...*ast.CommentGroup) string
JoinComments joins some groups of comments.
Types ¶
type Analyzer ¶
type Analyzer struct {
// contains filtered or unexported fields
}
Analyzer contains method to scan source code.
type FieldTag ¶
type FieldTag struct { Name string // JSON tag's name or origin field's name. SwaggerKind model.ArgumentKind // Type of the swagger. IsSkipped bool // The fields should be skipped in swagger spec. IsOptional bool // The field has the omitempty tag. IsDeprecated bool // The field has deprecated mark in the tag. }
FieldTag represents parsed field's tag.
type KnownType ¶ added in v0.2.0
type KnownType struct { BasicType string `json:"basic_type"` Format string `json:"format,omitempty"` }
KnownType describes type with data of the basic type and optional format.
type KnownTypesFile ¶ added in v0.2.0
KnownTypesFile describes file with known types. map["package.Type"] => {BasicType: "string", Format: "date-time"}.
type MagicCommentParams ¶
MagicCommentParams parsed magic comments.
func ParseMagicComments ¶
func ParseMagicComments(doc *ast.CommentGroup) (*MagicCommentParams, error)
ParseMagicComments returns parameter from magic comment of the genpjrpc comment.
Click to show internal directories.
Click to hide internal directories.