Sha256: bd8a72744f938efecf3f29a3d61c2933fb7dc19844315acfadfff5142cee1d7c

Contents?: true

Size: 1.79 KB

Versions: 14

Compression:

Stored size: 1.79 KB

Contents

module HTTPX
  class GRPCError < Error
    attr_reader status: Integer
    attr_reader details: String
    attr_reader metadata: headers
  end

  module Plugins
    module GRPC
      type compression_option = bool | String
      type rpc_def = [String, untyped, untyped, Hash[Symbol, untyped]]

      type grpc_message = String | _Each[String]

      type grpc_request = untyped | _Each[untyped]
      type grpc_response = untyped | _Each[untyped]

      type credentials = Proc

      interface _GRPCOptions
        def grpc_service: () -> String?

        def grpc_compression: () -> compression_option?

        def grpc_rpcs: () -> Hash[String, rpc_def]?

        def grpc_deadline: () -> Integer?

        def call_credentials: () -> credentials?
      end

      def self.extra_options: (Options) -> (Options & _GRPCOptions)
      def self.load_dependencies: (singleton(Session)) -> void

      module ResponseMethods
        attr_reader trailing_metadata: Hash[String, untyped]

        def encoders: () -> Array[String | Encoding]
      end

      module InstanceMethods
        def with_channel_credentials: (String ca_path, ?String? key, ?String? cert, **untyped) -> instance

        def rpc: (_ToS rpc_name, untyped input, untyped output, **untyped) -> instance

        def build_stub: (string origin, ?service: _ToS, ?compression: compression_option) -> instance

        def execute:  (_ToS rpc_method, grpc_message input, ?deadline: Integer, ?metadata: headers_input, **untyped) -> Call

        private

        def rpc_execute: (_ToS rpc_method, grpc_request input, **untyped) -> Call

        def build_grpc_request: (string rpc_method, grpc_message input, ?deadline: Integer, ?metadata?: headers_input, **untyped) -> Request
      end
    end

    type grpcSession = Session & GRPC::InstanceMethods
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
httpx-1.2.4 sig/plugins/grpc.rbs
httpx-1.2.3 sig/plugins/grpc.rbs
httpx-1.2.2 sig/plugins/grpc.rbs
httpx-1.2.1 sig/plugins/grpc.rbs
httpx-1.2.0 sig/plugins/grpc.rbs
httpx-1.1.5 sig/plugins/grpc.rbs
httpx-1.1.4 sig/plugins/grpc.rbs
httpx-1.1.3 sig/plugins/grpc.rbs
httpx-1.1.2 sig/plugins/grpc.rbs
httpx-1.1.1 sig/plugins/grpc.rbs
httpx-1.1.0 sig/plugins/grpc.rbs
httpx-1.0.2 sig/plugins/grpc.rbs
httpx-1.0.1 sig/plugins/grpc.rbs
httpx-1.0.0 sig/plugins/grpc.rbs