Documentation ¶
Overview ¶
Package scraper is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterScraperServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterScraperServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ScraperServiceClient) error
- func RegisterScraperServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterScraperServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ScraperServiceServer) error
- func RegisterScraperServiceServer(s grpc.ServiceRegistrar, srv ScraperServiceServer)
- type ScrapeRequest
- func (*ScrapeRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ScrapeRequest) GetUrl() string
- func (*ScrapeRequest) ProtoMessage()
- func (x *ScrapeRequest) ProtoReflect() protoreflect.Message
- func (x *ScrapeRequest) Reset()
- func (x *ScrapeRequest) String() string
- func (m *ScrapeRequest) Validate() error
- func (m *ScrapeRequest) ValidateAll() error
- type ScrapeRequestMultiError
- type ScrapeRequestValidationError
- func (e ScrapeRequestValidationError) Cause() error
- func (e ScrapeRequestValidationError) Error() string
- func (e ScrapeRequestValidationError) ErrorName() string
- func (e ScrapeRequestValidationError) Field() string
- func (e ScrapeRequestValidationError) Key() bool
- func (e ScrapeRequestValidationError) Reason() string
- type ScrapeResponse
- func (*ScrapeResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ScrapeResponse) GetAnime() *v1.Anime
- func (*ScrapeResponse) ProtoMessage()
- func (x *ScrapeResponse) ProtoReflect() protoreflect.Message
- func (x *ScrapeResponse) Reset()
- func (x *ScrapeResponse) String() string
- func (m *ScrapeResponse) Validate() error
- func (m *ScrapeResponse) ValidateAll() error
- type ScrapeResponseMultiError
- type ScrapeResponseValidationError
- func (e ScrapeResponseValidationError) Cause() error
- func (e ScrapeResponseValidationError) Error() string
- func (e ScrapeResponseValidationError) ErrorName() string
- func (e ScrapeResponseValidationError) Field() string
- func (e ScrapeResponseValidationError) Key() bool
- func (e ScrapeResponseValidationError) Reason() string
- type ScraperServiceClient
- type ScraperServiceServer
- type UnimplementedScraperServiceServer
- type UnsafeScraperServiceServer
Constants ¶
const (
ScraperService_Scrape_FullMethodName = "/scraper.service.v1.ScraperService/Scrape"
)
Variables ¶
var File_scraper_service_v1_scraper_proto protoreflect.FileDescriptor
var ScraperService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "scraper.service.v1.ScraperService", HandlerType: (*ScraperServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Scrape", Handler: _ScraperService_Scrape_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "scraper/service/v1/scraper.proto", }
ScraperService_ServiceDesc is the grpc.ServiceDesc for ScraperService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterScraperServiceHandler ¶
func RegisterScraperServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterScraperServiceHandler registers the http handlers for service ScraperService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterScraperServiceHandlerClient ¶
func RegisterScraperServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ScraperServiceClient) error
RegisterScraperServiceHandlerClient registers the http handlers for service ScraperService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ScraperServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ScraperServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ScraperServiceClient" to call the correct interceptors.
func RegisterScraperServiceHandlerFromEndpoint ¶
func RegisterScraperServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterScraperServiceHandlerFromEndpoint is same as RegisterScraperServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterScraperServiceHandlerServer ¶
func RegisterScraperServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ScraperServiceServer) error
RegisterScraperServiceHandlerServer registers the http handlers for service ScraperService to "mux". UnaryRPC :call ScraperServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterScraperServiceHandlerFromEndpoint instead.
func RegisterScraperServiceServer ¶
func RegisterScraperServiceServer(s grpc.ServiceRegistrar, srv ScraperServiceServer)
Types ¶
type ScrapeRequest ¶
type ScrapeRequest struct { Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // contains filtered or unexported fields }
func (*ScrapeRequest) Descriptor
deprecated
func (*ScrapeRequest) Descriptor() ([]byte, []int)
Deprecated: Use ScrapeRequest.ProtoReflect.Descriptor instead.
func (*ScrapeRequest) GetUrl ¶
func (x *ScrapeRequest) GetUrl() string
func (*ScrapeRequest) ProtoMessage ¶
func (*ScrapeRequest) ProtoMessage()
func (*ScrapeRequest) ProtoReflect ¶
func (x *ScrapeRequest) ProtoReflect() protoreflect.Message
func (*ScrapeRequest) Reset ¶
func (x *ScrapeRequest) Reset()
func (*ScrapeRequest) String ¶
func (x *ScrapeRequest) String() string
func (*ScrapeRequest) Validate ¶
func (m *ScrapeRequest) Validate() error
Validate checks the field values on ScrapeRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*ScrapeRequest) ValidateAll ¶
func (m *ScrapeRequest) ValidateAll() error
ValidateAll checks the field values on ScrapeRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ScrapeRequestMultiError, or nil if none found.
type ScrapeRequestMultiError ¶
type ScrapeRequestMultiError []error
ScrapeRequestMultiError is an error wrapping multiple validation errors returned by ScrapeRequest.ValidateAll() if the designated constraints aren't met.
func (ScrapeRequestMultiError) AllErrors ¶
func (m ScrapeRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ScrapeRequestMultiError) Error ¶
func (m ScrapeRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ScrapeRequestValidationError ¶
type ScrapeRequestValidationError struct {
// contains filtered or unexported fields
}
ScrapeRequestValidationError is the validation error returned by ScrapeRequest.Validate if the designated constraints aren't met.
func (ScrapeRequestValidationError) Cause ¶
func (e ScrapeRequestValidationError) Cause() error
Cause function returns cause value.
func (ScrapeRequestValidationError) Error ¶
func (e ScrapeRequestValidationError) Error() string
Error satisfies the builtin error interface
func (ScrapeRequestValidationError) ErrorName ¶
func (e ScrapeRequestValidationError) ErrorName() string
ErrorName returns error name.
func (ScrapeRequestValidationError) Field ¶
func (e ScrapeRequestValidationError) Field() string
Field function returns field value.
func (ScrapeRequestValidationError) Key ¶
func (e ScrapeRequestValidationError) Key() bool
Key function returns key value.
func (ScrapeRequestValidationError) Reason ¶
func (e ScrapeRequestValidationError) Reason() string
Reason function returns reason value.
type ScrapeResponse ¶
type ScrapeResponse struct { Anime *v1.Anime `protobuf:"bytes,1,opt,name=anime,proto3" json:"anime,omitempty"` // contains filtered or unexported fields }
func (*ScrapeResponse) Descriptor
deprecated
func (*ScrapeResponse) Descriptor() ([]byte, []int)
Deprecated: Use ScrapeResponse.ProtoReflect.Descriptor instead.
func (*ScrapeResponse) GetAnime ¶
func (x *ScrapeResponse) GetAnime() *v1.Anime
func (*ScrapeResponse) ProtoMessage ¶
func (*ScrapeResponse) ProtoMessage()
func (*ScrapeResponse) ProtoReflect ¶
func (x *ScrapeResponse) ProtoReflect() protoreflect.Message
func (*ScrapeResponse) Reset ¶
func (x *ScrapeResponse) Reset()
func (*ScrapeResponse) String ¶
func (x *ScrapeResponse) String() string
func (*ScrapeResponse) Validate ¶
func (m *ScrapeResponse) Validate() error
Validate checks the field values on ScrapeResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*ScrapeResponse) ValidateAll ¶
func (m *ScrapeResponse) ValidateAll() error
ValidateAll checks the field values on ScrapeResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ScrapeResponseMultiError, or nil if none found.
type ScrapeResponseMultiError ¶
type ScrapeResponseMultiError []error
ScrapeResponseMultiError is an error wrapping multiple validation errors returned by ScrapeResponse.ValidateAll() if the designated constraints aren't met.
func (ScrapeResponseMultiError) AllErrors ¶
func (m ScrapeResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ScrapeResponseMultiError) Error ¶
func (m ScrapeResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ScrapeResponseValidationError ¶
type ScrapeResponseValidationError struct {
// contains filtered or unexported fields
}
ScrapeResponseValidationError is the validation error returned by ScrapeResponse.Validate if the designated constraints aren't met.
func (ScrapeResponseValidationError) Cause ¶
func (e ScrapeResponseValidationError) Cause() error
Cause function returns cause value.
func (ScrapeResponseValidationError) Error ¶
func (e ScrapeResponseValidationError) Error() string
Error satisfies the builtin error interface
func (ScrapeResponseValidationError) ErrorName ¶
func (e ScrapeResponseValidationError) ErrorName() string
ErrorName returns error name.
func (ScrapeResponseValidationError) Field ¶
func (e ScrapeResponseValidationError) Field() string
Field function returns field value.
func (ScrapeResponseValidationError) Key ¶
func (e ScrapeResponseValidationError) Key() bool
Key function returns key value.
func (ScrapeResponseValidationError) Reason ¶
func (e ScrapeResponseValidationError) Reason() string
Reason function returns reason value.
type ScraperServiceClient ¶
type ScraperServiceClient interface {
Scrape(ctx context.Context, in *ScrapeRequest, opts ...grpc.CallOption) (*ScrapeResponse, error)
}
ScraperServiceClient is the client API for ScraperService 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.
func NewScraperServiceClient ¶
func NewScraperServiceClient(cc grpc.ClientConnInterface) ScraperServiceClient
type ScraperServiceServer ¶
type ScraperServiceServer interface { Scrape(context.Context, *ScrapeRequest) (*ScrapeResponse, error) // contains filtered or unexported methods }
ScraperServiceServer is the server API for ScraperService service. All implementations must embed UnimplementedScraperServiceServer for forward compatibility
type UnimplementedScraperServiceServer ¶
type UnimplementedScraperServiceServer struct { }
UnimplementedScraperServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedScraperServiceServer) Scrape ¶
func (UnimplementedScraperServiceServer) Scrape(context.Context, *ScrapeRequest) (*ScrapeResponse, error)
type UnsafeScraperServiceServer ¶
type UnsafeScraperServiceServer interface {
// contains filtered or unexported methods
}
UnsafeScraperServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ScraperServiceServer will result in compilation errors.