Skip to content

Commit

Permalink
update namespace for decoupling transport
Browse files Browse the repository at this point in the history
  • Loading branch information
ekump committed Sep 22, 2023
1 parent 86d4757 commit 7a186e3
Show file tree
Hide file tree
Showing 33 changed files with 553 additions and 451 deletions.
60 changes: 31 additions & 29 deletions sig/datadog/core/remote/transport/config.rbs
Original file line number Diff line number Diff line change
@@ -1,49 +1,51 @@
module Datadog
module Core
module Transport
module Config
# Data transfer object for encoded traces
class EncodedParcel
include Datadog::Transport::Parcel
module Remote
module Transport
module Config
# Data transfer object for encoded traces
class EncodedParcel
include Datadog::Core::Transport::Parcel

def count: () -> untyped
end
def count: () -> untyped
end

# Config request
class Request < Datadog::Transport::Request
end
# Config request
class Request < Datadog::Core::Transport::Request
end

# Config response
module Response
attr_reader roots: untyped
# Config response
module Response
attr_reader roots: untyped

attr_reader targets: untyped
attr_reader targets: untyped

attr_reader target_files: untyped
attr_reader target_files: untyped

attr_reader client_configs: untyped
attr_reader client_configs: untyped

attr_reader empty: bool
attr_reader empty: bool

def empty?: () -> bool
end
def empty?: () -> bool
end

# Config transport
class Transport
attr_reader client: untyped
# Config transport
class Transport
attr_reader client: untyped

attr_reader apis: untyped
attr_reader apis: untyped

attr_reader default_api: untyped
attr_reader default_api: untyped

attr_reader current_api_id: untyped
attr_reader current_api_id: untyped

def initialize: (untyped apis, untyped default_api) -> void
def initialize: (untyped apis, untyped default_api) -> void

# ### there is only one transport! it's negotiation!
def send_config: (untyped payload) -> untyped
# ### there is only one transport! it's negotiation!
def send_config: (untyped payload) -> untyped

def current_api: () -> untyped
def current_api: () -> untyped
end
end
end
end
Expand Down
24 changes: 13 additions & 11 deletions sig/datadog/core/remote/transport/http.rbs
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
module Datadog
module Core
module Transport
module HTTP
DO_NOT_USE_ENVIRONMENT_AGENT_SETTINGS: untyped
module Remote
module Transport
module HTTP
DO_NOT_USE_ENVIRONMENT_AGENT_SETTINGS: untyped

def self?.new: (untyped klass) ?{ (untyped) -> untyped } -> untyped
def self?.new: (untyped klass) ?{ (untyped) -> untyped } -> untyped

def self?.root: (?agent_settings: untyped, **untyped options) ?{ (untyped) -> untyped } -> untyped
def self?.root: (?agent_settings: untyped, **untyped options) ?{ (untyped) -> untyped } -> untyped

def self?.v7: (?agent_settings: untyped, **untyped options) ?{ (untyped) -> untyped } -> untyped
def self?.v7: (?agent_settings: untyped, **untyped options) ?{ (untyped) -> untyped } -> untyped

def self?.default_headers: () -> untyped
def self?.default_headers: () -> untyped

def self?.default_adapter: () -> untyped
def self?.default_adapter: () -> untyped

def self?.default_hostname: (?logger: untyped) -> untyped
def self?.default_hostname: (?logger: untyped) -> untyped

def self?.default_port: (?logger: untyped) -> untyped
def self?.default_port: (?logger: untyped) -> untyped

def self?.default_url: (?logger: untyped) -> nil
def self?.default_url: (?logger: untyped) -> nil
end
end
end
end
Expand Down
14 changes: 8 additions & 6 deletions sig/datadog/core/remote/transport/http/api.rbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
module Datadog
module Core
module Transport
module HTTP
module API
ROOT: "root"
V7: "v0.7"
module Remote
module Transport
module HTTP
module API
ROOT: "root"
V7: "v0.7"

def self?.defaults: () -> untyped
def self?.defaults: () -> untyped
end
end
end
end
Expand Down
22 changes: 12 additions & 10 deletions sig/datadog/core/remote/transport/http/api/instance.rbs
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
module Datadog
module Core
module Transport
module HTTP
module API
class Instance
attr_reader adapter: untyped
module Remote
module Transport
module HTTP
module API
class Instance
attr_reader adapter: untyped

attr_reader headers: untyped
attr_reader headers: untyped

attr_reader spec: untyped
attr_reader spec: untyped

def initialize: (untyped spec, untyped adapter, ?::Hash[untyped, untyped] options) -> void
def initialize: (untyped spec, untyped adapter, ?::Hash[untyped, untyped] options) -> void

def encoder: () -> untyped
def encoder: () -> untyped

