scopechecker

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopesCheckerService_ScopeCheck_FullMethodName = "/veidemann.api.scopechecker.v1.ScopesCheckerService/ScopeCheck"
)

Variables

View Source
var (
	ScopeCheckResponse_Evaluation_name = map[int32]string{
		0: "INCLUDE",
		1: "EXCLUDE",
	}
	ScopeCheckResponse_Evaluation_value = map[string]int32{
		"INCLUDE": 0,
		"EXCLUDE": 1,
	}
)

Enum value maps for ScopeCheckResponse_Evaluation.

View Source
var File_scopechecker_v1_scopechecker_proto protoreflect.FileDescriptor
View Source
var ScopesCheckerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "veidemann.api.scopechecker.v1.ScopesCheckerService",
	HandlerType: (*ScopesCheckerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ScopeCheck",
			Handler:    _ScopesCheckerService_ScopeCheck_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "scopechecker/v1/scopechecker.proto",
}

ScopesCheckerService_ServiceDesc is the grpc.ServiceDesc for ScopesCheckerService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterScopesCheckerServiceServer

func RegisterScopesCheckerServiceServer(s grpc.ServiceRegistrar, srv ScopesCheckerServiceServer)

Types

type ScopeCheckRequest

type ScopeCheckRequest struct {

	// The uri to validate.
	// The type QueuedUri includes all the context needed to do scope check
	QueuedUri *frontier.QueuedUri `protobuf:"bytes,1,opt,name=queued_uri,json=queuedUri,proto3" json:"queued_uri,omitempty"`
	// Name of script. Used for logging.
	ScopeScriptName string `protobuf:"bytes,2,opt,name=scope_script_name,json=scopeScriptName,proto3" json:"scope_script_name,omitempty"`
	// The Script to evaluate.
	ScopeScript string `protobuf:"bytes,3,opt,name=scope_script,json=scopeScript,proto3" json:"scope_script,omitempty"`
	// Turn on debug messages
	Debug bool `protobuf:"varint,4,opt,name=debug,proto3" json:"debug,omitempty"`
	// contains filtered or unexported fields
}

func (*ScopeCheckRequest) Descriptor deprecated

func (*ScopeCheckRequest) Descriptor() ([]byte, []int)

Deprecated: Use ScopeCheckRequest.ProtoReflect.Descriptor instead.

func (*ScopeCheckRequest) GetDebug

func (x *ScopeCheckRequest) GetDebug() bool

func (*ScopeCheckRequest) GetQueuedUri

func (x *ScopeCheckRequest) GetQueuedUri() *frontier.QueuedUri

func (*ScopeCheckRequest) GetScopeScript

func (x *ScopeCheckRequest) GetScopeScript() string

func (*ScopeCheckRequest) GetScopeScriptName

func (x *ScopeCheckRequest) GetScopeScriptName() string

func (*ScopeCheckRequest) ProtoMessage

func (*ScopeCheckRequest) ProtoMessage()

func (*ScopeCheckRequest) ProtoReflect

func (x *ScopeCheckRequest) ProtoReflect() protoreflect.Message

func (*ScopeCheckRequest) Reset

func (x *ScopeCheckRequest) Reset()

func (*ScopeCheckRequest) String

func (x *ScopeCheckRequest) String() string

type ScopeCheckResponse

