Documentation ¶
Overview ¶
Package nhk_service is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterNhkServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterNhkServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NhkServiceClient) error
- func RegisterNhkServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterNhkServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NhkServiceServer) error
- func RegisterNhkServiceServer(s grpc.ServiceRegistrar, srv NhkServiceServer)
- type Error
- type News
- func (*News) Descriptor() ([]byte, []int)deprecated
- func (x *News) GetBody() string
- func (x *News) GetImageUrl() string
- func (x *News) GetM3U8Url() string
- func (x *News) GetNewsId() string
- func (x *News) GetOutlineWithRuby() string
- func (x *News) GetPublishedAtUtc() *timestamppb.Timestamp
- func (x *News) GetTitle() string
- func (x *News) GetTitleWithRuby() string
- func (x *News) GetUrl() string
- func (*News) ProtoMessage()
- func (x *News) ProtoReflect() protoreflect.Message
- func (x *News) Reset()
- func (x *News) String() string
- type NewsReply
- type NewsRequest
- func (*NewsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *NewsRequest) GetEndDate() *timestamppb.Timestamp
- func (x *NewsRequest) GetStartDate() *timestamppb.Timestamp
- func (*NewsRequest) ProtoMessage()
- func (x *NewsRequest) ProtoReflect() protoreflect.Message
- func (x *NewsRequest) Reset()
- func (x *NewsRequest) String() string
- type NhkServiceClient
- type NhkServiceServer
- type UnimplementedNhkServiceServer
- type UnsafeNhkServiceServer
- type Word
- func (*Word) Descriptor() ([]byte, []int)deprecated
- func (x *Word) GetDefinitions() []*WordDefinition
- func (x *Word) GetIdInNews() string
- func (x *Word) GetName() string
- func (*Word) ProtoMessage()
- func (x *Word) ProtoReflect() protoreflect.Message
- func (x *Word) Reset()
- func (x *Word) String() string
- type WordDefinition
- func (*WordDefinition) Descriptor() ([]byte, []int)deprecated
- func (x *WordDefinition) GetDefinition() string
- func (x *WordDefinition) GetDefinitionWithRuby() string
- func (*WordDefinition) ProtoMessage()
- func (x *WordDefinition) ProtoReflect() protoreflect.Message
- func (x *WordDefinition) Reset()
- func (x *WordDefinition) String() string
- type WordReply
- type WordRequest
Constants ¶
This section is empty.
Variables ¶
var File_nhk_proto protoreflect.FileDescriptor
var NhkService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "nhk.NhkService", HandlerType: (*NhkServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetNews", Handler: _NhkService_GetNews_Handler, }, { MethodName: "GetWords", Handler: _NhkService_GetWords_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "nhk.proto", }
NhkService_ServiceDesc is the grpc.ServiceDesc for NhkService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterNhkServiceHandler ¶
func RegisterNhkServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterNhkServiceHandler registers the http handlers for service NhkService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterNhkServiceHandlerClient ¶
func RegisterNhkServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NhkServiceClient) error
RegisterNhkServiceHandlerClient registers the http handlers for service NhkService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NhkServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NhkServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "NhkServiceClient" to call the correct interceptors.
func RegisterNhkServiceHandlerFromEndpoint ¶
func RegisterNhkServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterNhkServiceHandlerFromEndpoint is same as RegisterNhkServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterNhkServiceHandlerServer ¶
func RegisterNhkServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NhkServiceServer) error
RegisterNhkServiceHandlerServer registers the http handlers for service NhkService to "mux". UnaryRPC :call NhkServiceServer 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 RegisterNhkServiceHandlerFromEndpoint instead.
func RegisterNhkServiceServer ¶
func RegisterNhkServiceServer(s grpc.ServiceRegistrar, srv NhkServiceServer)
Types ¶
type Error ¶
type Error struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Error) Descriptor
deprecated
func (*Error) GetMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type News ¶
type News struct { NewsId string `protobuf:"bytes,1,opt,name=newsId,proto3" json:"newsId,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` TitleWithRuby string `protobuf:"bytes,3,opt,name=titleWithRuby,proto3" json:"titleWithRuby,omitempty"` OutlineWithRuby string `protobuf:"bytes,4,opt,name=outlineWithRuby,proto3" json:"outlineWithRuby,omitempty"` Body string `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"` Url string `protobuf:"bytes,6,opt,name=url,proto3" json:"url,omitempty"` M3U8Url string `protobuf:"bytes,7,opt,name=m3u8Url,proto3" json:"m3u8Url,omitempty"` ImageUrl string `protobuf:"bytes,8,opt,name=imageUrl,proto3" json:"imageUrl,omitempty"` PublishedAtUtc *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=publishedAtUtc,proto3" json:"publishedAtUtc,omitempty"` // contains filtered or unexported fields }
func (*News) Descriptor
deprecated
func (*News) GetImageUrl ¶
func (*News) GetM3U8Url ¶
func (*News) GetOutlineWithRuby ¶
func (*News) GetPublishedAtUtc ¶
func (x *News) GetPublishedAtUtc() *timestamppb.Timestamp
func (*News) GetTitleWithRuby ¶
func (*News) ProtoMessage ¶
func (*News) ProtoMessage()
func (*News) ProtoReflect ¶
func (x *News) ProtoReflect() protoreflect.Message
type NewsReply ¶
type NewsReply struct { Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` News []*News `protobuf:"bytes,2,rep,name=news,proto3" json:"news,omitempty"` // contains filtered or unexported fields }
func (*NewsReply) Descriptor
deprecated
func (*NewsReply) ProtoMessage ¶
func (*NewsReply) ProtoMessage()
func (*NewsReply) ProtoReflect ¶
func (x *NewsReply) ProtoReflect() protoreflect.Message
type NewsRequest ¶
type NewsRequest struct { StartDate *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=startDate,proto3" json:"startDate,omitempty"` EndDate *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=endDate,proto3" json:"endDate,omitempty"` // contains filtered or unexported fields }
func (*NewsRequest) Descriptor
deprecated
func (*NewsRequest) Descriptor() ([]byte, []int)
Deprecated: Use NewsRequest.ProtoReflect.Descriptor instead.
func (*NewsRequest) GetEndDate ¶
func (x *NewsRequest) GetEndDate() *timestamppb.Timestamp
func (*NewsRequest) GetStartDate ¶
func (x *NewsRequest) GetStartDate() *timestamppb.Timestamp
func (*NewsRequest) ProtoMessage ¶
func (*NewsRequest) ProtoMessage()
func (*NewsRequest) ProtoReflect ¶
func (x *NewsRequest) ProtoReflect() protoreflect.Message
func (*NewsRequest) Reset ¶
func (x *NewsRequest) Reset()
func (*NewsRequest) String ¶
func (x *NewsRequest) String() string
type NhkServiceClient ¶
type NhkServiceClient interface { GetNews(ctx context.Context, in *NewsRequest, opts ...grpc.CallOption) (*NewsReply, error) GetWords(ctx context.Context, in *WordRequest, opts ...grpc.CallOption) (*WordReply, error) }
NhkServiceClient is the client API for NhkService 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 NewNhkServiceClient ¶
func NewNhkServiceClient(cc grpc.ClientConnInterface) NhkServiceClient
type NhkServiceServer ¶
type NhkServiceServer interface { GetNews(context.Context, *NewsRequest) (*NewsReply, error) GetWords(context.Context, *WordRequest) (*WordReply, error) // contains filtered or unexported methods }
NhkServiceServer is the server API for NhkService service. All implementations must embed UnimplementedNhkServiceServer for forward compatibility
type UnimplementedNhkServiceServer ¶
type UnimplementedNhkServiceServer struct { }
UnimplementedNhkServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedNhkServiceServer) GetNews ¶
func (UnimplementedNhkServiceServer) GetNews(context.Context, *NewsRequest) (*NewsReply, error)
func (UnimplementedNhkServiceServer) GetWords ¶
func (UnimplementedNhkServiceServer) GetWords(context.Context, *WordRequest) (*WordReply, error)
type UnsafeNhkServiceServer ¶
type UnsafeNhkServiceServer interface {
// contains filtered or unexported methods
}
UnsafeNhkServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NhkServiceServer will result in compilation errors.
type Word ¶
type Word struct { IdInNews string `protobuf:"bytes,1,opt,name=idInNews,proto3" json:"idInNews,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Definitions []*WordDefinition `protobuf:"bytes,3,rep,name=definitions,proto3" json:"definitions,omitempty"` // contains filtered or unexported fields }
func (*Word) Descriptor
deprecated
func (*Word) GetDefinitions ¶
func (x *Word) GetDefinitions() []*WordDefinition
func (*Word) GetIdInNews ¶
func (*Word) ProtoMessage ¶
func (*Word) ProtoMessage()
func (*Word) ProtoReflect ¶
func (x *Word) ProtoReflect() protoreflect.Message
type WordDefinition ¶
type WordDefinition struct { Definition string `protobuf:"bytes,1,opt,name=definition,proto3" json:"definition,omitempty"` DefinitionWithRuby string `protobuf:"bytes,2,opt,name=definitionWithRuby,proto3" json:"definitionWithRuby,omitempty"` // contains filtered or unexported fields }
func (*WordDefinition) Descriptor
deprecated
func (*WordDefinition) Descriptor() ([]byte, []int)
Deprecated: Use WordDefinition.ProtoReflect.Descriptor instead.
func (*WordDefinition) GetDefinition ¶
func (x *WordDefinition) GetDefinition() string
func (*WordDefinition) GetDefinitionWithRuby ¶
func (x *WordDefinition) GetDefinitionWithRuby() string
func (*WordDefinition) ProtoMessage ¶
func (*WordDefinition) ProtoMessage()
func (*WordDefinition) ProtoReflect ¶
func (x *WordDefinition) ProtoReflect() protoreflect.Message
func (*WordDefinition) Reset ¶
func (x *WordDefinition) Reset()
func (*WordDefinition) String ¶
func (x *WordDefinition) String() string
type WordReply ¶
type WordReply struct { Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` Words []*Word `protobuf:"bytes,2,rep,name=words,proto3" json:"words,omitempty"` // contains filtered or unexported fields }
func (*WordReply) Descriptor
deprecated
func (*WordReply) ProtoMessage ¶
func (*WordReply) ProtoMessage()
func (*WordReply) ProtoReflect ¶
func (x *WordReply) ProtoReflect() protoreflect.Message
type WordRequest ¶
type WordRequest struct { NewsId string `protobuf:"bytes,1,opt,name=newsId,proto3" json:"newsId,omitempty"` // contains filtered or unexported fields }
func (*WordRequest) Descriptor
deprecated
func (*WordRequest) Descriptor() ([]byte, []int)
Deprecated: Use WordRequest.ProtoReflect.Descriptor instead.
func (*WordRequest) GetNewsId ¶
func (x *WordRequest) GetNewsId() string
func (*WordRequest) ProtoMessage ¶
func (*WordRequest) ProtoMessage()
func (*WordRequest) ProtoReflect ¶
func (x *WordRequest) ProtoReflect() protoreflect.Message
func (*WordRequest) Reset ¶
func (x *WordRequest) Reset()
func (*WordRequest) String ¶
func (x *WordRequest) String() string