def call: (untyped env) -> untyped
def call: (untyped env) -> untyped
end
end
end
end
Expand Down
12 changes: 7 additions & 5 deletions sig/datadog/core/remote/transport/http/api/spec.rbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module Datadog
module Core
module Transport
module HTTP
module API
class Spec
def initialize: () { (untyped) -> untyped } -> void
module Remote
module Transport
module HTTP
module API
class Spec
def initialize: () { (untyped) -> untyped } -> void
end
end
end
end
Expand Down
76 changes: 39 additions & 37 deletions sig/datadog/core/remote/transport/http/builder.rbs
Original file line number Diff line number Diff line change
@@ -1,66 +1,68 @@
module Datadog
module Core
module Transport
module HTTP
class Builder
REGISTRY: Datadog::Transport::HTTP::Adapters::Registry
module Remote
module Transport
module HTTP
class Builder
REGISTRY: Datadog::Core::Transport::HTTP::Adapters::Registry

attr_reader apis: untyped
attr_reader apis: untyped

attr_reader api_options: untyped
attr_reader api_options: untyped

attr_reader default_adapter: untyped
attr_reader default_adapter: untyped

attr_reader default_api: untyped
attr_reader default_api: untyped

attr_reader default_headers: untyped
attr_reader default_headers: untyped

def initialize: () ?{ (untyped) -> untyped } -> void
def initialize: () ?{ (untyped) -> untyped } -> void

def adapter: (untyped config, *untyped args, **untyped kwargs) -> untyped
def adapter: (untyped config, *untyped args, **untyped kwargs) -> untyped

def headers: (?::Hash[untyped, untyped] values) -> untyped
def headers: (?::Hash[untyped, untyped] values) -> untyped

def api: (untyped key, untyped spec, ?::Hash[untyped, untyped] options) -> untyped
def api: (untyped key, untyped spec, ?::Hash[untyped, untyped] options) -> untyped

def default_api=: (untyped key) -> untyped
def default_api=: (untyped key) -> untyped

def to_transport: (untyped klass) -> untyped
def to_transport: (untyped klass) -> untyped

def to_api_instances: () -> untyped
def to_api_instances: () -> untyped

def api_instance_class: () -> untyped
def api_instance_class: () -> untyped

class UnknownApiError < StandardError
attr_reader key: untyped
class UnknownApiError < StandardError
attr_reader key: untyped

def initialize: (untyped key) -> void
def initialize: (untyped key) -> void

def message: () -> ::String
end
def message: () -> ::String
end

class UnknownAdapterError < StandardError
attr_reader type: untyped
class UnknownAdapterError < StandardError
attr_reader type: untyped

def initialize: (untyped `type`) -> void
def initialize: (untyped `type`) -> void

def message: () -> ::String
end
def message: () -> ::String
end

class NoAdapterForApiError < StandardError
attr_reader key: untyped
class NoAdapterForApiError < StandardError
attr_reader key: untyped

def initialize: (untyped key) -> void
def initialize: (untyped key) -> void

def message: () -> ::String
end
def message: () -> ::String
end

class NoApisError < StandardError
def message: () -> "No APIs configured for transport!"
end
class NoApisError < StandardError
def message: () -> "No APIs configured for transport!"
end

class NoDefaultApiError < StandardError
def message: () -> "No default API configured for transport!"
class NoDefaultApiError < StandardError
def message: () -> "No default API configured for transport!"
end
end
end
end
Expand Down
16 changes: 9 additions & 7 deletions sig/datadog/core/remote/transport/http/client.rbs
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
module Datadog
module Core
module Transport
module HTTP
class Client
attr_reader api: untyped
module Remote
module Transport
module HTTP
class Client
attr_reader api: untyped

def initialize: (untyped api) -> void
def initialize: (untyped api) -> void

def send_request: (untyped request) { (untyped, untyped) -> untyped } -> untyped
def send_request: (untyped request) { (untyped, untyped) -> untyped } -> untyped

def build_env: (untyped request) -> untyped
def build_env: (untyped request) -> untyped
end
end
end
end
Expand Down
7 changes: 4 additions & 3 deletions sig/datadog/core/remote/transport/http/config.rbs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
module Datadog
module Core
module Remote
module Transport
module HTTP
# HTTP transport behavior for remote configuration
module Config
# Response from HTTP transport for remote configuration
class Response
include Datadog::Transport::HTTP::Response
include Datadog::Core::Transport::HTTP::Response

include Core::Transport::Config::Response
include Core::Remote::Transport::Config::Response

def initialize: (untyped http_response, ?::Hash[untyped, untyped] options) -> void

Expand Down Expand Up @@ -72,7 +73,7 @@ module Datadog
end

# Endpoint for remote configuration
class Endpoint < Datadog::Transport::HTTP::API::Endpoint
class Endpoint < Datadog::Core::Transport::HTTP::API::Endpoint
HEADER_CONTENT_TYPE: "Content-Type"

attr_reader encoder: untyped
Expand Down
Loading

0 comments on commit 7a186e3

Please sign in to comment.