nhk_service

package module
v0.0.0-...-3996408 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 17 Imported by: 4

README

nhk-easy-service-proto

The proto definition of nhk-easy-service-go.

Run make generate to generate code.

License

MIT

Documentation

Overview

Package nhk_service is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetCode

func (x *Error) GetCode() int32

func (*Error) GetMessage

func (x *Error) GetMessage() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

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

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use News.ProtoReflect.Descriptor instead.

func (*News) GetBody

func (x *News) GetBody() string

func (*News) GetImageUrl

func (x *News) GetImageUrl() string

func (*News) GetM3U8Url

func (x *News) GetM3U8Url() string

func (*News) GetNewsId

func (x *News) GetNewsId() string

func (*News) GetOutlineWithRuby

func (x *News) GetOutlineWithRuby() string

func (*News) GetPublishedAtUtc

func (x *News) GetPublishedAtUtc() *timestamppb.Timestamp

func (*News) GetTitle

func (x *News) GetTitle() string

func (*News) GetTitleWithRuby

func (x *News) GetTitleWithRuby() string

func (*News) GetUrl

func (x *News) GetUrl() string

func (*News) ProtoMessage

func (*News) ProtoMessage()

func (*News) ProtoReflect

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

func (*News) Reset

func (x *News) Reset()

func (*News) String

func (x *News) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use NewsReply.ProtoReflect.Descriptor instead.

func (*NewsReply) GetError

func (x *NewsReply) GetError() *Error

func (*NewsReply) GetNews

func (x *NewsReply) GetNews() []*News

func (*NewsReply) ProtoMessage

func (*NewsReply) ProtoMessage()

func (*NewsReply) ProtoReflect

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

func (*NewsReply) Reset

func (x *NewsReply) Reset()

func (*NewsReply) String

func (x *NewsReply) String() string

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) GetWords

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) Descriptor() ([]byte, []int)

Deprecated: Use Word.ProtoReflect.Descriptor instead.

func (*Word) GetDefinitions

func (x *Word) GetDefinitions() []*WordDefinition

func (*Word) GetIdInNews

func (x *Word) GetIdInNews() string

func (*Word) GetName

func (x *Word) GetName() string

func (*Word) ProtoMessage

func (*Word) ProtoMessage()

func (*Word) ProtoReflect

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

func (*Word) Reset

func (x *Word) Reset()

func (*Word) String

func (x *Word) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use WordReply.ProtoReflect.Descriptor instead.

func (*WordReply) GetError

func (x *WordReply) GetError() *Error

func (*WordReply) GetWords

func (x *WordReply) GetWords() []*Word

func (*WordReply) ProtoMessage

func (*WordReply) ProtoMessage()

func (*WordReply) ProtoReflect

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

func (*WordReply) Reset

func (x *WordReply) Reset()

func (*WordReply) String

func (x *WordReply) String() string

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

Jump to

Keyboard shortcuts

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