Documentation ¶
Overview ¶
Package article is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterArticlePageServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterArticlePageServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ArticlePageServiceClient) error
- func RegisterArticlePageServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterArticlePageServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ArticlePageServiceServer) error
- func RegisterArticlePageServiceServer(s grpc.ServiceRegistrar, srv ArticlePageServiceServer)
- type ArticlePage
- func (*ArticlePage) Descriptor() ([]byte, []int)deprecated
- func (x *ArticlePage) GetArticle() *v1.Article
- func (x *ArticlePage) GetRelatedArticles() []*RelatedArticle
- func (x *ArticlePage) GetStages() []*v11.Stage
- func (*ArticlePage) ProtoMessage()
- func (x *ArticlePage) ProtoReflect() protoreflect.Message
- func (x *ArticlePage) Reset()
- func (x *ArticlePage) String() string
- type ArticlePageServiceClient
- type ArticlePageServiceServer
- type GetArticlePageRequest
- func (*GetArticlePageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetArticlePageRequest) GetId() int64
- func (*GetArticlePageRequest) ProtoMessage()
- func (x *GetArticlePageRequest) ProtoReflect() protoreflect.Message
- func (x *GetArticlePageRequest) Reset()
- func (x *GetArticlePageRequest) String() string
- type GetArticlePageResponse
- func (*GetArticlePageResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetArticlePageResponse) GetArticlePage() *ArticlePage
- func (*GetArticlePageResponse) ProtoMessage()
- func (x *GetArticlePageResponse) ProtoReflect() protoreflect.Message
- func (x *GetArticlePageResponse) Reset()
- func (x *GetArticlePageResponse) String() string
- type RelatedArticle
- func (*RelatedArticle) Descriptor() ([]byte, []int)deprecated
- func (x *RelatedArticle) GetArticle() *v1.Article
- func (x *RelatedArticle) GetSource() RelatedArticleSource
- func (*RelatedArticle) ProtoMessage()
- func (x *RelatedArticle) ProtoReflect() protoreflect.Message
- func (x *RelatedArticle) Reset()
- func (x *RelatedArticle) String() string
- type RelatedArticleSource
- func (RelatedArticleSource) Descriptor() protoreflect.EnumDescriptor
- func (x RelatedArticleSource) Enum() *RelatedArticleSource
- func (RelatedArticleSource) EnumDescriptor() ([]byte, []int)deprecated
- func (x RelatedArticleSource) Number() protoreflect.EnumNumber
- func (x RelatedArticleSource) String() string
- func (RelatedArticleSource) Type() protoreflect.EnumType
- type UnimplementedArticlePageServiceServer
- type UnsafeArticlePageServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( RelatedArticleSource_name = map[int32]string{ 0: "RELATED_ARTICLE_SOURCE_UNSPECIFIED", 1: "RELATED_ARTICLE_SOURCE_EDITORIAL", } RelatedArticleSource_value = map[string]int32{ "RELATED_ARTICLE_SOURCE_UNSPECIFIED": 0, "RELATED_ARTICLE_SOURCE_EDITORIAL": 1, } )
Enum value maps for RelatedArticleSource.
var ArticlePageService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "stroeer.page.article.v1.ArticlePageService", HandlerType: (*ArticlePageServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetArticlePage", Handler: _ArticlePageService_GetArticlePage_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "stroeer/page/article/v1/article_page_service.proto", }
ArticlePageService_ServiceDesc is the grpc.ServiceDesc for ArticlePageService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_stroeer_page_article_v1_article_page_proto protoreflect.FileDescriptor
var File_stroeer_page_article_v1_article_page_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterArticlePageServiceHandler ¶
func RegisterArticlePageServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterArticlePageServiceHandler registers the http handlers for service ArticlePageService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterArticlePageServiceHandlerClient ¶
func RegisterArticlePageServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ArticlePageServiceClient) error
RegisterArticlePageServiceHandlerClient registers the http handlers for service ArticlePageService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ArticlePageServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ArticlePageServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ArticlePageServiceClient" to call the correct interceptors.
func RegisterArticlePageServiceHandlerFromEndpoint ¶
func RegisterArticlePageServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterArticlePageServiceHandlerFromEndpoint is same as RegisterArticlePageServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterArticlePageServiceHandlerServer ¶
func RegisterArticlePageServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ArticlePageServiceServer) error
RegisterArticlePageServiceHandlerServer registers the http handlers for service ArticlePageService to "mux". UnaryRPC :call ArticlePageServiceServer 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 RegisterArticlePageServiceHandlerFromEndpoint instead.
func RegisterArticlePageServiceServer ¶
func RegisterArticlePageServiceServer(s grpc.ServiceRegistrar, srv ArticlePageServiceServer)
Types ¶
type ArticlePage ¶
type ArticlePage struct { // The editorial article with the ID of a `GetArticlePageRequest`. // // Unpublished elements will be filtered according to their metadata. Article *v1.Article `protobuf:"bytes,1,opt,name=article,proto3" json:"article,omitempty"` // Additional related editorial articles. Articles which are not published // according to their `Metadata` will be filtered. RelatedArticles []*RelatedArticle `protobuf:"bytes,2,rep,name=related_articles,json=relatedArticles,proto3" json:"related_articles,omitempty"` // stage(s) for the bottom of article pages, mostly seo cases like A-Z Modules Stages []*v11.Stage `protobuf:"bytes,3,rep,name=stages,proto3" json:"stages,omitempty"` // contains filtered or unexported fields }
Article page with all render relevant data for the user and SEO bots.
func (*ArticlePage) Descriptor
deprecated
func (*ArticlePage) Descriptor() ([]byte, []int)
Deprecated: Use ArticlePage.ProtoReflect.Descriptor instead.
func (*ArticlePage) GetArticle ¶
func (x *ArticlePage) GetArticle() *v1.Article
func (*ArticlePage) GetRelatedArticles ¶
func (x *ArticlePage) GetRelatedArticles() []*RelatedArticle
func (*ArticlePage) GetStages ¶ added in v0.20.0
func (x *ArticlePage) GetStages() []*v11.Stage
func (*ArticlePage) ProtoMessage ¶
func (*ArticlePage) ProtoMessage()
func (*ArticlePage) ProtoReflect ¶
func (x *ArticlePage) ProtoReflect() protoreflect.Message
func (*ArticlePage) Reset ¶
func (x *ArticlePage) Reset()
func (*ArticlePage) String ¶
func (x *ArticlePage) String() string
type ArticlePageServiceClient ¶
type ArticlePageServiceClient interface { //* //############################################################################ //# Description //############################################################################ //Returns the requested article with all render relevant data for the user and SEO bots. // //############################################################################ //# Status/Error scenario's //############################################################################ // //scenario: found //description: article was found in the datastore and is published according to it's metadata //gRPC status: OK //gRPC error payload: none //HTTP status: OK //cacheable: yes // //scenario: invalid id //description: article id is invalid //gRPC status: INVALID_ARGUMENT //gRPC error payload: google.rpc.BadRequest //HTTP status: 400 //cacheable: yes // //scenario: not found //description: article was not found in the datastore //gRPC status: NOT_FOUND //gRPC error payload: google.rpc.ResourceInfo //HTTP status: 404 //cacheable: yes // //scenario: not published yet //description: article was found in the datastore but according to it's metadata the article is not published yet //gRPC status: NOT_FOUND //gRPC error payload: google.rpc.ResourceInfo with info about the 'start_time' //HTTP status: 404 //cacheable: yes // //scenario: expired //description: article was found in the datastore but is expired according to it's metadata //gRPC status: NOT_FOUND //gRPC error payload: google.rpc.ResourceInfo with info about the 'end_time' //HTTP status: 404 //cacheable: yes // //scenario: deleted/archived //description: article was found in the datastore but it's state is marked as deleted/archived //gRPC status: FAILED_PRECONDITION //gRPC error payload: google.rpc.PreconditionFailure with info about the state //HTTP status: 410 //cacheable: yes // //scenario: internal //description: internal error processing the article //gRPC status: INTERNAL //gRPC error payload: none //HTTP status: 500 //cacheable: no // //scenario: timeout //description: timeout loading and processing the article //gRPC status: DEADLINE_EXCEEDED //gRPC error payload: none //HTTP status: 504 //cacheable: no // //*Redirect cases should be defined after requirements are clear** GetArticlePage(ctx context.Context, in *GetArticlePageRequest, opts ...grpc.CallOption) (*GetArticlePageResponse, error) }
ArticlePageServiceClient is the client API for ArticlePageService 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 NewArticlePageServiceClient ¶
func NewArticlePageServiceClient(cc grpc.ClientConnInterface) ArticlePageServiceClient
type ArticlePageServiceServer ¶
type ArticlePageServiceServer interface { //* //############################################################################ //# Description //############################################################################ //Returns the requested article with all render relevant data for the user and SEO bots. // //############################################################################ //# Status/Error scenario's //############################################################################ // //scenario: found //description: article was found in the datastore and is published according to it's metadata //gRPC status: OK //gRPC error payload: none //HTTP status: OK //cacheable: yes // //scenario: invalid id //description: article id is invalid //gRPC status: INVALID_ARGUMENT //gRPC error payload: google.rpc.BadRequest //HTTP status: 400 //cacheable: yes // //scenario: not found //description: article was not found in the datastore //gRPC status: NOT_FOUND //gRPC error payload: google.rpc.ResourceInfo //HTTP status: 404 //cacheable: yes // //scenario: not published yet //description: article was found in the datastore but according to it's metadata the article is not published yet //gRPC status: NOT_FOUND //gRPC error payload: google.rpc.ResourceInfo with info about the 'start_time' //HTTP status: 404 //cacheable: yes // //scenario: expired //description: article was found in the datastore but is expired according to it's metadata //gRPC status: NOT_FOUND //gRPC error payload: google.rpc.ResourceInfo with info about the 'end_time' //HTTP status: 404 //cacheable: yes // //scenario: deleted/archived //description: article was found in the datastore but it's state is marked as deleted/archived //gRPC status: FAILED_PRECONDITION //gRPC error payload: google.rpc.PreconditionFailure with info about the state //HTTP status: 410 //cacheable: yes // //scenario: internal //description: internal error processing the article //gRPC status: INTERNAL //gRPC error payload: none //HTTP status: 500 //cacheable: no // //scenario: timeout //description: timeout loading and processing the article //gRPC status: DEADLINE_EXCEEDED //gRPC error payload: none //HTTP status: 504 //cacheable: no // //*Redirect cases should be defined after requirements are clear** GetArticlePage(context.Context, *GetArticlePageRequest) (*GetArticlePageResponse, error) // contains filtered or unexported methods }
ArticlePageServiceServer is the server API for ArticlePageService service. All implementations must embed UnimplementedArticlePageServiceServer for forward compatibility
type GetArticlePageRequest ¶
type GetArticlePageRequest struct { // ID of the article defined by the content management system (required). Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
Request message to get an article page.
func (*GetArticlePageRequest) Descriptor
deprecated
func (*GetArticlePageRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetArticlePageRequest.ProtoReflect.Descriptor instead.
func (*GetArticlePageRequest) GetId ¶
func (x *GetArticlePageRequest) GetId() int64
func (*GetArticlePageRequest) ProtoMessage ¶
func (*GetArticlePageRequest) ProtoMessage()
func (*GetArticlePageRequest) ProtoReflect ¶
func (x *GetArticlePageRequest) ProtoReflect() protoreflect.Message
func (*GetArticlePageRequest) Reset ¶
func (x *GetArticlePageRequest) Reset()
func (*GetArticlePageRequest) String ¶
func (x *GetArticlePageRequest) String() string
type GetArticlePageResponse ¶
type GetArticlePageResponse struct { // Article page with all render relevant data for the user and SEO bots. ArticlePage *ArticlePage `protobuf:"bytes,1,opt,name=article_page,json=articlePage,proto3" json:"article_page,omitempty"` // contains filtered or unexported fields }
Response message for an article page request.
Status codes: * `OK`: article exists and is published * `NOT_FOUND`: article doesn't exist or is not published according to it's `Metadata`
func (*GetArticlePageResponse) Descriptor
deprecated
func (*GetArticlePageResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetArticlePageResponse.ProtoReflect.Descriptor instead.
func (*GetArticlePageResponse) GetArticlePage ¶
func (x *GetArticlePageResponse) GetArticlePage() *ArticlePage
func (*GetArticlePageResponse) ProtoMessage ¶
func (*GetArticlePageResponse) ProtoMessage()
func (*GetArticlePageResponse) ProtoReflect ¶
func (x *GetArticlePageResponse) ProtoReflect() protoreflect.Message
func (*GetArticlePageResponse) Reset ¶
func (x *GetArticlePageResponse) Reset()
func (*GetArticlePageResponse) String ¶
func (x *GetArticlePageResponse) String() string
type RelatedArticle ¶
type RelatedArticle struct { // Data of the related article. This message will only contain data required // to render the article as a _Teaser_ (e.g. with `Article.body` set to `null` // thus not containing any data that is only required on detail pages). Article *v1.Article `protobuf:"bytes,1,opt,name=article,proto3" json:"article,omitempty"` // Source of the related article. Source RelatedArticleSource `protobuf:"varint,2,opt,name=source,proto3,enum=stroeer.page.article.v1.RelatedArticleSource" json:"source,omitempty"` // contains filtered or unexported fields }
An editorial article, which is related to another article.
Related articles are specified manually be the editorial department or identified by recommendation systems.
func (*RelatedArticle) Descriptor
deprecated
func (*RelatedArticle) Descriptor() ([]byte, []int)
Deprecated: Use RelatedArticle.ProtoReflect.Descriptor instead.
func (*RelatedArticle) GetArticle ¶
func (x *RelatedArticle) GetArticle() *v1.Article
func (*RelatedArticle) GetSource ¶
func (x *RelatedArticle) GetSource() RelatedArticleSource
func (*RelatedArticle) ProtoMessage ¶
func (*RelatedArticle) ProtoMessage()
func (*RelatedArticle) ProtoReflect ¶
func (x *RelatedArticle) ProtoReflect() protoreflect.Message
func (*RelatedArticle) Reset ¶
func (x *RelatedArticle) Reset()
func (*RelatedArticle) String ¶
func (x *RelatedArticle) String() string
type RelatedArticleSource ¶
type RelatedArticleSource int32
Source of the related article.
const ( // Not specified. RelatedArticleSource_RELATED_ARTICLE_SOURCE_UNSPECIFIED RelatedArticleSource = 0 // Article was related manually by the editorial department. RelatedArticleSource_RELATED_ARTICLE_SOURCE_EDITORIAL RelatedArticleSource = 1 )
func (RelatedArticleSource) Descriptor ¶
func (RelatedArticleSource) Descriptor() protoreflect.EnumDescriptor
func (RelatedArticleSource) Enum ¶
func (x RelatedArticleSource) Enum() *RelatedArticleSource
func (RelatedArticleSource) EnumDescriptor
deprecated
func (RelatedArticleSource) EnumDescriptor() ([]byte, []int)
Deprecated: Use RelatedArticleSource.Descriptor instead.
func (RelatedArticleSource) Number ¶
func (x RelatedArticleSource) Number() protoreflect.EnumNumber
func (RelatedArticleSource) String ¶
func (x RelatedArticleSource) String() string
func (RelatedArticleSource) Type ¶
func (RelatedArticleSource) Type() protoreflect.EnumType
type UnimplementedArticlePageServiceServer ¶
type UnimplementedArticlePageServiceServer struct { }
UnimplementedArticlePageServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedArticlePageServiceServer) GetArticlePage ¶
func (UnimplementedArticlePageServiceServer) GetArticlePage(context.Context, *GetArticlePageRequest) (*GetArticlePageResponse, error)
type UnsafeArticlePageServiceServer ¶
type UnsafeArticlePageServiceServer interface {
// contains filtered or unexported methods
}
UnsafeArticlePageServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ArticlePageServiceServer will result in compilation errors.