module HTTPX::Plugins::GRPC

  1. lib/httpx/plugins/grpc.rb
  2. lib/httpx/plugins/grpc/call.rb
  3. lib/httpx/plugins/grpc/message.rb
  4. show all

This plugin adds DSL to build GRPC interfaces.

gitlab.com/os85/httpx/wikis/GRPC

Constants

DEADLINE = 60  
HEADERS = { "content-type" => "application/grpc", "te" => "trailers", "accept" => "application/grpc", # metadata fits here # ex "foo-bin" => base64("bar") }.freeze  
MARSHAL_METHOD = :encode  
UNMARSHAL_METHOD = :decode  

Public Class methods

configure(klass)
[show source]
   # File lib/httpx/plugins/grpc.rb
57 def configure(klass)
58   klass.plugin(:persistent)
59   klass.plugin(:stream)
60 end
extra_options(options)
[show source]
   # File lib/httpx/plugins/grpc.rb
62 def extra_options(options)
63   options.merge(
64     fallback_protocol: "h2",
65     grpc_rpcs: {}.freeze,
66     grpc_compression: false,
67     grpc_deadline: DEADLINE
68   )
69 end
load_dependencies(*)
[show source]
   # File lib/httpx/plugins/grpc.rb
50 def load_dependencies(*)
51   require "stringio"
52   require "httpx/plugins/grpc/grpc_encoding"
53   require "httpx/plugins/grpc/message"
54   require "httpx/plugins/grpc/call"
55 end