@@ -609,3 +609,54 @@ func (client *GlideClusterClient) LolwutWithOptions(lolwutOptions options.Cluste
609609 }
610610 return createClusterSingleValue [string ](data ), nil
611611}
612+
613+ // Gets the current connection id.
614+ //
615+ // Return value:
616+ //
617+ // The id of the client.
618+ //
619+ // [valkey.io]: https://valkey.io/commands/client-id/
620+ func (client * GlideClusterClient ) ClientId () (ClusterValue [int64 ], error ) {
621+ response , err := client .executeCommand (C .ClientId , []string {})
622+ if err != nil {
623+ return createEmptyClusterValue [int64 ](), err
624+ }
625+ data , err := handleIntResponse (response )
626+ if err != nil {
627+ return createEmptyClusterValue [int64 ](), err
628+ }
629+ return createClusterSingleValue [int64 ](data ), nil
630+ }
631+
632+ // Gets the current connection id.
633+ //
634+ // Parameters:
635+ //
636+ // opts - Specifies the routing configuration for the command. The client will route the
637+ // command to the nodes defined by route.
638+ //
639+ // Return value:
640+ //
641+ // The id of the client.
642+ //
643+ // [valkey.io]: https://valkey.io/commands/client-id/
644+ func (client * GlideClusterClient ) ClientIdWithOptions (opts options.RouteOption ) (ClusterValue [int64 ], error ) {
645+ response , err := client .executeCommandWithRoute (C .ClientId , []string {}, opts .Route )
646+ if err != nil {
647+ return createEmptyClusterValue [int64 ](), err
648+ }
649+ if opts .Route != nil &&
650+ (opts .Route ).IsMultiNode () {
651+ data , err := handleStringIntMapResponse (response )
652+ if err != nil {
653+ return createEmptyClusterValue [int64 ](), err
654+ }
655+ return createClusterMultiValue [int64 ](data ), nil
656+ }
657+ data , err := handleIntResponse (response )
658+ if err != nil {
659+ return createEmptyClusterValue [int64 ](), err
660+ }
661+ return createClusterSingleValue [int64 ](data ), nil
662+ }
0 commit comments