igsr5-portfolio-proto 0.0.8 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49407e2f5017873bec2c8ab134e0b0f2c872cada430a7b42a585ccb76ed14000
4
- data.tar.gz: 4f4b588cd482c451375898c17767690d277d3bc590363205e44a2ecbd7923e78
3
+ metadata.gz: 6d9dba60113ed9573f78465bf72226b4676e7a411b34bf7930252b17016e4c3c
4
+ data.tar.gz: 02e89ecdc3f2648876b7c0cdccd3fe25c4d0036d02cad31085db1fce8945572c
5
5
  SHA512:
6
- metadata.gz: 0ae8f7f939ad179b3599a21a915f60bc06d3ec568f87b8217216c824965c68c566bdd6cd5c5c7845c858b5d46a404aae2d0bb863ceb56211c693bc9bf3d65c63
7
- data.tar.gz: 72e430e71b1de1de8c5a9d192e6a7e4792f56744a73adfcd8cbb3d19f06469a29062de4ec94b717c47e400a5fa1f9cf5ae152ed81c962304a7c9c6479481cdec
6
+ metadata.gz: 5524a1483f23c89c9e5ec074230cbbd4e164bbbd6d78015b04b4d6bbb8250070d320f25d5cb0ba7ec5f6c3907d61783b38a0a501c42e78090536ff20f0f7c4c7
7
+ data.tar.gz: 676bc3fbe49df2a9c207a65458ad2442c8ab1955eb7dbae1ee971d2c4fc9d0e583907b9ef798d78bb62b5821eb28bfe62ced5d68c1dfb511bd7e3fd17a5187ca
@@ -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
+ )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Portfolio
4
- VERSION = "0.0.8"
4
+ VERSION = "0.0.11"
5
5
  end
@@ -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
@@ -7,16 +7,35 @@ 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"
14
14
  optional :site_url, :string, 4
15
15
  optional :thumbnail_url, :string, 5
16
+ optional :service_name, :string, 6
17
+ end
18
+ add_message "portfolio.blogs.BlogFromRSSItem" do
19
+ optional :id, :string, 1
20
+ optional :title, :string, 2
21
+ optional :posted_at, :message, 3, "google.protobuf.Timestamp"
22
+ optional :site_url, :string, 4
23
+ optional :thumbnail_url, :string, 5
24
+ optional :service_name, :string, 6
25
+ end
26
+ add_message "portfolio.blogs.BlogFromManualItem" do
27
+ optional :id, :string, 1
28
+ optional :title, :string, 2
29
+ optional :posted_at, :message, 3, "google.protobuf.Timestamp"
30
+ optional :site_url, :string, 4
31
+ optional :thumbnail_url, :string, 5
32
+ optional :service_name, :string, 6
16
33
  end
17
34
  end
18
35
  end
19
36
 
20
37
  module BlogsPb
21
- Blog = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("blogs.Blog").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
22
41
  end
@@ -0,0 +1,21 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: proto/blogs/rss_feed.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("proto/blogs/rss_feed.proto", :syntax => :proto3) do
8
+ add_message "portfolio.blogs.RSSFeed" do
9
+ optional :id, :string, 1
10
+ optional :url, :string, 2
11
+ end
12
+ add_message "portfolio.blogs.CreateRSSFeedRequest" do
13
+ optional :url, :string, 2
14
+ end
15
+ end
16
+ end
17
+
18
+ module RSSFeedsPb
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
+ 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.8
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - igsr5
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-17 00:00:00.000000000 Z
11
+ date: 2022-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -52,9 +52,13 @@ 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
61
+ - lib/proto/blogs/rss_feed_pb.rb
58
62
  - sig/protosum2.rbs
59
63
  homepage: https://github.com/igsr5/portfolio
60
64
  licenses: []