type ScopeCheckResponse struct {

	// The outcome of the scope evaluation
	Evaluation ScopeCheckResponse_Evaluation `` /* 139-byte string literal not displayed */
	// Heritrix status code indicating reason for exclude.
	// Most relevant reasons are:
	//   - -5 RUNTIME_EXCEPTION           Unexpected runtime exception.
	//   - -7 ILLEGAL_URI                 URI recognized as unsupported or illegal.
	//   - -4000 CHAFF_DETECTION             Chaff detection of traps/content with negligible value applied.
	//   - -4001 TOO_MANY_HOPS               The URI is too many link hops away from the seed.
	//   - -4002 TOO_MANY_TRANSITIVE_HOPS    The URI is too many embed/transitive hops away from the last URI in scope.
	//   - -5001 BLOCKED                     Blocked from fetch by user setting.
	//   - -5002 BLOCKED_BY_CUSTOM_PROCESSOR Blocked by a custom processor.
	ExcludeReason int32 `protobuf:"varint,2,opt,name=exclude_reason,json=excludeReason,proto3" json:"exclude_reason,omitempty"`
	// URI canonicalized for checking against already included list.
	// Examples of canonicalization could be:
	// * Removing well known session id's (e.g. jsessionid) from query parameters.
	// * Canonicalize according to the rules described for Google Safe Browsing (https://developers.google.com/safe-browsing/v4/urls-hashing)
	IncludeCheckUri *commons.ParsedUri `protobuf:"bytes,3,opt,name=include_check_uri,json=includeCheckUri,proto3" json:"include_check_uri,omitempty"`
	// Error is present if script had errors
	Error *commons.Error `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
	// If script outputs anything to the console (e.g. if debug is turned on in the request or script contains print() statements),
	// this field will contain the output
	Console string `protobuf:"bytes,5,opt,name=console,proto3" json:"console,omitempty"`
	// contains filtered or unexported fields
}

func (*ScopeCheckResponse) Descriptor deprecated

func (*ScopeCheckResponse) Descriptor() ([]byte, []int)

Deprecated: Use ScopeCheckResponse.ProtoReflect.Descriptor instead.

func (*ScopeCheckResponse) GetConsole

func (x *ScopeCheckResponse) GetConsole() string

func (*ScopeCheckResponse) GetError

func (x *ScopeCheckResponse) GetError() *commons.Error

func (*ScopeCheckResponse) GetEvaluation

func (*ScopeCheckResponse) GetExcludeReason

func (x *ScopeCheckResponse) GetExcludeReason() int32

func (*ScopeCheckResponse) GetIncludeCheckUri

func (x *ScopeCheckResponse) GetIncludeCheckUri() *commons.ParsedUri

func (*ScopeCheckResponse) ProtoMessage

func (*ScopeCheckResponse) ProtoMessage()

func (*ScopeCheckResponse) ProtoReflect

func (x *ScopeCheckResponse) ProtoReflect() protoreflect.Message

func (*ScopeCheckResponse) Reset

func (x *ScopeCheckResponse) Reset()

func (*ScopeCheckResponse) String

func (x *ScopeCheckResponse) String() string

type ScopeCheckResponse_Evaluation

type ScopeCheckResponse_Evaluation int32
const (
	ScopeCheckResponse_INCLUDE ScopeCheckResponse_Evaluation = 0
	ScopeCheckResponse_EXCLUDE ScopeCheckResponse_Evaluation = 1
)

func (ScopeCheckResponse_Evaluation) Descriptor

func (ScopeCheckResponse_Evaluation) Enum

func (ScopeCheckResponse_Evaluation) EnumDescriptor deprecated

func (ScopeCheckResponse_Evaluation) EnumDescriptor() ([]byte, []int)

Deprecated: Use ScopeCheckResponse_Evaluation.Descriptor instead.

func (ScopeCheckResponse_Evaluation) Number

func (ScopeCheckResponse_Evaluation) String

func (ScopeCheckResponse_Evaluation) Type

type ScopesCheckerServiceClient

type ScopesCheckerServiceClient interface {
	// Check if URI is in scope for this crawl
	ScopeCheck(ctx context.Context, in *ScopeCheckRequest, opts ...grpc.CallOption) (*ScopeCheckResponse, error)
}

ScopesCheckerServiceClient is the client API for ScopesCheckerService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

Service for URI scope check.

type ScopesCheckerServiceServer

type ScopesCheckerServiceServer interface {
	// Check if URI is in scope for this crawl
	ScopeCheck(context.Context, *ScopeCheckRequest) (*ScopeCheckResponse, error)
	// contains filtered or unexported methods
}

ScopesCheckerServiceServer is the server API for ScopesCheckerService service. All implementations must embed UnimplementedScopesCheckerServiceServer for forward compatibility.

Service for URI scope check.

type UnimplementedScopesCheckerServiceServer

type UnimplementedScopesCheckerServiceServer struct{}

UnimplementedScopesCheckerServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedScopesCheckerServiceServer) ScopeCheck

type UnsafeScopesCheckerServiceServer

type UnsafeScopesCheckerServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeScopesCheckerServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ScopesCheckerServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL