section

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package section is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_stroeer_page_section_v1_section_page_proto protoreflect.FileDescriptor
View Source
var File_stroeer_page_section_v1_section_page_service_proto protoreflect.FileDescriptor
View Source
var SectionPageService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "stroeer.page.section.v1.SectionPageService",
	HandlerType: (*SectionPageServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetSectionPage",
			Handler:    _SectionPageService_GetSectionPage_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "stroeer/page/section/v1/section_page_service.proto",
}

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

Functions

func RegisterSectionPageServiceHandler added in v0.18.0

func RegisterSectionPageServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSectionPageServiceHandler registers the http handlers for service SectionPageService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSectionPageServiceHandlerClient added in v0.18.0

func RegisterSectionPageServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SectionPageServiceClient) error

RegisterSectionPageServiceHandlerClient registers the http handlers for service SectionPageService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SectionPageServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SectionPageServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SectionPageServiceClient" to call the correct interceptors.

func RegisterSectionPageServiceHandlerFromEndpoint added in v0.18.0

func RegisterSectionPageServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSectionPageServiceHandlerFromEndpoint is same as RegisterSectionPageServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSectionPageServiceHandlerServer added in v0.18.0

func RegisterSectionPageServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SectionPageServiceServer) error

RegisterSectionPageServiceHandlerServer registers the http handlers for service SectionPageService to "mux". UnaryRPC :call SectionPageServiceServer 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 RegisterSectionPageServiceHandlerFromEndpoint instead.

func RegisterSectionPageServiceServer

func RegisterSectionPageServiceServer(s grpc.ServiceRegistrar, srv SectionPageServiceServer)

Types

type GetSectionPageRequest

type GetSectionPageRequest struct {

	// valid section_path, with leading and trailing slash
	SectionPath string `protobuf:"bytes,1,opt,name=section_path,json=sectionPath,proto3" json:"section_path,omitempty"`
	// use to page through sections. If unspecified, it will default to `1`.
	// Paging is 1-based (1 is the first page, there is no page `0`)
	//
	// Due to underlying mechanisms and seo requirements, page-size is fixed at 30
	// The service may return fewer than this value.
	Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"`
	// contains filtered or unexported fields
}

Message to provide parameters when requesting data for a section page, currently only the path of the page. Correct paths have a leading and a trailing slash, like `/nachrichten/unterhaltung/` The homepage has the path `/`.

func (*GetSectionPageRequest) Descriptor deprecated

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

Deprecated: Use GetSectionPageRequest.ProtoReflect.Descriptor instead.

func (*GetSectionPageRequest) GetPage added in v0.17.0

func (x *GetSectionPageRequest) GetPage() int32

func (*GetSectionPageRequest) GetSectionPath

func (x *GetSectionPageRequest) GetSectionPath() string

func (*GetSectionPageRequest) ProtoMessage

func (*GetSectionPageRequest) ProtoMessage()

func (*GetSectionPageRequest) ProtoReflect

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

func (*GetSectionPageRequest) Reset

func (x *GetSectionPageRequest) Reset()

func (*GetSectionPageRequest) String

func (x *GetSectionPageRequest) String() string

type GetSectionPageResponse

type GetSectionPageResponse struct {
	SectionPage *SectionPage `protobuf:"bytes,1,opt,name=section_page,json=sectionPage,proto3" json:"section_page,omitempty"`
	// Total number of pages in this `section_path`
	TotalPages int32 `protobuf:"varint,2,opt,name=total_pages,json=totalPages,proto3" json:"total_pages,omitempty"`
	// contains filtered or unexported fields
}

Response message when requesting data for a section page. Responds with `NOT_FOUND` if an unknown path is requested, or the path is incorrect.

func (*GetSectionPageResponse) Descriptor deprecated

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

Deprecated: Use GetSectionPageResponse.ProtoReflect.Descriptor instead.

func (*GetSectionPageResponse) GetSectionPage

func (x *GetSectionPageResponse) GetSectionPage() *SectionPage

func (*GetSectionPageResponse) GetTotalPages added in v0.17.0

func (x *GetSectionPageResponse) GetTotalPages() int32

func (*GetSectionPageResponse) ProtoMessage

func (*GetSectionPageResponse) ProtoMessage()

func (*GetSectionPageResponse) ProtoReflect

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

func (*GetSectionPageResponse) Reset

func (x *GetSectionPageResponse) Reset()

func (*GetSectionPageResponse) String

func (x *GetSectionPageResponse) String() string

type SectionPage

type SectionPage struct {
	Section *SectionPage_Section `protobuf:"bytes,1,opt,name=section,proto3" json:"section,omitempty"`
	Stages  []*v1.Stage          `protobuf:"bytes,2,rep,name=stages,proto3" json:"stages,omitempty"`
	// contains filtered or unexported fields
}

All data to render a section page like the homepage or "/politik/".

func (*SectionPage) Descriptor deprecated

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

Deprecated: Use SectionPage.ProtoReflect.Descriptor instead.

func (*SectionPage) GetSection

func (x *SectionPage) GetSection() *SectionPage_Section

func (*SectionPage) GetStages

func (x *SectionPage) GetStages() []*v1.Stage

func (*SectionPage) ProtoMessage

func (*SectionPage) ProtoMessage()

func (*SectionPage) ProtoReflect

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

func (*SectionPage) Reset

func (x *SectionPage) Reset()

func (*SectionPage) String

func (x *SectionPage) String() string

type SectionPageServiceClient

type SectionPageServiceClient interface {
	//*
	//############################################################################
	//# Description
	//############################################################################
	//Get section data for a given section path
	//
	//############################################################################
	//# Status/Error scenario's
	//############################################################################
	//
	//scenario: found
	//description: all data for the section page was found
	//gRPC status: OK
	//gRPC error payload: none
	//HTTP status: OK
	//cacheable: yes
	//
	//scenario: section path is empty
	//description: client did not provide a section path
	//gRPC status: INVALID_ARGUMENT
	//gRPC error payload: google.rpc.BadRequest
	//HTTP status: 400
	//cacheable: yes
	//
	//scenario: section path is invalid
	//description: client provided an invalid section path
	//gRPC status: INVALID_ARGUMENT
	//gRPC error payload: google.rpc.BadRequest
	//HTTP status: 400
	//cacheable: yes
	//
	//scenario: section path is unknown
	//description: client provided an unknown section path
	//gRPC status: NOT_FOUND
	//gRPC error payload: none
	//HTTP status: 404
	//cacheable: yes
	//
	//scenario: internal
	//description: internal error while loading section data
	//gRPC status: INTERNAL
	//gRPC error payload: none
	//HTTP status: 500
	//cacheable: no
	//
	//scenario: timeout
	//description: timeout while loading section data
	//gRPC status: DEADLINE_EXCEEDED
	//gRPC error payload: none
	//HTTP status: 504
	//cacheable: no
	//
	//Scenarios about incomplete section data needs to be defined
	GetSectionPage(ctx context.Context, in *GetSectionPageRequest, opts ...grpc.CallOption) (*GetSectionPageResponse, error)
}

SectionPageServiceClient is the client API for SectionPageService 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 SectionPageServiceServer

type SectionPageServiceServer interface {
	//*
	//############################################################################
	//# Description
	//############################################################################
	//Get section data for a given section path
	//
	//############################################################################
	//# Status/Error scenario's
	//############################################################################
	//
	//scenario: found
	//description: all data for the section page was found
	//gRPC status: OK
	//gRPC error payload: none
	//HTTP status: OK
	//cacheable: yes
	//
	//scenario: section path is empty
	//description: client did not provide a section path
	//gRPC status: INVALID_ARGUMENT
	//gRPC error payload: google.rpc.BadRequest
	//HTTP status: 400
	//cacheable: yes
	//
	//scenario: section path is invalid
	//description: client provided an invalid section path
	//gRPC status: INVALID_ARGUMENT
	//gRPC error payload: google.rpc.BadRequest
	//HTTP status: 400
	//cacheable: yes
	//
	//scenario: section path is unknown
	//description: client provided an unknown section path
	//gRPC status: NOT_FOUND
	//gRPC error payload: none
	//HTTP status: 404
	//cacheable: yes
	//
	//scenario: internal
	//description: internal error while loading section data
	//gRPC status: INTERNAL
	//gRPC error payload: none
	//HTTP status: 500
	//cacheable: no
	//
	//scenario: timeout
	//description: timeout while loading section data
	//gRPC status: DEADLINE_EXCEEDED
	//gRPC error payload: none
	//HTTP status: 504
	//cacheable: no
	//
	//Scenarios about incomplete section data needs to be defined
	GetSectionPage(context.Context, *GetSectionPageRequest) (*GetSectionPageResponse, error)
	// contains filtered or unexported methods
}

SectionPageServiceServer is the server API for SectionPageService service. All implementations must embed UnimplementedSectionPageServiceServer for forward compatibility

type SectionPage_Section added in v0.16.0

type SectionPage_Section struct {

	// Generic map containing general content and configuration information of
	// the section (required).
	//
	// The entry set is defined by the content management system and
	// will vary depending on the main type of the article.
	//
	// This map will always contain non empty values for the following keys:
	//
	// * `ref_path`: URL path for this section e.g. /section/id_$ID/title.html
	// * `ref_canonical`: Canonical URL of this section, may differ if external, e.g. https://www.giga.de/tech/
	// * `ref_amp`: AMP URL of this section
	//
	// Clients must be resilient to unknown or missing entry sets.
	Fields map[string]string `` /* 153-byte string literal not displayed */
	// Hierarchical section tree information of the section (required).
	// For example:
	// `/` -> `/sport/` -> `/sport/fussball/`
	SectionTree *v11.Reference `protobuf:"bytes,2,opt,name=section_tree,json=sectionTree,proto3" json:"section_tree,omitempty"`
	// contains filtered or unexported fields
}

All meta information to render a section page.

func (*SectionPage_Section) Descriptor deprecated added in v0.16.0

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

Deprecated: Use SectionPage_Section.ProtoReflect.Descriptor instead.

func (*SectionPage_Section) GetFields added in v0.16.0

func (x *SectionPage_Section) GetFields() map[string]string

func (*SectionPage_Section) GetSectionTree added in v0.16.0

func (x *SectionPage_Section) GetSectionTree() *v11.Reference

func (*SectionPage_Section) ProtoMessage added in v0.16.0

func (*SectionPage_Section) ProtoMessage()

func (*SectionPage_Section) ProtoReflect added in v0.16.0

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

func (*SectionPage_Section) Reset added in v0.16.0

func (x *SectionPage_Section) Reset()

func (*SectionPage_Section) String added in v0.16.0

func (x *SectionPage_Section) String() string

type UnimplementedSectionPageServiceServer

type UnimplementedSectionPageServiceServer struct {
}

UnimplementedSectionPageServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedSectionPageServiceServer) GetSectionPage

type UnsafeSectionPageServiceServer

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

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

Jump to

Keyboard shortcuts

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