Documentation
¶
Index ¶
- Variables
- type Annotation
- func (x *Annotation) ClearAgainstFileLocation()
- func (x *Annotation) ClearFileLocation()
- func (x *Annotation) GetAgainstFileLocation() *v1.FileLocation
- func (x *Annotation) GetFileLocation() *v1.FileLocation
- func (x *Annotation) GetMessage() string
- func (x *Annotation) GetRuleId() string
- func (x *Annotation) HasAgainstFileLocation() bool
- func (x *Annotation) HasFileLocation() bool
- func (*Annotation) ProtoMessage()
- func (x *Annotation) ProtoReflect() protoreflect.Message
- func (x *Annotation) Reset()
- func (x *Annotation) SetAgainstFileLocation(v *v1.FileLocation)
- func (x *Annotation) SetFileLocation(v *v1.FileLocation)
- func (x *Annotation) SetMessage(v string)
- func (x *Annotation) SetRuleId(v string)
- func (x *Annotation) String() string
- type Annotation_builder
- type Category
- func (x *Category) GetDeprecated() bool
- func (x *Category) GetId() string
- func (x *Category) GetPurpose() string
- func (x *Category) GetReplacementIds() []string
- func (*Category) ProtoMessage()
- func (x *Category) ProtoReflect() protoreflect.Message
- func (x *Category) Reset()
- func (x *Category) SetDeprecated(v bool)
- func (x *Category) SetId(v string)
- func (x *Category) SetPurpose(v string)
- func (x *Category) SetReplacementIds(v []string)
- func (x *Category) String() string
- type Category_builder
- type CheckRequest
- func (x *CheckRequest) GetAgainstFileDescriptors() []*v1.FileDescriptor
- func (x *CheckRequest) GetFileDescriptors() []*v1.FileDescriptor
- func (x *CheckRequest) GetOptions() []*v11.Option
- func (x *CheckRequest) GetRuleIds() []string
- func (*CheckRequest) ProtoMessage()
- func (x *CheckRequest) ProtoReflect() protoreflect.Message
- func (x *CheckRequest) Reset()
- func (x *CheckRequest) SetAgainstFileDescriptors(v []*v1.FileDescriptor)
- func (x *CheckRequest) SetFileDescriptors(v []*v1.FileDescriptor)
- func (x *CheckRequest) SetOptions(v []*v11.Option)
- func (x *CheckRequest) SetRuleIds(v []string)
- func (x *CheckRequest) String() string
- type CheckRequest_builder
- type CheckResponse
- type CheckResponse_builder
- type ListCategoriesRequest
- func (x *ListCategoriesRequest) GetPageSize() uint32
- func (x *ListCategoriesRequest) GetPageToken() string
- func (*ListCategoriesRequest) ProtoMessage()
- func (x *ListCategoriesRequest) ProtoReflect() protoreflect.Message
- func (x *ListCategoriesRequest) Reset()
- func (x *ListCategoriesRequest) SetPageSize(v uint32)
- func (x *ListCategoriesRequest) SetPageToken(v string)
- func (x *ListCategoriesRequest) String() string
- type ListCategoriesRequest_builder
- type ListCategoriesResponse
- func (x *ListCategoriesResponse) GetCategories() []*Category
- func (x *ListCategoriesResponse) GetNextPageToken() string
- func (*ListCategoriesResponse) ProtoMessage()
- func (x *ListCategoriesResponse) ProtoReflect() protoreflect.Message
- func (x *ListCategoriesResponse) Reset()
- func (x *ListCategoriesResponse) SetCategories(v []*Category)
- func (x *ListCategoriesResponse) SetNextPageToken(v string)
- func (x *ListCategoriesResponse) String() string
- type ListCategoriesResponse_builder
- type ListRulesRequest
- func (x *ListRulesRequest) GetPageSize() uint32
- func (x *ListRulesRequest) GetPageToken() string
- func (*ListRulesRequest) ProtoMessage()
- func (x *ListRulesRequest) ProtoReflect() protoreflect.Message
- func (x *ListRulesRequest) Reset()
- func (x *ListRulesRequest) SetPageSize(v uint32)
- func (x *ListRulesRequest) SetPageToken(v string)
- func (x *ListRulesRequest) String() string
- type ListRulesRequest_builder
- type ListRulesResponse
- func (x *ListRulesResponse) GetNextPageToken() string
- func (x *ListRulesResponse) GetRules() []*Rule
- func (*ListRulesResponse) ProtoMessage()
- func (x *ListRulesResponse) ProtoReflect() protoreflect.Message
- func (x *ListRulesResponse) Reset()
- func (x *ListRulesResponse) SetNextPageToken(v string)
- func (x *ListRulesResponse) SetRules(v []*Rule)
- func (x *ListRulesResponse) String() string
- type ListRulesResponse_builder
- type Rule
- func (x *Rule) GetCategoryIds() []string
- func (x *Rule) GetDefault() bool
- func (x *Rule) GetDeprecated() bool
- func (x *Rule) GetId() string
- func (x *Rule) GetPurpose() string
- func (x *Rule) GetReplacementIds() []string
- func (x *Rule) GetType() RuleType
- func (*Rule) ProtoMessage()
- func (x *Rule) ProtoReflect() protoreflect.Message
- func (x *Rule) Reset()
- func (x *Rule) SetCategoryIds(v []string)
- func (x *Rule) SetDefault(v bool)
- func (x *Rule) SetDeprecated(v bool)
- func (x *Rule) SetId(v string)
- func (x *Rule) SetPurpose(v string)
- func (x *Rule) SetReplacementIds(v []string)
- func (x *Rule) SetType(v RuleType)
- func (x *Rule) String() string
- type RuleType
- type Rule_builder
Constants ¶
This section is empty.
Variables ¶
var ( RuleType_name = map[int32]string{ 0: "RULE_TYPE_UNSPECIFIED", 1: "RULE_TYPE_LINT", 2: "RULE_TYPE_BREAKING", } RuleType_value = map[string]int32{ "RULE_TYPE_UNSPECIFIED": 0, "RULE_TYPE_LINT": 1, "RULE_TYPE_BREAKING": 2, } )
Enum value maps for RuleType.
var File_buf_plugin_check_v1_annotation_proto protoreflect.FileDescriptor
var File_buf_plugin_check_v1_category_proto protoreflect.FileDescriptor
var File_buf_plugin_check_v1_check_proto protoreflect.FileDescriptor
var File_buf_plugin_check_v1_check_service_proto protoreflect.FileDescriptor
var File_buf_plugin_check_v1_rule_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation struct {
// The ID of the Rule that failed.
//
// Required.
//
// This must match an ID that the plugin has declared via its list rules RPC.
RuleId string `protobuf:"bytes,1,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"`
// A user-displayable message that explains the rule failure.
//
// Optional.
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
// The location of the failure in a FileDescriptor within the file_descriptors list.
//
// Optional.
FileLocation *v1.FileLocation `protobuf:"bytes,3,opt,name=file_location,json=fileLocation,proto3" json:"file_location,omitempty"`
// The location of the failure in a FileDescriptor in the against_file_descriptors list.
//
// Optional.
//
// This may be present even if file_location is not present. For example, if a file was deleted,
// this may reference the deleted FileDescriptor in against_file_descriptors, while file_location
// will not be present.
AgainstFileLocation *v1.FileLocation `protobuf:"bytes,4,opt,name=against_file_location,json=againstFileLocation,proto3" json:"against_file_location,omitempty"`
// contains filtered or unexported fields
}
An annotation representing a Rule failure.
Annotations are propagated back to Buf and returned as lint or breaking change failures.
func (*Annotation) ClearAgainstFileLocation ¶
func (x *Annotation) ClearAgainstFileLocation()
func (*Annotation) ClearFileLocation ¶
func (x *Annotation) ClearFileLocation()
func (*Annotation) GetAgainstFileLocation ¶
func (x *Annotation) GetAgainstFileLocation() *v1.FileLocation
func (*Annotation) GetFileLocation ¶
func (x *Annotation) GetFileLocation() *v1.FileLocation
func (*Annotation) GetMessage ¶
func (x *Annotation) GetMessage() string
func (*Annotation) GetRuleId ¶
func (x *Annotation) GetRuleId() string
func (*Annotation) HasAgainstFileLocation ¶
func (x *Annotation) HasAgainstFileLocation() bool
func (*Annotation) HasFileLocation ¶
func (x *Annotation) HasFileLocation() bool
func (*Annotation) ProtoMessage ¶
func (*Annotation) ProtoMessage()
func (*Annotation) ProtoReflect ¶
func (x *Annotation) ProtoReflect() protoreflect.Message
func (*Annotation) Reset ¶
func (x *Annotation) Reset()
func (*Annotation) SetAgainstFileLocation ¶
func (x *Annotation) SetAgainstFileLocation(v *v1.FileLocation)
func (*Annotation) SetFileLocation ¶
func (x *Annotation) SetFileLocation(v *v1.FileLocation)
func (*Annotation) SetMessage ¶
func (x *Annotation) SetMessage(v string)
func (*Annotation) SetRuleId ¶
func (x *Annotation) SetRuleId(v string)
func (*Annotation) String ¶
func (x *Annotation) String() string
type Annotation_builder ¶
type Annotation_builder struct {
// The ID of the Rule that failed.
//
// Required.
//
// This must match an ID that the plugin has declared via its list rules RPC.
RuleId string
// A user-displayable message that explains the rule failure.
//
// Optional.
Message string
// The location of the failure in a FileDescriptor within the file_descriptors list.
//
// Optional.
FileLocation *v1.FileLocation
// The location of the failure in a FileDescriptor in the against_file_descriptors list.
//
// Optional.
//
// This may be present even if file_location is not present. For example, if a file was deleted,
// this may reference the deleted FileDescriptor in against_file_descriptors, while file_location
// will not be present.
AgainstFileLocation *v1.FileLocation
// contains filtered or unexported fields
}
func (Annotation_builder) Build ¶
func (b0 Annotation_builder) Build() *Annotation
type Category ¶
type Category struct {
// The ID of the category.
//
// Required.
//
// This uniquely identifies the Category.
//
// Category IDs must also be unique relative to Rule IDs.
//
// Rule and Category IDs must be unique across all plugins used at the same time with
// Buf. That is, no two plugins can both publish the same Rule or Category ID.
//
// This must have at least three characters.
// This must start and end with a capital letter from A-Z or digits from 0-9, and only
// consist of capital letters from A-Z, digits from 0-0, and underscores.
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// A user-displayable purpose of the category.
//
// Required.
//
// This should be a proper sentence that starts with a capital letter and ends in a period.
Purpose string `protobuf:"bytes,2,opt,name=purpose,proto3" json:"purpose,omitempty"`
// Whether or not this Category is deprecated.
//
// If the Category is deprecated, it may be replaced by 0 or more Categories. These will be
// denoted by replacement_ids.
Deprecated bool `protobuf:"varint,3,opt,name=deprecated,proto3" json:"deprecated,omitempty"`
// The IDs of the Categories that replace this Category, if this Category is deprecated.
//
// This means that the combination of the Categories specified by replacement_ids replace this
// Category entirely, and this Category is considered equivalent to the AND of the categories
// specified by replacement_ids.
//
// This will only be non-empty if deprecated is true.
// This may be empty even if deprecated is true.
//
// It is not valid for a deprecated Category to specfiy another deprecated Category as a
// replacement.
ReplacementIds []string `protobuf:"bytes,4,rep,name=replacement_ids,json=replacementIds,proto3" json:"replacement_ids,omitempty"`
// contains filtered or unexported fields
}
A category that a CheckService implements.
Buf uses categories to include or exclude sets of rules via configuration.
func (*Category) ProtoReflect ¶
func (x *Category) ProtoReflect() protoreflect.Message
type Category_builder ¶
type Category_builder struct {
// The ID of the category.
//
// Required.
//
// This uniquely identifies the Category.
//
// Category IDs must also be unique relative to Rule IDs.
//
// Rule and Category IDs must be unique across all plugins used at the same time with
// Buf. That is, no two plugins can both publish the same Rule or Category ID.
//
// This must have at least three characters.
// This must start and end with a capital letter from A-Z or digits from 0-9, and only
// consist of capital letters from A-Z, digits from 0-0, and underscores.
Id string
// A user-displayable purpose of the category.
//
// Required.
//
// This should be a proper sentence that starts with a capital letter and ends in a period.
Purpose string
// Whether or not this Category is deprecated.
//
// If the Category is deprecated, it may be replaced by 0 or more Categories. These will be
// denoted by replacement_ids.
Deprecated bool
// The IDs of the Categories that replace this Category, if this Category is deprecated.
//
// This means that the combination of the Categories specified by replacement_ids replace this
// Category entirely, and this Category is considered equivalent to the AND of the categories
// specified by replacement_ids.
//
// This will only be non-empty if deprecated is true.
// This may be empty even if deprecated is true.
//
// It is not valid for a deprecated Category to specfiy another deprecated Category as a
// replacement.
ReplacementIds []string
// contains filtered or unexported fields
}
func (Category_builder) Build ¶
func (b0 Category_builder) Build() *Category
type CheckRequest ¶
type CheckRequest struct {
// The FileDescriptors to check.
//
// Required.
//
// FileDescriptors are guaranteed to be unique by file_descriptor_proto.name.
FileDescriptors []*v1.FileDescriptor `protobuf:"bytes,1,rep,name=file_descriptors,json=fileDescriptors,proto3" json:"file_descriptors,omitempty"`
// The FileDescriptors to check against.
//
// Optional.
//
// This is usually the state of the FileDescriptors at a previous VCS commit, or the state of
// the FileDescriptors at a release tag.
//
// FileDescriptors are guaranteed to be unique by file_descriptor_proto.name.
//
// Note that this may be empty, even for breaking change checks, to account for
// going from the empty state to the first set of FileDescriptors.
AgainstFileDescriptors []*v1.FileDescriptor `` /* 129-byte string literal not displayed */
// Options for the Rules.
//
// Optional.
//
// Options may modify the behavior of a Rule.
//
// For now, callers are expected to know what keys are available, and how to construct Values
// for each key. In the future, we may add a ListOptions or otherwise to CheckService that will
// describe the available options keys, which can then be validated against.
//
// It is acceptable for a plugin to return an error on an unknown or misconstructed Option.
Options []*v11.Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"`
// The IDs of the Rules to check.
//
// Optional. If not specified, all Rules returned by ListRules are checked.
//
// The maximum number of Rule IDs that can be sent in a single request is 250; if there are more
// Rules that should be run, you must make multiple calls to Check.
//
// All IDs must be be IDs of Rules returned by ListRules.
RuleIds []string `protobuf:"bytes,4,rep,name=rule_ids,json=ruleIds,proto3" json:"rule_ids,omitempty"`
// contains filtered or unexported fields
}
A request to check FileDescriptors.
func (*CheckRequest) GetAgainstFileDescriptors ¶
func (x *CheckRequest) GetAgainstFileDescriptors() []*v1.FileDescriptor
func (*CheckRequest) GetFileDescriptors ¶
func (x *CheckRequest) GetFileDescriptors() []*v1.FileDescriptor
func (*CheckRequest) GetOptions ¶
func (x *CheckRequest) GetOptions() []*v11.Option
func (*CheckRequest) GetRuleIds ¶
func (x *CheckRequest) GetRuleIds() []string
func (*CheckRequest) ProtoMessage ¶
func (*CheckRequest) ProtoMessage()
func (*CheckRequest) ProtoReflect ¶
func (x *CheckRequest) ProtoReflect() protoreflect.Message
func (*CheckRequest) Reset ¶
func (x *CheckRequest) Reset()
func (*CheckRequest) SetAgainstFileDescriptors ¶
func (x *CheckRequest) SetAgainstFileDescriptors(v []*v1.FileDescriptor)
func (*CheckRequest) SetFileDescriptors ¶
func (x *CheckRequest) SetFileDescriptors(v []*v1.FileDescriptor)
func (*CheckRequest) SetOptions ¶
func (x *CheckRequest) SetOptions(v []*v11.Option)
func (*CheckRequest) SetRuleIds ¶
func (x *CheckRequest) SetRuleIds(v []string)
func (*CheckRequest) String ¶
func (x *CheckRequest) String() string
type CheckRequest_builder ¶
type CheckRequest_builder struct {
// The FileDescriptors to check.
//
// Required.
//
// FileDescriptors are guaranteed to be unique by file_descriptor_proto.name.
FileDescriptors []*v1.FileDescriptor
// The FileDescriptors to check against.
//
// Optional.
//
// This is usually the state of the FileDescriptors at a previous VCS commit, or the state of
// the FileDescriptors at a release tag.
//
// FileDescriptors are guaranteed to be unique by file_descriptor_proto.name.
//
// Note that this may be empty, even for breaking change checks, to account for
// going from the empty state to the first set of FileDescriptors.
AgainstFileDescriptors []*v1.FileDescriptor
// Options for the Rules.
//
// Optional.
//
// Options may modify the behavior of a Rule.
//
// For now, callers are expected to know what keys are available, and how to construct Values
// for each key. In the future, we may add a ListOptions or otherwise to CheckService that will
// describe the available options keys, which can then be validated against.
//
// It is acceptable for a plugin to return an error on an unknown or misconstructed Option.
Options []*v11.Option
// The IDs of the Rules to check.
//
// Optional. If not specified, all Rules returned by ListRules are checked.
//
// The maximum number of Rule IDs that can be sent in a single request is 250; if there are more
// Rules that should be run, you must make multiple calls to Check.
//
// All IDs must be be IDs of Rules returned by ListRules.
RuleIds []string
// contains filtered or unexported fields
}
func (CheckRequest_builder) Build ¶
func (b0 CheckRequest_builder) Build() *CheckRequest
type CheckResponse ¶
type CheckResponse struct {
// The annotations produced from Rule failures.
//
// All Annotations must have IDs that match the IDs of the Rules returned by ListRules.
Annotations []*Annotation `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"`
// contains filtered or unexported fields
}
A response containing annotations that the check returned from failures.
func (*CheckResponse) GetAnnotations ¶
func (x *CheckResponse) GetAnnotations() []*Annotation
func (*CheckResponse) ProtoMessage ¶
func (*CheckResponse) ProtoMessage()
func (*CheckResponse) ProtoReflect ¶
func (x *CheckResponse) ProtoReflect() protoreflect.Message
func (*CheckResponse) Reset ¶
func (x *CheckResponse) Reset()
func (*CheckResponse) SetAnnotations ¶
func (x *CheckResponse) SetAnnotations(v []*Annotation)
func (*CheckResponse) String ¶
func (x *CheckResponse) String() string
type CheckResponse_builder ¶
type CheckResponse_builder struct {
// The annotations produced from Rule failures.
//
// All Annotations must have IDs that match the IDs of the Rules returned by ListRules.
Annotations []*Annotation
// contains filtered or unexported fields
}
func (CheckResponse_builder) Build ¶
func (b0 CheckResponse_builder) Build() *CheckResponse
type ListCategoriesRequest ¶
type ListCategoriesRequest struct {
// The maximum number of items to return.
//
// The default value is 250.
PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// The page to start from.
//
// If empty, the first page is returned,
PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// contains filtered or unexported fields
}
A request for the categories that the service implements.
func (*ListCategoriesRequest) GetPageSize ¶
func (x *ListCategoriesRequest) GetPageSize() uint32
func (*ListCategoriesRequest) GetPageToken ¶
func (x *ListCategoriesRequest) GetPageToken() string
func (*ListCategoriesRequest) ProtoMessage ¶
func (*ListCategoriesRequest) ProtoMessage()
func (*ListCategoriesRequest) ProtoReflect ¶
func (x *ListCategoriesRequest) ProtoReflect() protoreflect.Message
func (*ListCategoriesRequest) Reset ¶
func (x *ListCategoriesRequest) Reset()
func (*ListCategoriesRequest) SetPageSize ¶
func (x *ListCategoriesRequest) SetPageSize(v uint32)
func (*ListCategoriesRequest) SetPageToken ¶
func (x *ListCategoriesRequest) SetPageToken(v string)
func (*ListCategoriesRequest) String ¶
func (x *ListCategoriesRequest) String() string
type ListCategoriesRequest_builder ¶
type ListCategoriesRequest_builder struct {
// The maximum number of items to return.
//
// The default value is 250.
PageSize uint32
// The page to start from.
//
// If empty, the first page is returned,
PageToken string
// contains filtered or unexported fields
}
func (ListCategoriesRequest_builder) Build ¶
func (b0 ListCategoriesRequest_builder) Build() *ListCategoriesRequest
type ListCategoriesResponse ¶
type ListCategoriesResponse struct {
// The next page token.
//
// If empty, there are no more pages.
NextPageToken string `protobuf:"bytes,1,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
// The categories that the service implements.
//
// The IDs of all Categories returned will be unique.
// The IDs will also be unique relative to the Rule IDs returned from ListRules.
//
// Rules will only have Category IDs that are also returned from ListCategories, and every
// Category returned from ListCategories will have at least one Rule with its Category ID.
//
// It is invalid for Check to respond with an Annotation that has an ID which
// is not also the ID of a Category within this list.
Categories []*Category `protobuf:"bytes,2,rep,name=categories,proto3" json:"categories,omitempty"`
// contains filtered or unexported fields
}
A response containing the categories that the service implements.
func (*ListCategoriesResponse) GetCategories ¶
func (x *ListCategoriesResponse) GetCategories() []*Category
func (*ListCategoriesResponse) GetNextPageToken ¶
func (x *ListCategoriesResponse) GetNextPageToken() string
func (*ListCategoriesResponse) ProtoMessage ¶
func (*ListCategoriesResponse) ProtoMessage()
func (*ListCategoriesResponse) ProtoReflect ¶
func (x *ListCategoriesResponse) ProtoReflect() protoreflect.Message
func (*ListCategoriesResponse) Reset ¶
func (x *ListCategoriesResponse) Reset()
func (*ListCategoriesResponse) SetCategories ¶
func (x *ListCategoriesResponse) SetCategories(v []*Category)
func (*ListCategoriesResponse) SetNextPageToken ¶
func (x *ListCategoriesResponse) SetNextPageToken(v string)
func (*ListCategoriesResponse) String ¶
func (x *ListCategoriesResponse) String() string
type ListCategoriesResponse_builder ¶
type ListCategoriesResponse_builder struct {
// The next page token.
//
// If empty, there are no more pages.
NextPageToken string
// The categories that the service implements.
//
// The IDs of all Categories returned will be unique.
// The IDs will also be unique relative to the Rule IDs returned from ListRules.
//
// Rules will only have Category IDs that are also returned from ListCategories, and every
// Category returned from ListCategories will have at least one Rule with its Category ID.
//
// It is invalid for Check to respond with an Annotation that has an ID which
// is not also the ID of a Category within this list.
Categories []*Category
// contains filtered or unexported fields
}
func (ListCategoriesResponse_builder) Build ¶
func (b0 ListCategoriesResponse_builder) Build() *ListCategoriesResponse
type ListRulesRequest ¶
type ListRulesRequest struct {
// The maximum number of items to return.
//
// The default value is 250.
PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// The page to start from.
//
// If empty, the first page is returned,
PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// contains filtered or unexported fields
}
A request for the rules that the service implements.
func (*ListRulesRequest) GetPageSize ¶
func (x *ListRulesRequest) GetPageSize() uint32
func (*ListRulesRequest) GetPageToken ¶
func (x *ListRulesRequest) GetPageToken() string
func (*ListRulesRequest) ProtoMessage ¶
func (*ListRulesRequest) ProtoMessage()
func (*ListRulesRequest) ProtoReflect ¶
func (x *ListRulesRequest) ProtoReflect() protoreflect.Message
func (*ListRulesRequest) Reset ¶
func (x *ListRulesRequest) Reset()
func (*ListRulesRequest) SetPageSize ¶
func (x *ListRulesRequest) SetPageSize(v uint32)
func (*ListRulesRequest) SetPageToken ¶
func (x *ListRulesRequest) SetPageToken(v string)
func (*ListRulesRequest) String ¶
func (x *ListRulesRequest) String() string
type ListRulesRequest_builder ¶
type ListRulesRequest_builder struct {
// The maximum number of items to return.
//
// The default value is 250.
PageSize uint32
// The page to start from.
//
// If empty, the first page is returned,
PageToken string
// contains filtered or unexported fields
}
func (ListRulesRequest_builder) Build ¶
func (b0 ListRulesRequest_builder) Build() *ListRulesRequest
type ListRulesResponse ¶
type ListRulesResponse struct {
// The next page token.
//
// If empty, there are no more pages.
NextPageToken string `protobuf:"bytes,1,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
// The rules that the service implements.
//
// The IDs of all Rules returned will be unique.
// The IDs will also be unique relative to the Category IDs returned from ListCategories.
//
// Rules will only have Category IDs that are also returned from ListCategories, and every
// Category returned from ListCategories will have at least one Rule with its Category ID.
//
// It is invalid for Check to respond with an Annotation that has an ID which
// is not also the ID of a Rule within this list.
Rules []*Rule `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"`
// contains filtered or unexported fields
}
A response containing the rules that the service implements.
func (*ListRulesResponse) GetNextPageToken ¶
func (x *ListRulesResponse) GetNextPageToken() string
func (*ListRulesResponse) GetRules ¶
func (x *ListRulesResponse) GetRules() []*Rule
func (*ListRulesResponse) ProtoMessage ¶
func (*ListRulesResponse) ProtoMessage()
func (*ListRulesResponse) ProtoReflect ¶
func (x *ListRulesResponse) ProtoReflect() protoreflect.Message
func (*ListRulesResponse) Reset ¶
func (x *ListRulesResponse) Reset()
func (*ListRulesResponse) SetNextPageToken ¶
func (x *ListRulesResponse) SetNextPageToken(v string)
func (*ListRulesResponse) SetRules ¶
func (x *ListRulesResponse) SetRules(v []*Rule)
func (*ListRulesResponse) String ¶
func (x *ListRulesResponse) String() string
type ListRulesResponse_builder ¶
type ListRulesResponse_builder struct {
// The next page token.
//
// If empty, there are no more pages.
NextPageToken string
// The rules that the service implements.
//
// The IDs of all Rules returned will be unique.
// The IDs will also be unique relative to the Category IDs returned from ListCategories.
//
// Rules will only have Category IDs that are also returned from ListCategories, and every
// Category returned from ListCategories will have at least one Rule with its Category ID.
//
// It is invalid for Check to respond with an Annotation that has an ID which
// is not also the ID of a Rule within this list.
Rules []*Rule
// contains filtered or unexported fields
}
func (ListRulesResponse_builder) Build ¶
func (b0 ListRulesResponse_builder) Build() *ListRulesResponse
type Rule ¶
type Rule struct {
// Rule IDs must also be unique relative to Category IDs.
//
// Rule and Category IDs must be unique across all plugins used at the same time with
// Buf. That is, no two plugins can both publish the same Rule or Category ID.
//
// This must have at least three characters.
// This must start and end with a capital letter from A-Z or digits from 0-9, and only
// consist of capital letters from A-Z, digits from 0-0, and underscores.
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// The IDs of the categories that the Rule is a part of.
//
// Buf uses categories to include or exclude sets of rules via configuration.
//
// Optional.
//
// The constraints for category IDs are the same as Rule IDs.
CategoryIds []string `protobuf:"bytes,2,rep,name=category_ids,json=categoryIds,proto3" json:"category_ids,omitempty"`
// Whether the Rule will be called by default if no Rule IDs are specified on a Check request.
//
// A deprecated Rule can never be a default Rule.
Default bool `protobuf:"varint,3,opt,name=default,proto3" json:"default,omitempty"`
// A user-displayable purpose of the rule.
//
// Required.
//
// This should be a proper sentence that starts with a capital letter and ends in a period.
Purpose string `protobuf:"bytes,4,opt,name=purpose,proto3" json:"purpose,omitempty"`
// The type of the rule.
//
// Required.
Type RuleType `protobuf:"varint,5,opt,name=type,proto3,enum=buf.plugin.check.v1.RuleType" json:"type,omitempty"`
// Whether or not this Rule is deprecated.
//
// If the Rule is deprecated, it may be replaced by 0 or more Rules. These will be denoted
// by replacement_ids.
Deprecated bool `protobuf:"varint,6,opt,name=deprecated,proto3" json:"deprecated,omitempty"`
// The IDs of the Rules that replace this Rule, if this Rule is deprecated.
//
// This means that the combination of the Rules specified by replacement_ids replace this Rule entirely,
// and this Rule is considered equivalent to the AND of the rules specified by replacement_ids.
//
// This will only be non-empty if deprecated is true.
// This may be empty even if deprecated is true.
//
// It is not valid for a deprecated Rule to specfiy another deprecated Rule as a replacement.
ReplacementIds []string `protobuf:"bytes,7,rep,name=replacement_ids,json=replacementIds,proto3" json:"replacement_ids,omitempty"`
// contains filtered or unexported fields
}
A rule that a CheckService implements.
func (*Rule) ProtoReflect ¶
func (x *Rule) ProtoReflect() protoreflect.Message
type RuleType ¶
type RuleType int32
The type of the Rule.
Currently, there are only two types of rules: lint rules, and breaking change rules. Breaking change rules require FileDescriptors to check against; if the Rule ID of a breaking change Rule is specified in a Check call, then against_file_descriptors are required.
func (RuleType) Descriptor ¶
func (RuleType) Descriptor() protoreflect.EnumDescriptor
func (RuleType) Number ¶
func (x RuleType) Number() protoreflect.EnumNumber
func (RuleType) Type ¶
func (RuleType) Type() protoreflect.EnumType
type Rule_builder ¶
type Rule_builder struct {
// Rule IDs must also be unique relative to Category IDs.
//
// Rule and Category IDs must be unique across all plugins used at the same time with
// Buf. That is, no two plugins can both publish the same Rule or Category ID.
//
// This must have at least three characters.
// This must start and end with a capital letter from A-Z or digits from 0-9, and only
// consist of capital letters from A-Z, digits from 0-0, and underscores.
Id string
// The IDs of the categories that the Rule is a part of.
//
// Buf uses categories to include or exclude sets of rules via configuration.
//
// Optional.
//
// The constraints for category IDs are the same as Rule IDs.
CategoryIds []string
// Whether the Rule will be called by default if no Rule IDs are specified on a Check request.
//
// A deprecated Rule can never be a default Rule.
Default bool
// A user-displayable purpose of the rule.
//
// Required.
//
// This should be a proper sentence that starts with a capital letter and ends in a period.
Purpose string
// The type of the rule.
//
// Required.
Type RuleType
// Whether or not this Rule is deprecated.
//
// If the Rule is deprecated, it may be replaced by 0 or more Rules. These will be denoted
// by replacement_ids.
Deprecated bool
// The IDs of the Rules that replace this Rule, if this Rule is deprecated.
//
// This means that the combination of the Rules specified by replacement_ids replace this Rule entirely,
// and this Rule is considered equivalent to the AND of the rules specified by replacement_ids.
//
// This will only be non-empty if deprecated is true.
// This may be empty even if deprecated is true.
//
// It is not valid for a deprecated Rule to specfiy another deprecated Rule as a replacement.
ReplacementIds []string
// contains filtered or unexported fields
}
func (Rule_builder) Build ¶
func (b0 Rule_builder) Build() *Rule
Source Files
¶
- annotation.pb.go
- category.pb.go
- check.pb.go
- check_service.pb.go
- rule.pb.go