@@ -717,7 +717,11 @@ type purgeOptions struct {
717717// $ca_cert
718718// $ciphers
719719// $sni_hostname
720- // $dont_pool))
720+ // $dont_pool
721+ // $client_cert
722+ // $grpc
723+ // $keepalive
724+ // ))
721725
722726type backendConfigOptionsMask prim.U32
723727
@@ -737,6 +741,7 @@ const (
737741 backendConfigOptionsMaskDontPool backendConfigOptionsMask = 1 << 12 // $dont_pool
738742 backendConfigOptionsMaskClientCert backendConfigOptionsMask = 1 << 13 // $client_cert
739743 backendConfigOptionsMaskGRPC backendConfigOptionsMask = 1 << 14 // $grpc
744+ backendConfigOptionsMaskKeepalive backendConfigOptionsMask = 1 << 15 // $keepalive
740745)
741746
742747// witx:
@@ -761,27 +766,37 @@ const (
761766// (field $client_certificate (@witx pointer (@witx char8)))
762767// (field $client_certificate_len u32)
763768// (field $client_key $secret_handle)
769+ // (field $http_keepalive_time_ms $timeout_ms)
770+ // (field $tcp_keepalive_enable u32)
771+ // (field $tcp_keepalive_interval_secs $timeout_secs)
772+ // (field $tcp_keepalive_probes $probe_count)
773+ // (field $tcp_keepalive_time_secs $timeout_secs)
764774// ))
765775
766776type backendConfigOptions struct {
767- hostOverridePtr prim.Pointer [prim.Char8 ]
768- hostOverrideLen prim.U32
769- connectTimeoutMs prim.U32
770- firstByteTimeout prim.U32
771- betweenBytesTimeout prim.U32
772- sslMinVersion TLSVersion
773- sslMaxVersion TLSVersion
774- certHostnamePtr prim.Pointer [prim.Char8 ]
775- certHostnameLen prim.U32
776- caCertPtr prim.Pointer [prim.Char8 ]
777- caCertLen prim.U32
778- ciphersPtr prim.Pointer [prim.Char8 ]
779- ciphersLen prim.U32
780- sniHostnamePtr prim.Pointer [prim.Char8 ]
781- sniHostnameLen prim.U32
782- clientCertPtr prim.Pointer [prim.Char8 ]
783- clientCertLen prim.U32
784- clientCertKey secretHandle
777+ hostOverridePtr prim.Pointer [prim.Char8 ]
778+ hostOverrideLen prim.U32
779+ connectTimeoutMs prim.U32
780+ firstByteTimeout prim.U32
781+ betweenBytesTimeout prim.U32
782+ sslMinVersion TLSVersion
783+ sslMaxVersion TLSVersion
784+ certHostnamePtr prim.Pointer [prim.Char8 ]
785+ certHostnameLen prim.U32
786+ caCertPtr prim.Pointer [prim.Char8 ]
787+ caCertLen prim.U32
788+ ciphersPtr prim.Pointer [prim.Char8 ]
789+ ciphersLen prim.U32
790+ sniHostnamePtr prim.Pointer [prim.Char8 ]
791+ sniHostnameLen prim.U32
792+ clientCertPtr prim.Pointer [prim.Char8 ]
793+ clientCertLen prim.U32
794+ clientCertKey secretHandle
795+ httpKeepaliveTimeMs prim.U32
796+ tcpKeepaliveEnable prim.U32
797+ tcpKeepaliveIntervalSecs prim.U32
798+ tcpKeepaliveProbes prim.U32
799+ tcpKeepaliveTimeSecs prim.U32
785800}
786801
787802// witx:
@@ -913,6 +928,40 @@ func (b *BackendConfigOptions) UseGRPC(v bool) {
913928 }
914929}
915930
931+ func (b * BackendConfigOptions ) HTTPKeepaliveTime (t time.Duration ) {
932+ b .mask |= backendConfigOptionsMaskKeepalive
933+ b .opts .httpKeepaliveTimeMs = prim .U32 (t .Milliseconds ())
934+ }
935+
936+ func (b * BackendConfigOptions ) TCPKeepaliveEnable (v bool ) {
937+ b .mask |= backendConfigOptionsMaskKeepalive
938+ if v {
939+ b .opts .tcpKeepaliveEnable = prim .U32 (1 )
940+ } else {
941+ b .opts .tcpKeepaliveEnable = prim .U32 (0 )
942+ }
943+ }
944+
945+ func (b * BackendConfigOptions ) TCPKeepaliveInterval (t time.Duration ) {
946+ b .mask |= backendConfigOptionsMaskKeepalive
947+ b .opts .tcpKeepaliveEnable = prim .U32 (1 )
948+ b .opts .tcpKeepaliveIntervalSecs = prim .U32 (t .Seconds ())
949+ }
950+
951+ func (b * BackendConfigOptions ) TCPKeepaliveProbes (count uint32 ) {
952+ if count > 0 {
953+ b .mask |= backendConfigOptionsMaskKeepalive
954+ b .opts .tcpKeepaliveEnable = prim .U32 (1 )
955+ b .opts .tcpKeepaliveProbes = prim .U32 (count )
956+ }
957+ }
958+
959+ func (b * BackendConfigOptions ) TCPKeepaliveTime (t time.Duration ) {
960+ b .mask |= backendConfigOptionsMaskKeepalive
961+ b .opts .tcpKeepaliveEnable = prim .U32 (1 )
962+ b .opts .tcpKeepaliveTimeSecs = prim .U32 (t .Seconds ())
963+ }
964+
916965// witx:
917966//
918967// (typename $send_error_detail_tag
0 commit comments