internet

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InternetService_Search_FullMethodName  = "/services.internet.InternetService/Search"
	InternetService_GetPage_FullMethodName = "/services.internet.InternetService/GetPage"
)
View Source
const (
	AdsService_GetAds_FullMethodName = "/services.internet.AdsService/GetAds"
)

Variables

View Source
var AdsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "services.internet.AdsService",
	HandlerType: (*AdsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetAds",
			Handler:    _AdsService_GetAds_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "services/internet/ads.proto",
}

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

View Source
var File_services_internet_ads_proto protoreflect.FileDescriptor
View Source
var File_services_internet_internet_proto protoreflect.FileDescriptor
View Source
var InternetService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "services.internet.InternetService",
	HandlerType: (*InternetServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Search",
			Handler:    _InternetService_Search_Handler,
		},
		{
			MethodName: "GetPage",
			Handler:    _InternetService_GetPage_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "services/internet/internet.proto",
}

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

View Source
var PermsRemap = map[string]string{

	"AdsService/GetAds": "Any",

	"InternetService/GetPage": "Any",
	"InternetService/Search":  "Any",
}

Functions

func RegisterAdsServiceServer

func RegisterAdsServiceServer(s grpc.ServiceRegistrar, srv AdsServiceServer)

func RegisterInternetServiceServer

func RegisterInternetServiceServer(s grpc.ServiceRegistrar, srv InternetServiceServer)

Types

type AdsServiceClient

type AdsServiceClient interface {
	// @perm: Name=Any
	GetAds(ctx context.Context, in *GetAdsRequest, opts ...grpc.CallOption) (*GetAdsResponse, error)
}

AdsServiceClient is the client API for AdsService 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 NewAdsServiceClient

func NewAdsServiceClient(cc grpc.ClientConnInterface) AdsServiceClient

type AdsServiceServer

type AdsServiceServer interface {
	// @perm: Name=Any
	GetAds(context.Context, *GetAdsRequest) (*GetAdsResponse, error)
	// contains filtered or unexported methods
}

AdsServiceServer is the server API for AdsService service. All implementations must embed UnimplementedAdsServiceServer for forward compatibility

type GetAdsRequest

