feeds

package
v0.0.0-...-2610577 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package feeds is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_feeds_v1_feeds_service_proto protoreflect.FileDescriptor

Functions

func RegisterFeedsServiceHandler

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

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

func RegisterFeedsServiceHandlerClient

func RegisterFeedsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FeedsServiceClient) error

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

func RegisterFeedsServiceHandlerFromEndpoint

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

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

func RegisterFeedsServiceHandlerServer

func RegisterFeedsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FeedsServiceServer) error

RegisterFeedsServiceHandlerServer registers the http handlers for service FeedsService to "mux". UnaryRPC :call FeedsServiceServer 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 RegisterFeedsServiceHandlerFromEndpoint instead.

func RegisterFeedsServiceServer

func RegisterFeedsServiceServer(s *grpc.Server, srv FeedsServiceServer)

Types

type Feed

type Feed struct {

	// Id of the resource.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Id of user who owns this feed.
	UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// Time of the last feed fetch by the reader.
	LastFetched *timestamp.Timestamp `protobuf:"bytes,3,opt,name=last_fetched,json=lastFetched,proto3" json:"last_fetched,omitempty"`
	// Url is the feed's url.
	Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"`
	// Title is the feed's title.
	Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"`
	// Url with a feed's icon.
	IconUrl *wrappers.StringValue `protobuf:"bytes,6,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"`
	// contains filtered or unexported fields
}

func (*Feed) Descriptor deprecated

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

Deprecated: Use Feed.ProtoReflect.Descriptor instead.

func (*Feed) GetIconUrl

func (x *Feed) GetIconUrl() *wrappers.StringValue

func (*Feed) GetId

func (x *Feed) GetId() string

func (*Feed) GetLastFetched

func (x *Feed) GetLastFetched() *timestamp.Timestamp

func (*Feed) GetTitle

func (x *Feed) GetTitle() string

func (*Feed) GetUrl

func (x *Feed) GetUrl() string

func (*Feed) GetUserId

func (x *Feed) GetUserId() string

func (*Feed) ProtoMessage

func (*Feed) ProtoMessage()

func (*Feed) ProtoReflect

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

func (*Feed) Reset

func (x *Feed) Reset()

func (*Feed) String

func (x *Feed) String() string

type FeedsServiceClient

type FeedsServiceClient interface {
	GetFeed(ctx context.Context, in *GetFeedRequest, opts ...grpc.CallOption) (*Feed, error)
	ListFeeds(ctx context.Context, in *ListFeedsRequest, opts ...grpc.CallOption) (*ListFeedsResponse, error)
}

FeedsServiceClient is the client API for FeedsService 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 FeedsServiceServer

type FeedsServiceServer interface {
	GetFeed(context.Context, *GetFeedRequest) (*Feed, error)
	ListFeeds(context.Context, *ListFeedsRequest) (*ListFeedsResponse, error)
}

FeedsServiceServer is the server API for FeedsService service.

type GetFeedRequest

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

func (*GetFeedRequest) Descriptor deprecated

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

Deprecated: Use GetFeedRequest.ProtoReflect.Descriptor instead.

func (*GetFeedRequest) GetId

func (x *GetFeedRequest) GetId() string

func (*GetFeedRequest) ProtoMessage

func (*GetFeedRequest) ProtoMessage()

func (*GetFeedRequest) ProtoReflect

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

func (*GetFeedRequest) Reset

func (x *GetFeedRequest) Reset()

func (*GetFeedRequest) String

func (x *GetFeedRequest) String() string

type ListFeedsRequest

type ListFeedsRequest struct {

	// The maximum number of feeds to return.
	PageSize int64 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// The next_page_token value returned from a previous List request, if any.
	PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	// contains filtered or unexported fields
}

func (*ListFeedsRequest) Descriptor deprecated

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

Deprecated: Use ListFeedsRequest.ProtoReflect.Descriptor instead.

func (*ListFeedsRequest) GetPageSize

func (x *ListFeedsRequest) GetPageSize() int64

func (*ListFeedsRequest) GetPageToken

func (x *ListFeedsRequest) GetPageToken() string

func (*ListFeedsRequest) ProtoMessage

func (*ListFeedsRequest) ProtoMessage()

func (*ListFeedsRequest) ProtoReflect

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

func (*ListFeedsRequest) Reset

func (x *ListFeedsRequest) Reset()

func (*ListFeedsRequest) String

func (x *ListFeedsRequest) String() string

type ListFeedsResponse

type ListFeedsResponse struct {

	// There will be a maximum number of feeds returned based on the page_size field int the request.
	Feeds []*Feed `protobuf:"bytes,1,rep,name=feeds,proto3" json:"feeds,omitempty"`
	// Token to retrieve the next page of results, or empty if there are no more results in the list.
	NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	// contains filtered or unexported fields
}

func (*ListFeedsResponse) Descriptor deprecated

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

Deprecated: Use ListFeedsResponse.ProtoReflect.Descriptor instead.

func (*ListFeedsResponse) GetFeeds

func (x *ListFeedsResponse) GetFeeds() []*Feed

func (*ListFeedsResponse) GetNextPageToken

func (x *ListFeedsResponse) GetNextPageToken() string

func (*ListFeedsResponse) ProtoMessage

func (*ListFeedsResponse) ProtoMessage()

func (*ListFeedsResponse) ProtoReflect

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

func (*ListFeedsResponse) Reset

func (x *ListFeedsResponse) Reset()

func (*ListFeedsResponse) String

func (x *ListFeedsResponse) String() string

type UnimplementedFeedsServiceServer

type UnimplementedFeedsServiceServer struct {
}

UnimplementedFeedsServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedFeedsServiceServer) GetFeed

func (*UnimplementedFeedsServiceServer) ListFeeds

Jump to

Keyboard shortcuts

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