Class: QueryGuard::Uploader::Interface
- Inherits:
-
Object
- Object
- QueryGuard::Uploader::Interface
- Defined in:
- lib/query_guard/uploader/interface.rb
Overview
Abstract interface for report uploaders.
All uploaders must implement this interface. This allows:
- Pluggable upload strategies (no-op, HTTP, webhook, etc.)
- Easy testing with mock uploaders
- Future extensibility without changing core code
Example:
uploader = QueryGuard::Uploader.for_config(config)
result = uploader.upload(report_json)
Direct Known Subclasses
Instance Method Summary collapse
-
#name ⇒ String
Human-readable name of this uploader.
-
#ready? ⇒ Boolean
Check if this uploader is properly configured and ready.
-
#status ⇒ Hash
Get status/diagnostic information for logging.
-
#upload(json_report, metadata = {}) ⇒ UploadResult
Upload a JSON report to the configured destination.
Instance Method Details
#name ⇒ String
Human-readable name of this uploader.
38 39 40 |
# File 'lib/query_guard/uploader/interface.rb', line 38 def name raise NotImplementedError, "#{self.class} must implement #name" end |
#ready? ⇒ Boolean
Check if this uploader is properly configured and ready.
31 32 33 |
# File 'lib/query_guard/uploader/interface.rb', line 31 def ready? raise NotImplementedError, "#{self.class} must implement #ready?" end |
#status ⇒ Hash
Get status/diagnostic information for logging.
45 46 47 |
# File 'lib/query_guard/uploader/interface.rb', line 45 def status raise NotImplementedError, "#{self.class} must implement #status" end |
#upload(json_report, metadata = {}) ⇒ UploadResult
Upload a JSON report to the configured destination.
Should never raise. Always return an UploadResult with success/failure state.
24 25 26 |
# File 'lib/query_guard/uploader/interface.rb', line 24 def upload(json_report, = {}) raise NotImplementedError, "#{self.class} must implement #upload" end |