package
0.0.0-20241217204129-3c3b82064a1e
Repository: https://github.com/aep-dev/api-linter.git
Documentation: pkg.go.dev
# Functions
DeclarativeFriendlyResource returns the declarative-friendly resource associated with this descriptor.
FindFieldDotNotation returns a field descriptor from a given message that corresponds to the dot separated path e.g.
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.
FindResource returns first resource of type matching the reference param.
FindResourceChildren attempts to search for other resources defined in the package that are parented by the given resource.
FindResourceMessage returns the message containing the first resource of type matching the resource Type name being referenced.
GetAllDependencies returns all dependencies.
GetFieldBehavior returns a stringset.Set of FieldBehavior annotations for the given field.
No description provided by the author
No description provided by the author
GetHTTPRules returns a slice of HTTP rules for a given method descriptor.
GetListResourceMessage returns the resource for a list method, nil otherwise.
GetMetadataType returns the message referred to by the (google.longrunning.operation_info).metadata_type annotation.
GetMethodSignatures returns the `google.api.method_signature` annotations.
GetOperationInfo returns the google.longrunning.operation_info annotation.
GetOperationResponseType returns the message referred to by the (google.longrunning.operation_info).response_type annotation.
GetRepeatedMessageFields returns all fields labeled `repeated` of type Message in the given message, sorted in field number order.
GetResource returns the google.api.resource annotation.
GetResourceDefinitions returns the google.api.resource_definition annotations for a file.
GetResourceMessageName returns the resource message type name from method.
GetResourceNameField is a convenience method for getting the name of the field that represents the resource's name.
GetResourcePlural is a convenience method for getting the `plural` field of a resource.
GetResourceReference returns the google.api.resource_reference annotation.
GetResourceSingular returns the resource singular.
GetResponseType returns the OutputType if the response is not an LRO, or the ResponseType otherwise.
GetTypeName returns the name of the type of the field, as a string, regardless of primitive, message, etc.
No description provided by the author
No description provided by the author
HasHTTPRules returns true when the given method descriptor is annotated with a google.api.http option.
HasResourceReference returns if the field has a google.api.resource_reference annotation.
IsCommonProto returns true if a proto file is considered "common".
IsCreateMethod returns true if this is a AEP-133 Create method.
Returns true if this is an AEP-133 Get request message, false otherwise.
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).
Returns true if this is a AEP-135 Delete method, false otherwise.
Returns true if this is an AEP-135 Delete request message, false otherwise.
IsGetMethod returns true if this is a AEP-131 Get method.
Returns true if this is an AEP-131 Get request message, false otherwise.
IsLegacyListRevisions identifies such a method by having the appropriate method name, having a `name` field instead of parent, and a HTTP suffix of `listRevisions`.
IsListMethod return true if this is an AEP-132 List method.
Return true if this is an AEP-132 List request message, false otherwise.
Return true if this is an AEP-132 List response message, false otherwise.
IsListRevisionsRequestMessage returns true if this is an AEP-162 List Revisions request message, false otherwise.
IsListRevisionsResponseMessage returns true if this is an AEP-162 List Revisions response message, false otherwise.
IsOperation returns if the message is a longrunning Operation or not.
IsResource returns true if the message has a populated google.api.resource annotation with a non-empty "type" field.
IsResourceRevision determines if the given message represents a resource revision as described in AEP-162.
IsRevisionRelationship determines if the "revision" resource is actually a revision of the "parent" resource.
IsSingletonResource returns true if the given message is a singleton resource according to its pattern.
IsStreaming returns if the method is either client or server streaming.
IsUpdateMethod returns true if this is a AEP-134 Update method.
Returns true if this is an AEP-134 Update request message, false otherwise.
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.
LintHTTPURIHasParentVariable returns a problem if any of the given method's HTTP rules do not have a parent variable in the URI.
LintHTTPURIHasPathVariable returns a problem if any of the given method's HTTP rules do not have a path 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 "".
LintNotOneof returns a problem if the field is a oneof.
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.
LintSingularField returns a problem if the field is not singular i.e.
LintSingularStringField returns a problem if the field is not a singular string.
LintWildcardHTTPBody returns a problem for each HTTP rule whose body is not "*".
Returns the name of the resource type from the response message name based on Standard List response message naming convention.
SeparateInternalComments splits the given comment block into "external" and "internal" comments based on https://google.aep.dev/192#internal-comments.
SplitResourceTypeName splits the `Resource.type` field into the service name and the resource type name.
ToKebabCase returns the kebob-case of a word (book-edition).
ToPlural converts a string to its plural form.
ToSingular converts a string to its singular form.
# Variables
VersionedSegment is a regex to extract the API version from an HTTP path.