Versions in this module Expand all Collapse all v0 v0.1.0 Sep 4, 2024 Changes in this version + func CompareAnnotations(one Annotation, two Annotation) int + func CompareCategories(one Category, two Category) int + func CompareLocations(one Location, two Location) int + func CompareRules(one Rule, two Rule) int + func GetBoolValue(options Options, key string) (bool, error) + func GetBytesValue(options Options, key string) ([]byte, error) + func GetFloat64SliceValue(options Options, key string) ([]float64, error) + func GetFloat64Value(options Options, key string) (float64, error) + func GetInt64SliceValue(options Options, key string) ([]int64, error) + func GetInt64Value(options Options, key string) (int64, error) + func GetStringSliceValue(options Options, key string) ([]string, error) + func GetStringValue(options Options, key string) (string, error) + func Main(spec *Spec, options ...MainOption) + func NewCheckServiceHandler(spec *Spec, options ...CheckServiceHandlerOption) (v1pluginrpc.CheckServiceHandler, error) + func NewCheckServiceServer(checkServiceHandler v1pluginrpc.CheckServiceHandler) (pluginrpc.Server, error) + func ValidateSpec(spec *Spec) error + type AddAnnotationOption func(*addAnnotationOptions) + func WithAgainstDescriptor(againstDescriptor protoreflect.Descriptor) AddAnnotationOption + func WithAgainstFileName(againstFileName string) AddAnnotationOption + func WithAgainstFileNameAndSourcePath(againstFileName string, againstSourcePath protoreflect.SourcePath) AddAnnotationOption + func WithDescriptor(descriptor protoreflect.Descriptor) AddAnnotationOption + func WithFileName(fileName string) AddAnnotationOption + func WithFileNameAndSourcePath(fileName string, sourcePath protoreflect.SourcePath) AddAnnotationOption + func WithMessage(message string) AddAnnotationOption + func WithMessagef(format string, args ...any) AddAnnotationOption + type Annotation interface + AgainstLocation func() Location + Location func() Location + Message func() string + RuleID func() string + type Category interface + Deprecated func() bool + ID func() string + Purpose func() string + ReplacementIDs func() []string + type CategorySpec struct + Deprecated bool + ID string + Purpose string + ReplacementIDs []string + type CheckCallOption func(*checkCallOptions) + type CheckServiceHandlerOption func(*checkServiceHandlerOptions) + func CheckServiceHandlerWithParallelism(parallelism int) CheckServiceHandlerOption + type Client interface + Check func(ctx context.Context, request Request, options ...CheckCallOption) (Response, error) + ListCategories func(ctx context.Context, options ...ListCategoriesCallOption) ([]Category, error) + ListRules func(ctx context.Context, options ...ListRulesCallOption) ([]Rule, error) + func NewClient(pluginrpcClient pluginrpc.Client, options ...ClientOption) Client + func NewClientForSpec(spec *Spec, options ...ClientForSpecOption) (Client, error) + type ClientForSpecOption interface + type ClientOption interface + func ClientWithCacheRulesAndCategories() ClientOption + type File interface + FileDescriptor func() protoreflect.FileDescriptor + FileDescriptorProto func() *descriptorpb.FileDescriptorProto + IsImport func() bool + IsSyntaxUnspecified func() bool + UnusedDependencyIndexes func() []int32 + func FilesForProtoFiles(protoFiles []*checkv1.File) ([]File, error) + type ListCategoriesCallOption func(*listCategoriesCallOptions) + type ListRulesCallOption func(*listRulesCallOptions) + type Location interface + EndColumn func() int + EndLine func() int + File func() File + LeadingComments func() string + LeadingDetachedComments func() []string + SourcePath func() protoreflect.SourcePath + StartColumn func() int + StartLine func() int + TrailingComments func() string + type MainOption func(*mainOptions) + func MainWithParallelism(parallelism int) MainOption + type Options interface + Get func(key string) (any, bool) + Range func(f func(key string, value any)) + func NewOptions(keyToValue map[string]any) (Options, error) + func OptionsForProtoOptions(protoOptions []*checkv1.Option) (Options, error) + type Request interface + AgainstFiles func() []File + Files func() []File + Options func() Options + RuleIDs func() []string + func NewRequest(files []File, options ...RequestOption) (Request, error) + func RequestForProtoRequest(protoRequest *checkv1.CheckRequest) (Request, error) + type RequestOption func(*requestOptions) + func WithAgainstFiles(againstFiles []File) RequestOption + func WithOptions(options Options) RequestOption + func WithRuleIDs(ruleIDs ...string) RequestOption + type Response interface + Annotations func() []Annotation + type ResponseWriter interface + AddAnnotation func(options ...AddAnnotationOption) + type Rule interface + Categories func() []Category + Default func() bool + Deprecated func() bool + ID func() string + Purpose func() string + ReplacementIDs func() []string + Type func() RuleType + type RuleHandler interface + Handle func(ctx context.Context, responseWriter ResponseWriter, request Request) error + type RuleHandlerFunc func(context.Context, ResponseWriter, Request) error + func (r RuleHandlerFunc) Handle(ctx context.Context, responseWriter ResponseWriter, request Request) error + type RuleSpec struct + CategoryIDs []string + Default bool + Deprecated bool + Handler RuleHandler + ID string + Purpose string + ReplacementIDs []string + Type RuleType + type RuleType int + const RuleTypeBreaking + const RuleTypeLint + func (t RuleType) String() string + type Spec struct + Before func(ctx context.Context, request Request) (context.Context, Request, error) + Categories []*CategorySpec + Rules []*RuleSpec