igsr5-portfolio-proto 0.0.10 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/api/api.pb.gw.go +172 -0
- data/lib/portfolio/version.rb +1 -1
- data/lib/proto/api_pb.rb +16 -0
- data/lib/proto/api_services_pb.rb +22 -0
- data/lib/proto/blogs/blog_pb.rb +6 -6
- data/lib/proto/blogs/rss_feed_pb.rb +4 -4
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3491edb1b19ecdf94f0c175c61e0b5759fc5c3ecb4ca3c29b36eb8b289552d6
|
4
|
+
data.tar.gz: b870f6ab973761fc97f6bd00e70485aedb80d3f3911bb92cf26251aa9f68b1a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae61a3a99f5a189ac01fff867f6edf928e07315e91861b7e1cdb05a77243b14f6a6c41a2cfb669143a5d2645ecf3f3981d3b79c5ceadd57427029e0cfea51944
|
7
|
+
data.tar.gz: 5263fffb5aed9084a69f2a84d7c3cd0d072abe4cff45b4795432c43b8b80e15e1b3c091374955d3d7b09cdc339adb2f75591dca168a03d01ab1e7b0f8d226a7b
|
@@ -0,0 +1,172 @@
|
|
1
|
+
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
2
|
+
// source: proto/api.proto
|
3
|
+
|
4
|
+
/*
|
5
|
+
Package api_pb is a reverse proxy.
|
6
|
+
|
7
|
+
It translates gRPC into RESTful JSON APIs.
|
8
|
+
*/
|
9
|
+
package api_pb
|
10
|
+
|
11
|
+
import (
|
12
|
+
"/blogs/rss_feed"
|
13
|
+
"context"
|
14
|
+
"io"
|
15
|
+
"net/http"
|
16
|
+
|
17
|
+
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
18
|
+
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
|
19
|
+
"google.golang.org/grpc"
|
20
|
+
"google.golang.org/grpc/codes"
|
21
|
+
"google.golang.org/grpc/grpclog"
|
22
|
+
"google.golang.org/grpc/metadata"
|
23
|
+
"google.golang.org/grpc/status"
|
24
|
+
"google.golang.org/protobuf/proto"
|
25
|
+
)
|
26
|
+
|
27
|
+
// Suppress "imported and not used" errors
|
28
|
+
var _ codes.Code
|
29
|
+
var _ io.Reader
|
30
|
+
var _ status.Status
|
31
|
+
var _ = runtime.String
|
32
|
+
var _ = utilities.NewDoubleArray
|
33
|
+
var _ = metadata.Join
|
34
|
+
|
35
|
+
var (
|
36
|
+
filter_PortfolioBackendApi_CreateRSSFeed_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
37
|
+
)
|
38
|
+
|
39
|
+
func request_PortfolioBackendApi_CreateRSSFeed_0(ctx context.Context, marshaler runtime.Marshaler, client PortfolioBackendApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
40
|
+
var protoReq rss_feeds_pb.CreateRSSFeedRequest
|
41
|
+
var metadata runtime.ServerMetadata
|
42
|
+
|
43
|
+
if err := req.ParseForm(); err != nil {
|
44
|
+
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
45
|
+
}
|
46
|
+
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PortfolioBackendApi_CreateRSSFeed_0); err != nil {
|
47
|
+
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
48
|
+
}
|
49
|
+
|
50
|
+
msg, err := client.CreateRSSFeed(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
51
|
+
return msg, metadata, err
|
52
|
+
|
53
|
+
}
|
54
|
+
|
55
|
+
func local_request_PortfolioBackendApi_CreateRSSFeed_0(ctx context.Context, marshaler runtime.Marshaler, server PortfolioBackendApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
56
|
+
var protoReq rss_feeds_pb.CreateRSSFeedRequest
|
57
|
+
var metadata runtime.ServerMetadata
|
58
|
+
|
59
|
+
if err := req.ParseForm(); err != nil {
|
60
|
+
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
61
|
+
}
|
62
|
+
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PortfolioBackendApi_CreateRSSFeed_0); err != nil {
|
63
|
+
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
64
|
+
}
|
65
|
+
|
66
|
+
msg, err := server.CreateRSSFeed(ctx, &protoReq)
|
67
|
+
return msg, metadata, err
|
68
|
+
|
69
|
+
}
|
70
|
+
|
71
|
+
// RegisterPortfolioBackendApiHandlerServer registers the http handlers for service PortfolioBackendApi to "mux".
|
72
|
+
// UnaryRPC :call PortfolioBackendApiServer directly.
|
73
|
+
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
74
|
+
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPortfolioBackendApiHandlerFromEndpoint instead.
|
75
|
+
func RegisterPortfolioBackendApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PortfolioBackendApiServer) error {
|
76
|
+
|
77
|
+
mux.Handle("POST", pattern_PortfolioBackendApi_CreateRSSFeed_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
78
|
+
ctx, cancel := context.WithCancel(req.Context())
|
79
|
+
defer cancel()
|
80
|
+
var stream runtime.ServerTransportStream
|
81
|
+
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
82
|
+
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
83
|
+
var err error
|
84
|
+
ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/portfolio.PortfolioBackendApi/CreateRSSFeed", runtime.WithHTTPPathPattern("/rss_feeds"))
|
85
|
+
if err != nil {
|
86
|
+
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
87
|
+
return
|
88
|
+
}
|
89
|
+
resp, md, err := local_request_PortfolioBackendApi_CreateRSSFeed_0(ctx, inboundMarshaler, server, req, pathParams)
|
90
|
+
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
91
|
+
ctx = runtime.NewServerMetadataContext(ctx, md)
|
92
|
+
if err != nil {
|
93
|
+
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
94
|
+
return
|
95
|
+
}
|
96
|
+
|
97
|
+
forward_PortfolioBackendApi_CreateRSSFeed_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
98
|
+
|
99
|
+
})
|
100
|
+
|
101
|
+
return nil
|
102
|
+
}
|
103
|
+
|
104
|
+
// RegisterPortfolioBackendApiHandlerFromEndpoint is same as RegisterPortfolioBackendApiHandler but
|
105
|
+
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
106
|
+
func RegisterPortfolioBackendApiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
107
|
+
conn, err := grpc.Dial(endpoint, opts...)
|
108
|
+
if err != nil {
|
109
|
+
return err
|
110
|
+
}
|
111
|
+
defer func() {
|
112
|
+
if err != nil {
|
113
|
+
if cerr := conn.Close(); cerr != nil {
|
114
|
+
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
115
|
+
}
|
116
|
+
return
|
117
|
+
}
|
118
|
+
go func() {
|
119
|
+
<-ctx.Done()
|
120
|
+
if cerr := conn.Close(); cerr != nil {
|
121
|
+
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
122
|
+
}
|
123
|
+
}()
|
124
|
+
}()
|
125
|
+
|
126
|
+
return RegisterPortfolioBackendApiHandler(ctx, mux, conn)
|
127
|
+
}
|
128
|
+
|
129
|
+
// RegisterPortfolioBackendApiHandler registers the http handlers for service PortfolioBackendApi to "mux".
|
130
|
+
// The handlers forward requests to the grpc endpoint over "conn".
|
131
|
+
func RegisterPortfolioBackendApiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
132
|
+
return RegisterPortfolioBackendApiHandlerClient(ctx, mux, NewPortfolioBackendApiClient(conn))
|
133
|
+
}
|
134
|
+
|
135
|
+
// RegisterPortfolioBackendApiHandlerClient registers the http handlers for service PortfolioBackendApi
|
136
|
+
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PortfolioBackendApiClient".
|
137
|
+
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PortfolioBackendApiClient"
|
138
|
+
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
139
|
+
// "PortfolioBackendApiClient" to call the correct interceptors.
|
140
|
+
func RegisterPortfolioBackendApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PortfolioBackendApiClient) error {
|
141
|
+
|
142
|
+
mux.Handle("POST", pattern_PortfolioBackendApi_CreateRSSFeed_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
143
|
+
ctx, cancel := context.WithCancel(req.Context())
|
144
|
+
defer cancel()
|
145
|
+
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
146
|
+
var err error
|
147
|
+
ctx, err = runtime.AnnotateContext(ctx, mux, req, "/portfolio.PortfolioBackendApi/CreateRSSFeed", runtime.WithHTTPPathPattern("/rss_feeds"))
|
148
|
+
if err != nil {
|
149
|
+
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
150
|
+
return
|
151
|
+
}
|
152
|
+
resp, md, err := request_PortfolioBackendApi_CreateRSSFeed_0(ctx, inboundMarshaler, client, req, pathParams)
|
153
|
+
ctx = runtime.NewServerMetadataContext(ctx, md)
|
154
|
+
if err != nil {
|
155
|
+
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
156
|
+
return
|
157
|
+
}
|
158
|
+
|
159
|
+
forward_PortfolioBackendApi_CreateRSSFeed_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
160
|
+
|
161
|
+
})
|
162
|
+
|
163
|
+
return nil
|
164
|
+
}
|
165
|
+
|
166
|
+
var (
|
167
|
+
pattern_PortfolioBackendApi_CreateRSSFeed_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"rss_feeds"}, ""))
|
168
|
+
)
|
169
|
+
|
170
|
+
var (
|
171
|
+
forward_PortfolioBackendApi_CreateRSSFeed_0 = runtime.ForwardResponseMessage
|
172
|
+
)
|
data/lib/portfolio/version.rb
CHANGED
data/lib/proto/api_pb.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: proto/api.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/annotations_pb'
|
7
|
+
require 'google/protobuf/empty_pb'
|
8
|
+
require 'proto/blogs/rss_feed_pb'
|
9
|
+
|
10
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
11
|
+
add_file("proto/api.proto", :syntax => :proto3) do
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
module ApiPb
|
16
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: proto/api.proto for package 'ApiPb'
|
3
|
+
|
4
|
+
require 'grpc'
|
5
|
+
require 'proto/api_pb'
|
6
|
+
|
7
|
+
module ApiPb
|
8
|
+
module PortfolioBackendApi
|
9
|
+
class Service
|
10
|
+
|
11
|
+
include ::GRPC::GenericService
|
12
|
+
|
13
|
+
self.marshal_class_method = :encode
|
14
|
+
self.unmarshal_class_method = :decode
|
15
|
+
self.service_name = 'portfolio.PortfolioBackendApi'
|
16
|
+
|
17
|
+
rpc :CreateRSSFeed, ::RSSFeedsPb::CreateRSSFeedRequest, ::Google::Protobuf::Empty
|
18
|
+
end
|
19
|
+
|
20
|
+
Stub = Service.rpc_stub_class
|
21
|
+
end
|
22
|
+
end
|
data/lib/proto/blogs/blog_pb.rb
CHANGED
@@ -7,7 +7,7 @@ require 'google/protobuf/timestamp_pb'
|
|
7
7
|
|
8
8
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
9
|
add_file("proto/blogs/blog.proto", :syntax => :proto3) do
|
10
|
-
add_message "blogs.Blog" do
|
10
|
+
add_message "portfolio.blogs.Blog" do
|
11
11
|
optional :id, :string, 1
|
12
12
|
optional :title, :string, 2
|
13
13
|
optional :posted_at, :message, 3, "google.protobuf.Timestamp"
|
@@ -15,7 +15,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
15
15
|
optional :thumbnail_url, :string, 5
|
16
16
|
optional :service_name, :string, 6
|
17
17
|
end
|
18
|
-
add_message "blogs.BlogFromRSSItem" do
|
18
|
+
add_message "portfolio.blogs.BlogFromRSSItem" do
|
19
19
|
optional :id, :string, 1
|
20
20
|
optional :title, :string, 2
|
21
21
|
optional :posted_at, :message, 3, "google.protobuf.Timestamp"
|
@@ -23,7 +23,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
23
23
|
optional :thumbnail_url, :string, 5
|
24
24
|
optional :service_name, :string, 6
|
25
25
|
end
|
26
|
-
add_message "blogs.BlogFromManualItem" do
|
26
|
+
add_message "portfolio.blogs.BlogFromManualItem" do
|
27
27
|
optional :id, :string, 1
|
28
28
|
optional :title, :string, 2
|
29
29
|
optional :posted_at, :message, 3, "google.protobuf.Timestamp"
|
@@ -35,7 +35,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
module BlogsPb
|
38
|
-
Blog = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("blogs.Blog").msgclass
|
39
|
-
BlogFromRSSItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("blogs.BlogFromRSSItem").msgclass
|
40
|
-
BlogFromManualItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("blogs.BlogFromManualItem").msgclass
|
38
|
+
Blog = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("portfolio.blogs.Blog").msgclass
|
39
|
+
BlogFromRSSItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("portfolio.blogs.BlogFromRSSItem").msgclass
|
40
|
+
BlogFromManualItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("portfolio.blogs.BlogFromManualItem").msgclass
|
41
41
|
end
|
@@ -5,17 +5,17 @@ require 'google/protobuf'
|
|
5
5
|
|
6
6
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
7
|
add_file("proto/blogs/rss_feed.proto", :syntax => :proto3) do
|
8
|
-
add_message "blogs.RSSFeed" do
|
8
|
+
add_message "portfolio.blogs.RSSFeed" do
|
9
9
|
optional :id, :string, 1
|
10
10
|
optional :url, :string, 2
|
11
11
|
end
|
12
|
-
add_message "blogs.CreateRSSFeedRequest" do
|
12
|
+
add_message "portfolio.blogs.CreateRSSFeedRequest" do
|
13
13
|
optional :url, :string, 2
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
module RSSFeedsPb
|
19
|
-
RSSFeed = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("blogs.RSSFeed").msgclass
|
20
|
-
CreateRSSFeedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("blogs.CreateRSSFeedRequest").msgclass
|
19
|
+
RSSFeed = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("portfolio.blogs.RSSFeed").msgclass
|
20
|
+
CreateRSSFeedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("portfolio.blogs.CreateRSSFeedRequest").msgclass
|
21
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: igsr5-portfolio-proto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- igsr5
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -52,8 +52,11 @@ files:
|
|
52
52
|
- Rakefile
|
53
53
|
- bin/console
|
54
54
|
- bin/setup
|
55
|
+
- lib/api/api.pb.gw.go
|
55
56
|
- lib/portfolio.rb
|
56
57
|
- lib/portfolio/version.rb
|
58
|
+
- lib/proto/api_pb.rb
|
59
|
+
- lib/proto/api_services_pb.rb
|
57
60
|
- lib/proto/blogs/blog_pb.rb
|
58
61
|
- lib/proto/blogs/rss_feed_pb.rb
|
59
62
|
- sig/protosum2.rbs
|