type GetAdsRequest struct {
	AdType internet.AdType `protobuf:"varint,1,opt,name=ad_type,json=adType,proto3,enum=resources.internet.AdType" json:"ad_type,omitempty"`
	Count  int32           `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAdsRequest) Descriptor deprecated

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

Deprecated: Use GetAdsRequest.ProtoReflect.Descriptor instead.

func (*GetAdsRequest) GetAdType

func (x *GetAdsRequest) GetAdType() internet.AdType

func (*GetAdsRequest) GetCount

func (x *GetAdsRequest) GetCount() int32

func (*GetAdsRequest) ProtoMessage

func (*GetAdsRequest) ProtoMessage()

func (*GetAdsRequest) ProtoReflect

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

func (*GetAdsRequest) Reset

func (x *GetAdsRequest) Reset()

func (*GetAdsRequest) Sanitize

func (m *GetAdsRequest) Sanitize() error

func (*GetAdsRequest) String

func (x *GetAdsRequest) String() string

func (*GetAdsRequest) Validate

func (m *GetAdsRequest) Validate() error

Validate checks the field values on GetAdsRequest 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 (*GetAdsRequest) ValidateAll

func (m *GetAdsRequest) ValidateAll() error

ValidateAll checks the field values on GetAdsRequest 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 GetAdsRequestMultiError, or nil if none found.

type GetAdsRequestMultiError

type GetAdsRequestMultiError []error

GetAdsRequestMultiError is an error wrapping multiple validation errors returned by GetAdsRequest.ValidateAll() if the designated constraints aren't met.

func (GetAdsRequestMultiError) AllErrors

func (m GetAdsRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetAdsRequestMultiError) Error

func (m GetAdsRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type GetAdsRequestValidationError

type GetAdsRequestValidationError struct {
	// contains filtered or unexported fields
}

GetAdsRequestValidationError is the validation error returned by GetAdsRequest.Validate if the designated constraints aren't met.

func (GetAdsRequestValidationError) Cause

Cause function returns cause value.

func (GetAdsRequestValidationError) Error

Error satisfies the builtin error interface

func (GetAdsRequestValidationError) ErrorName

func (e GetAdsRequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetAdsRequestValidationError) Field

Field function returns field value.

func (GetAdsRequestValidationError) Key

Key function returns key value.

func (GetAdsRequestValidationError) Reason

Reason function returns reason value.

type GetAdsResponse

type GetAdsResponse struct {
	Ads []*internet.Ad `protobuf:"bytes,1,rep,name=ads,proto3" json:"ads,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAdsResponse) Descriptor deprecated

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

Deprecated: Use GetAdsResponse.ProtoReflect.Descriptor instead.

func (*GetAdsResponse) GetAds

func (x *GetAdsResponse) GetAds() []*internet.Ad

func (*GetAdsResponse) ProtoMessage

func (*GetAdsResponse) ProtoMessage()

func (*GetAdsResponse) ProtoReflect

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

func (*GetAdsResponse) Reset

func (x *GetAdsResponse) Reset()

func (*GetAdsResponse) Sanitize

func (m *GetAdsResponse) Sanitize() error

func (*GetAdsResponse) String

func (x *GetAdsResponse) String() string

func (*GetAdsResponse) Validate

func (m *GetAdsResponse) Validate() error

Validate checks the field values on GetAdsResponse 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 (*GetAdsResponse) ValidateAll

func (m *GetAdsResponse) ValidateAll() error

ValidateAll checks the field values on GetAdsResponse 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 GetAdsResponseMultiError, or nil if none found.

type GetAdsResponseMultiError

type GetAdsResponseMultiError []error

GetAdsResponseMultiError is an error wrapping multiple validation errors returned by GetAdsResponse.ValidateAll() if the designated constraints aren't met.

func (GetAdsResponseMultiError) AllErrors

func (m GetAdsResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetAdsResponseMultiError) Error

func (m GetAdsResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type GetAdsResponseValidationError

type GetAdsResponseValidationError struct {
	// contains filtered or unexported fields
}

GetAdsResponseValidationError is the validation error returned by GetAdsResponse.Validate if the designated constraints aren't met.

func (GetAdsResponseValidationError) Cause

Cause function returns cause value.

func (GetAdsResponseValidationError) Error

Error satisfies the builtin error interface

func (GetAdsResponseValidationError) ErrorName

func (e GetAdsResponseValidationError) ErrorName() string

ErrorName returns error name.

func (GetAdsResponseValidationError) Field

Field function returns field value.

func (GetAdsResponseValidationError) Key

Key function returns key value.

func (GetAdsResponseValidationError) Reason

Reason function returns reason value.

type GetPageRequest

type GetPageRequest struct {
	Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
	Path   string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPageRequest) Descriptor deprecated

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

Deprecated: Use GetPageRequest.ProtoReflect.Descriptor instead.

func (*GetPageRequest) GetDomain

func (x *GetPageRequest) GetDomain() string

func (*GetPageRequest) GetPath

func (x *GetPageRequest) GetPath() string

func (*GetPageRequest) ProtoMessage

func (*GetPageRequest) ProtoMessage()

func (*GetPageRequest) ProtoReflect

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

func (*GetPageRequest) Reset

func (x *GetPageRequest) Reset()

func (*GetPageRequest) Sanitize

func (m *GetPageRequest) Sanitize() error

func (*GetPageRequest) String

func (x *GetPageRequest) String() string

func (*GetPageRequest) Validate

func (m *GetPageRequest) Validate() error

Validate checks the field values on GetPageRequest 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 (*GetPageRequest) ValidateAll

func (m *GetPageRequest) ValidateAll() error

ValidateAll checks the field values on GetPageRequest 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 GetPageRequestMultiError, or nil if none found.

type GetPageRequestMultiError

type GetPageRequestMultiError []error

GetPageRequestMultiError is an error wrapping multiple validation errors returned by GetPageRequest.ValidateAll() if the designated constraints aren't met.

func (GetPageRequestMultiError) AllErrors

func (m GetPageRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetPageRequestMultiError) Error

func (m GetPageRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type GetPageRequestValidationError

type GetPageRequestValidationError struct {
	// contains filtered or unexported fields
}

GetPageRequestValidationError is the validation error returned by GetPageRequest.Validate if the designated constraints aren't met.

func (GetPageRequestValidationError) Cause

Cause function returns cause value.

func (GetPageRequestValidationError) Error

Error satisfies the builtin error interface

func (GetPageRequestValidationError) ErrorName

func (e GetPageRequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetPageRequestValidationError) Field

Field function returns field value.

func (GetPageRequestValidationError) Key

Key function returns key value.

func (GetPageRequestValidationError) Reason

Reason function returns reason value.

type GetPageResponse

type GetPageResponse struct {
	Page *internet.Page `protobuf:"bytes,1,opt,name=page,proto3,oneof" json:"page,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPageResponse) Descriptor deprecated

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

Deprecated: Use GetPageResponse.ProtoReflect.Descriptor instead.

func (*GetPageResponse) GetPage

func (x *GetPageResponse) GetPage() *internet.Page

func (*GetPageResponse) ProtoMessage

func (*GetPageResponse) ProtoMessage()

func (*GetPageResponse) ProtoReflect

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

func (*GetPageResponse) Reset

func (x *GetPageResponse) Reset()

func (*GetPageResponse) Sanitize

func (m *GetPageResponse) Sanitize() error

func (*GetPageResponse) String

func (x *GetPageResponse) String() string

func (*GetPageResponse) Validate

func (m *GetPageResponse) Validate() error

Validate checks the field values on GetPageResponse 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 (*GetPageResponse) ValidateAll

func (m *GetPageResponse) ValidateAll() error

ValidateAll checks the field values on GetPageResponse 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 GetPageResponseMultiError, or nil if none found.

type GetPageResponseMultiError

type GetPageResponseMultiError []error

GetPageResponseMultiError is an error wrapping multiple validation errors returned by GetPageResponse.ValidateAll() if the designated constraints aren't met.

func (GetPageResponseMultiError) AllErrors

func (m GetPageResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetPageResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type GetPageResponseValidationError

type GetPageResponseValidationError struct {
	// contains filtered or unexported fields
}

GetPageResponseValidationError is the validation error returned by GetPageResponse.Validate if the designated constraints aren't met.

func (GetPageResponseValidationError) Cause

Cause function returns cause value.

func (GetPageResponseValidationError) Error

Error satisfies the builtin error interface

func (GetPageResponseValidationError) ErrorName

func (e GetPageResponseValidationError) ErrorName() string

ErrorName returns error name.

func (GetPageResponseValidationError) Field

Field function returns field value.

func (GetPageResponseValidationError) Key

Key function returns key value.

func (GetPageResponseValidationError) Reason

Reason function returns reason value.

type InternetServiceClient

type InternetServiceClient interface {
	// @perm: Name=Any
	Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error)
	// @perm: Name=Any
	GetPage(ctx context.Context, in *GetPageRequest, opts ...grpc.CallOption) (*GetPageResponse, error)
}

InternetServiceClient is the client API for InternetService 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.

type InternetServiceServer

type InternetServiceServer interface {
	// @perm: Name=Any
	Search(context.Context, *SearchRequest) (*SearchResponse, error)
	// @perm: Name=Any
	GetPage(context.Context, *GetPageRequest) (*GetPageResponse, error)
	// contains filtered or unexported methods
}

InternetServiceServer is the server API for InternetService service. All implementations must embed UnimplementedInternetServiceServer for forward compatibility

type Params

type Params struct {
	fx.In

	DB *sql.DB
}

type SearchRequest

type SearchRequest struct {
	Search string `protobuf:"bytes,1,opt,name=search,proto3" json:"search,omitempty"`
	// contains filtered or unexported fields
}

func (*SearchRequest) Descriptor deprecated

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

Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.

func (*SearchRequest) GetSearch

func (x *SearchRequest) GetSearch() string

func (*SearchRequest) ProtoMessage

func (*SearchRequest) ProtoMessage()

func (*SearchRequest) ProtoReflect

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

func (*SearchRequest) Reset

func (x *SearchRequest) Reset()

func (*SearchRequest) Sanitize

func (m *SearchRequest) Sanitize() error

func (*SearchRequest) String

func (x *SearchRequest) String() string

func (*SearchRequest) Validate

func (m *SearchRequest) Validate() error

Validate checks the field values on SearchRequest 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 (*SearchRequest) ValidateAll

func (m *SearchRequest) ValidateAll() error

ValidateAll checks the field values on SearchRequest 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 SearchRequestMultiError, or nil if none found.

type SearchRequestMultiError

type SearchRequestMultiError []error

SearchRequestMultiError is an error wrapping multiple validation errors returned by SearchRequest.ValidateAll() if the designated constraints aren't met.

func (SearchRequestMultiError) AllErrors

func (m SearchRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SearchRequestMultiError) Error

func (m SearchRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type SearchRequestValidationError

type SearchRequestValidationError struct {
	// contains filtered or unexported fields
}

SearchRequestValidationError is the validation error returned by SearchRequest.Validate if the designated constraints aren't met.

func (SearchRequestValidationError) Cause

Cause function returns cause value.

func (SearchRequestValidationError) Error

Error satisfies the builtin error interface

func (SearchRequestValidationError) ErrorName

func (e SearchRequestValidationError) ErrorName() string

ErrorName returns error name.

func (SearchRequestValidationError) Field

Field function returns field value.

func (SearchRequestValidationError) Key

Key function returns key value.

func (SearchRequestValidationError) Reason

Reason function returns reason value.

type SearchResponse

type SearchResponse struct {
	Results []*internet.SearchResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
	// contains filtered or unexported fields
}

func (*SearchResponse) Descriptor deprecated

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

Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead.

func (*SearchResponse) GetResults

func (x *SearchResponse) GetResults() []*internet.SearchResult

func (*SearchResponse) ProtoMessage

func (*SearchResponse) ProtoMessage()

func (*SearchResponse) ProtoReflect

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

func (*SearchResponse) Reset

func (x *SearchResponse) Reset()

func (*SearchResponse) Sanitize

func (m *SearchResponse) Sanitize() error

func (*SearchResponse) String

func (x *SearchResponse) String() string

func (*SearchResponse) Validate

func (m *SearchResponse) Validate() error

Validate checks the field values on SearchResponse 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 (*SearchResponse) ValidateAll

func (m *SearchResponse) ValidateAll() error

ValidateAll checks the field values on SearchResponse 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 SearchResponseMultiError, or nil if none found.

type SearchResponseMultiError

type SearchResponseMultiError []error

SearchResponseMultiError is an error wrapping multiple validation errors returned by SearchResponse.ValidateAll() if the designated constraints aren't met.

func (SearchResponseMultiError) AllErrors

func (m SearchResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SearchResponseMultiError) Error

func (m SearchResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type SearchResponseValidationError

type SearchResponseValidationError struct {
	// contains filtered or unexported fields
}

SearchResponseValidationError is the validation error returned by SearchResponse.Validate if the designated constraints aren't met.

func (SearchResponseValidationError) Cause

Cause function returns cause value.

func (SearchResponseValidationError) Error

Error satisfies the builtin error interface

func (SearchResponseValidationError) ErrorName

func (e SearchResponseValidationError) ErrorName() string

ErrorName returns error name.

func (SearchResponseValidationError) Field

Field function returns field value.

func (SearchResponseValidationError) Key

Key function returns key value.

func (SearchResponseValidationError) Reason

Reason function returns reason value.

type Server

type Server struct {
	InternetServiceServer
	AdsServiceServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(p Params) *Server

func (*Server) GetAds

func (s *Server) GetAds(ctx context.Context, req *GetAdsRequest) (*GetAdsResponse, error)

func (*Server) GetPage

func (s *Server) GetPage(ctx context.Context, req *GetPageRequest) (*GetPageResponse, error)

func (*Server) GetPermsRemap

func (s *Server) GetPermsRemap() map[string]string

func (*Server) RegisterServer

func (s *Server) RegisterServer(srv *grpc.Server)

func (*Server) Search

func (s *Server) Search(ctx context.Context, req *SearchRequest) (*SearchResponse, error)

type UnimplementedAdsServiceServer

type UnimplementedAdsServiceServer struct {
}

UnimplementedAdsServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAdsServiceServer) GetAds

type UnimplementedInternetServiceServer

type UnimplementedInternetServiceServer struct {
}

UnimplementedInternetServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedInternetServiceServer) GetPage

func (UnimplementedInternetServiceServer) Search

type UnsafeAdsServiceServer

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

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

type UnsafeInternetServiceServer

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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