Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lwlee2608 committed Mar 31, 2024
1 parent 880de9b commit c494437
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Configurations
| VendorSpecificApplicationID | object | List of vendor-specific application IDs |
| CapabilityExchange | object | Configuration for capability exchange |
| TransportProtocol | string | Transport layer protocol to use, either "tcp" or "sctp". Defaults to "tcp" |
| TLS | object | TLS Configuration |

### Vendor Specific Application Id Config
| Field Name | Type | Description |
Expand All @@ -122,6 +123,13 @@ Configurations
| FirmwareRevision | number | Firmware revision number |
| HostIPAddresses | string array | List of host IP addresses |

### TLS Config
| Field Name | Type | Description |
| ---------- | ------- | ---------------------------------- |
| Enable | boolean | Use TLS encrypted connection |
| Cert | String | TLS certificate file, can be empty |
| Key | String | TLS private key file, can be empty |

### Example
The following example demonstrates how to create a Diameter client in k6 with various configuration options.

Expand Down
20 changes: 11 additions & 9 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ type DiameterConfig struct {
AcctApplicationID *[]uint32 `json:"acctApplicationId,omitempty"`
AuthApplicationId *[]uint32 `json:"authApplicationId,omitempty"`
VendorSpecificApplicationID *[]VendorSpecificApplicationIDConfig `json:"vendorSpecificApplicationId,omitempty"`
CapabilityExchange *CapabilityExchangeConfig `json:"capabilityExchange,omitempty"`
TransportProtocol *string `josn:"transportProtocol,omitempty"`
TLS *TLSConfig `json:"tls,omitempty"`
CapabilityExchange *CapabilityExchangeConfig `json:"capabilityExchange,omitempty"`
}

type VendorSpecificApplicationIDConfig struct {
Expand Down Expand Up @@ -111,14 +111,6 @@ func setDiameterConfigDefaults(config *DiameterConfig) {
if config.VendorSpecificApplicationID == nil {
config.VendorSpecificApplicationID = &defaultVendorSpecificApplicationID
}
if config.TransportProtocol == nil {
config.TransportProtocol = &defaultTransportProtocol
}

// Set defaults for TLSConfig
if config.TLS == nil {
config.TLS = &TLSConfig{}
}

// Set defaults for CapabilityExchangeConfig
if config.CapabilityExchange == nil {
Expand All @@ -142,6 +134,16 @@ func setDiameterConfigDefaults(config *DiameterConfig) {
if config.CapabilityExchange.HostIPAddresses == nil {
config.CapabilityExchange.HostIPAddresses = &defaultHostIPAddresses
}

if config.TransportProtocol == nil {
config.TransportProtocol = &defaultTransportProtocol
}

// Set defaults for TLSConfig
if config.TLS == nil {
config.TLS = &TLSConfig{}
}

}

type Duration struct {
Expand Down

0 comments on commit c494437

Please sign in to comment.