feat(protocol): carry complete encoded media frames
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const SchemaSHA256 = "3aec8dd72bdbb6b9657c8df3160252c93034c7c1032d471e01eae2ef91e47716"
|
||||
const SchemaSHA256 = "a86cbdaf2cfb884e3d98467968007e731ca55c6f6eb6dbd5cd6b95e062a9b058"
|
||||
const ProtocolVersion = "1.0.0"
|
||||
const CurrentWireVersion = "1"
|
||||
const NMinus1WireVersion = "0"
|
||||
@@ -851,11 +851,8 @@ func (v CapabilityProfile) Validate() error {
|
||||
if v.Framing == "" {
|
||||
violations = append(violations, FieldViolation{Field: "framing", Code: "required"})
|
||||
}
|
||||
if len(v.Framing) < 1 && v.Framing != "" {
|
||||
violations = append(violations, FieldViolation{Field: "framing", Code: "min_length"})
|
||||
}
|
||||
if len(v.Framing) > 64 {
|
||||
violations = append(violations, FieldViolation{Field: "framing", Code: "max_length"})
|
||||
if v.Framing != "" && !(v.Framing == "datagram-v1" || v.Framing == "datagram-v2") {
|
||||
violations = append(violations, FieldViolation{Field: "framing", Code: "invalid_value"})
|
||||
}
|
||||
if v.Media == "" {
|
||||
violations = append(violations, FieldViolation{Field: "media", Code: "required"})
|
||||
|
||||
+1
-1
@@ -14,5 +14,5 @@
|
||||
},
|
||||
"generator_sha256": "00fdba050eb924a54dd3d63aac0a38560341b675f0de4e3e9631ee895057a9b6",
|
||||
"protocol_version": "1.0.0",
|
||||
"schema_sha256": "3aec8dd72bdbb6b9657c8df3160252c93034c7c1032d471e01eae2ef91e47716"
|
||||
"schema_sha256": "a86cbdaf2cfb884e3d98467968007e731ca55c6f6eb6dbd5cd6b95e062a9b058"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by tools/generate.py; DO NOT EDIT.
|
||||
#![allow(non_snake_case)]
|
||||
pub const SCHEMA_SHA256: &str = "3aec8dd72bdbb6b9657c8df3160252c93034c7c1032d471e01eae2ef91e47716";
|
||||
pub const SCHEMA_SHA256: &str = "a86cbdaf2cfb884e3d98467968007e731ca55c6f6eb6dbd5cd6b95e062a9b058";
|
||||
pub const CURRENT_WIRE_VERSION: &str = "1";
|
||||
pub const N_MINUS_1_WIRE_VERSION: &str = "0";
|
||||
pub const N_MINUS_2_WIRE_VERSION: &str = "-1";
|
||||
@@ -223,9 +223,7 @@ impl CapabilityProfile {
|
||||
if self.transport.is_empty() { return Err(ValidationError::new("transport", "required")); }
|
||||
if !self.transport.is_empty() && self.transport.len() < 1 { return Err(ValidationError::new("transport", "min_length")); }
|
||||
if self.transport.len() > 64 { return Err(ValidationError::new("transport", "max_length")); }
|
||||
if self.framing.is_empty() { return Err(ValidationError::new("framing", "required")); }
|
||||
if !self.framing.is_empty() && self.framing.len() < 1 { return Err(ValidationError::new("framing", "min_length")); }
|
||||
if self.framing.len() > 64 { return Err(ValidationError::new("framing", "max_length")); }
|
||||
if self.framing != "datagram-v1" && self.framing != "datagram-v2" { return Err(ValidationError::new("framing", "invalid_value")); }
|
||||
if self.media.is_empty() { return Err(ValidationError::new("media", "required")); }
|
||||
if !self.media.is_empty() && self.media.len() < 1 { return Err(ValidationError::new("media", "min_length")); }
|
||||
if self.media.len() > 64 { return Err(ValidationError::new("media", "max_length")); }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by tools/generate.py; DO NOT EDIT.
|
||||
import Foundation
|
||||
public typealias JSONObject = [String: String]
|
||||
public let schemaSHA256 = "3aec8dd72bdbb6b9657c8df3160252c93034c7c1032d471e01eae2ef91e47716"
|
||||
public let schemaSHA256 = "a86cbdaf2cfb884e3d98467968007e731ca55c6f6eb6dbd5cd6b95e062a9b058"
|
||||
public let currentWireVersion = "1"
|
||||
public let nMinus1WireVersion = "0"
|
||||
public let nMinus2WireVersion = "-1"
|
||||
@@ -278,9 +278,7 @@ public struct CapabilityProfile: Codable, Equatable {
|
||||
if self.transport.isEmpty { throw ContractValidationError(field: "transport", code: "required") }
|
||||
if !self.transport.isEmpty && self.transport.utf8.count < 1 { throw ContractValidationError(field: "transport", code: "min_length") }
|
||||
if self.transport.utf8.count > 64 { throw ContractValidationError(field: "transport", code: "max_length") }
|
||||
if self.framing.isEmpty { throw ContractValidationError(field: "framing", code: "required") }
|
||||
if !self.framing.isEmpty && self.framing.utf8.count < 1 { throw ContractValidationError(field: "framing", code: "min_length") }
|
||||
if self.framing.utf8.count > 64 { throw ContractValidationError(field: "framing", code: "max_length") }
|
||||
if !["datagram-v1", "datagram-v2"].contains(self.framing) { throw ContractValidationError(field: "framing", code: "invalid_value") }
|
||||
if self.media.isEmpty { throw ContractValidationError(field: "media", code: "required") }
|
||||
if !self.media.isEmpty && self.media.utf8.count < 1 { throw ContractValidationError(field: "media", code: "min_length") }
|
||||
if self.media.utf8.count > 64 { throw ContractValidationError(field: "media", code: "max_length") }
|
||||
|
||||
Reference in New Issue
Block a user