package
1.29.6
Repository: https://github.com/commure/api-linter.git
Documentation: pkg.go.dev

# Functions

DeclarativeFriendlyResource returns the declarative-friendly resource associated with this descriptor.
FindMessage looks for a message in a file and all imports within the same package.
FindMethod searches a file and all imports within the same package, and returns the method with a given name, or nil if none is found.
GetAllDependencies returns all dependencies.
GetFieldBehavior returns a stringset.Set of FieldBehavior annotations for the given field.
GetHTTPRules returns a slice of HTTP rules for a given method descriptor.
GetMethodSignatures returns the `google.api.method_signature` annotations.
GetOperationInfo returns the google.longrunning.operation_info annotation.
GetResource returns the google.api.resource annotation.
GetResourceDefinitions returns the google.api.resource_definition annotations for a file.
GetResourceReference returns the google.api.resource_reference annotation.
GetTypeName returns the name of the type of the field, as a string, regardless of primitive, message, etc.
IsCommonProto returns true if a proto file is considered "common".
IsDeclarativeFriendlyMessage returns true if the descriptor is declarative-friendly (if DeclarativeFriendlyResource(m) is not nil).
IsDeclarativeFriendlyMethod returns true if the method is for a declarative-friendly resource (if DeclarativeFriendlyResource(m) is not nil).
IsResource returns true if the message has a populated google.api.resource annotation with a non-empty "type" field.
IsSingletonResource returns true if the given message is a singleton resource according to its pattern.
LintFieldMask returns a problem if the field is not a singular google.protobuf.FieldMask.
LintFieldPresent returns a problem if the given message does not have the given field.
LintFieldPresentAndSingularString returns a problem if a message does not have the given singular-string field.
LintFieldResourceReference returns a problem if the field does not have a resource reference annotation.
LintHTTPMethod returns a problem for each HTTP rule whose HTTP method is not the given one.
LintHTTPURIHasNameVariable returns a problem if any of the given method's HTTP rules do not have a name variable in the URI.
LintHTTPURIHasParentVariable returns a problem if any of the given method's HTTP rules do not have a parent variable in the URI.
LintHTTPURIHasVariable returns a problem if any of the given method's HTTP rules do not have the given variable in the URI.
LintHTTPURIVariableCount returns a problem if the given method's HTTP rules do not contain the given number of variables in the URI.
LintMethodHasMatchingRequestName returns a problem if the given method's request type does not have a name matching the method's, with a "Request" suffix.
LintMethodHasMatchingResponseName returns a problem if the given method's response type does not have a name matching the method's, with a "Response" suffix.
LintNoHTTPBody returns a problem for each HTTP rule whose body is not "".
LintOutputOnlyField returns a problem if the field's behavior is not OUTPUT_ONLY.
LintRequiredField returns a problem if the field's behavior is not REQUIRED.
LintSingularBoolField returns a problem if the field is not a singular bool.
LintSingularStringField returns a problem if the field is not a singular string.
LintWildcardHTTPBody returns a problem for each HTTP rule whose body is not "*".
ToPlural converts a string to its plural form.
ToSingular converts a string to its singular form.

# Structs

HTTPRule defines a parsed, easier-to-query equivalent to `apb.HttpRule`.