[{"data":1,"prerenderedAt":2497},["ShallowReactive",2],{"docs:/docs/sdks/go":3},{"id":4,"title":5,"body":6,"description":2490,"extension":2491,"meta":2492,"navigation":75,"path":2493,"seo":2494,"stem":2495,"__hash__":2496},"docs/docs/sdks/go.md","Go SDK",{"type":7,"value":8,"toc":2469},"minimark",[9,13,17,22,52,56,283,287,377,381,395,509,513,526,602,606,622,781,785,803,894,898,1072,1076,1210,1214,1217,1246,1257,1262,1352,1358,1461,1483,1487,1701,1705,1708,1952,1956,1959,2146,2150,2153,2226,2230,2425,2429,2440,2444,2465],[10,11,5],"h1",{"id":12},"go-sdk",[14,15,16],"p",{},"The official NoLag SDK for Go. Idiomatic Go client with goroutines\nand channels support.",[18,19,21],"h2",{"id":20},"installation","Installation",[23,24,25],"code-tabs",{},[26,27,33],"pre",{"className":28,"code":29,"filename":30,"language":31,"meta":32,"style":32},"language-bash shiki shiki-themes github-light github-dark","go get github.com/NoLagApp/go-sdk\n","Terminal","bash","",[34,35,36],"code",{"__ignoreMap":32},[37,38,41,45,49],"span",{"class":39,"line":40},"line",1,[37,42,44],{"class":43},"sScJk","go",[37,46,48],{"class":47},"sZZnC"," get",[37,50,51],{"class":47}," github.com/NoLagApp/go-sdk\n",[18,53,55],{"id":54},"quick-start","Quick Start",[23,57,58],{},[26,59,63],{"className":60,"code":61,"filename":62,"language":44,"meta":32,"style":32},"language-go shiki shiki-themes github-light github-dark","package main\n\nimport (\n    \"fmt\"\n    \"time\"\n\n    nolag \"github.com/NoLagApp/go-sdk\"\n)\n\nfunc main() {\n    // Create client with your actor token\n    client := nolag.New(\"your-actor-token\")\n\n    // Connect to NoLag\n    if err := client.Connect(); err != nil {\n        panic(err)\n    }\n    defer client.Close()\n\n    // Subscribe to a topic\n    err := client.Subscribe(\"my-topic\", func(data any, meta nolag.MessageMeta) {\n        fmt.Printf(\"Received: %v\\n\", data)\n    })\n    if err != nil {\n        panic(err)\n    }\n\n    // Publish a message\n    if err := client.Emit(\"my-topic\", map[string]any{\"hello\": \"world\"}); err != nil {\n        fmt.Printf(\"Emit failed: %v\\n\", err)\n    }\n\n    // Get actor ID assigned by server\n    fmt.Println(\"Actor ID:\", client.ActorID())\n\n    // Keep running\n    time.Sleep(60 * time.Second)\n}\n","Go",[34,64,65,70,77,83,89,95,100,106,112,117,123,129,135,140,146,152,158,164,170,175,181,187,193,199,205,210,215,220,226,232,238,243,248,254,260,265,271,277],{"__ignoreMap":32},[37,66,67],{"class":39,"line":40},[37,68,69],{},"package main\n",[37,71,73],{"class":39,"line":72},2,[37,74,76],{"emptyLinePlaceholder":75},true,"\n",[37,78,80],{"class":39,"line":79},3,[37,81,82],{},"import (\n",[37,84,86],{"class":39,"line":85},4,[37,87,88],{},"    \"fmt\"\n",[37,90,92],{"class":39,"line":91},5,[37,93,94],{},"    \"time\"\n",[37,96,98],{"class":39,"line":97},6,[37,99,76],{"emptyLinePlaceholder":75},[37,101,103],{"class":39,"line":102},7,[37,104,105],{},"    nolag \"github.com/NoLagApp/go-sdk\"\n",[37,107,109],{"class":39,"line":108},8,[37,110,111],{},")\n",[37,113,115],{"class":39,"line":114},9,[37,116,76],{"emptyLinePlaceholder":75},[37,118,120],{"class":39,"line":119},10,[37,121,122],{},"func main() {\n",[37,124,126],{"class":39,"line":125},11,[37,127,128],{},"    // Create client with your actor token\n",[37,130,132],{"class":39,"line":131},12,[37,133,134],{},"    client := nolag.New(\"your-actor-token\")\n",[37,136,138],{"class":39,"line":137},13,[37,139,76],{"emptyLinePlaceholder":75},[37,141,143],{"class":39,"line":142},14,[37,144,145],{},"    // Connect to NoLag\n",[37,147,149],{"class":39,"line":148},15,[37,150,151],{},"    if err := client.Connect(); err != nil {\n",[37,153,155],{"class":39,"line":154},16,[37,156,157],{},"        panic(err)\n",[37,159,161],{"class":39,"line":160},17,[37,162,163],{},"    }\n",[37,165,167],{"class":39,"line":166},18,[37,168,169],{},"    defer client.Close()\n",[37,171,173],{"class":39,"line":172},19,[37,174,76],{"emptyLinePlaceholder":75},[37,176,178],{"class":39,"line":177},20,[37,179,180],{},"    // Subscribe to a topic\n",[37,182,184],{"class":39,"line":183},21,[37,185,186],{},"    err := client.Subscribe(\"my-topic\", func(data any, meta nolag.MessageMeta) {\n",[37,188,190],{"class":39,"line":189},22,[37,191,192],{},"        fmt.Printf(\"Received: %v\\n\", data)\n",[37,194,196],{"class":39,"line":195},23,[37,197,198],{},"    })\n",[37,200,202],{"class":39,"line":201},24,[37,203,204],{},"    if err != nil {\n",[37,206,208],{"class":39,"line":207},25,[37,209,157],{},[37,211,213],{"class":39,"line":212},26,[37,214,163],{},[37,216,218],{"class":39,"line":217},27,[37,219,76],{"emptyLinePlaceholder":75},[37,221,223],{"class":39,"line":222},28,[37,224,225],{},"    // Publish a message\n",[37,227,229],{"class":39,"line":228},29,[37,230,231],{},"    if err := client.Emit(\"my-topic\", map[string]any{\"hello\": \"world\"}); err != nil {\n",[37,233,235],{"class":39,"line":234},30,[37,236,237],{},"        fmt.Printf(\"Emit failed: %v\\n\", err)\n",[37,239,241],{"class":39,"line":240},31,[37,242,163],{},[37,244,246],{"class":39,"line":245},32,[37,247,76],{"emptyLinePlaceholder":75},[37,249,251],{"class":39,"line":250},33,[37,252,253],{},"    // Get actor ID assigned by server\n",[37,255,257],{"class":39,"line":256},34,[37,258,259],{},"    fmt.Println(\"Actor ID:\", client.ActorID())\n",[37,261,263],{"class":39,"line":262},35,[37,264,76],{"emptyLinePlaceholder":75},[37,266,268],{"class":39,"line":267},36,[37,269,270],{},"    // Keep running\n",[37,272,274],{"class":39,"line":273},37,[37,275,276],{},"    time.Sleep(60 * time.Second)\n",[37,278,280],{"class":39,"line":279},38,[37,281,282],{},"}\n",[18,284,286],{"id":285},"configuration","Configuration",[23,288,289],{},[26,290,292],{"className":60,"code":291,"filename":62,"language":44,"meta":32,"style":32},"import (\n    \"time\"\n    nolag \"github.com/NoLagApp/go-sdk\"\n)\n\noptions := nolag.Options{\n    URL:                  \"wss://broker.nolag.app/ws\", // Custom broker URL\n    Reconnect:            true,                         // Auto-reconnect (default: true)\n    ReconnectInterval:    5 * time.Second,              // Reconnect interval (default: 5s)\n    MaxReconnectAttempts: 10,                           // Max attempts, 0 = infinite (default: 10)\n    HeartbeatInterval:    30 * time.Second,             // Heartbeat interval, 0 to disable (default: 30s)\n    LoadBalance:          true,                         // Enable load balancing (default: false)\n    LoadBalanceGroup:     \"workers\",                    // Load balance group name\n    ActorTokenID:         \"custom-id\",                  // Optional actor token identifier\n    Debug:                true,                         // Enable debug logging (default: false)\n}\n\nclient := nolag.New(\"your-actor-token\", options)\n",[34,293,294,298,302,306,310,314,319,324,329,334,339,344,349,354,359,364,368,372],{"__ignoreMap":32},[37,295,296],{"class":39,"line":40},[37,297,82],{},[37,299,300],{"class":39,"line":72},[37,301,94],{},[37,303,304],{"class":39,"line":79},[37,305,105],{},[37,307,308],{"class":39,"line":85},[37,309,111],{},[37,311,312],{"class":39,"line":91},[37,313,76],{"emptyLinePlaceholder":75},[37,315,316],{"class":39,"line":97},[37,317,318],{},"options := nolag.Options{\n",[37,320,321],{"class":39,"line":102},[37,322,323],{},"    URL:                  \"wss://broker.nolag.app/ws\", // Custom broker URL\n",[37,325,326],{"class":39,"line":108},[37,327,328],{},"    Reconnect:            true,                         // Auto-reconnect (default: true)\n",[37,330,331],{"class":39,"line":114},[37,332,333],{},"    ReconnectInterval:    5 * time.Second,              // Reconnect interval (default: 5s)\n",[37,335,336],{"class":39,"line":119},[37,337,338],{},"    MaxReconnectAttempts: 10,                           // Max attempts, 0 = infinite (default: 10)\n",[37,340,341],{"class":39,"line":125},[37,342,343],{},"    HeartbeatInterval:    30 * time.Second,             // Heartbeat interval, 0 to disable (default: 30s)\n",[37,345,346],{"class":39,"line":131},[37,347,348],{},"    LoadBalance:          true,                         // Enable load balancing (default: false)\n",[37,350,351],{"class":39,"line":137},[37,352,353],{},"    LoadBalanceGroup:     \"workers\",                    // Load balance group name\n",[37,355,356],{"class":39,"line":142},[37,357,358],{},"    ActorTokenID:         \"custom-id\",                  // Optional actor token identifier\n",[37,360,361],{"class":39,"line":148},[37,362,363],{},"    Debug:                true,                         // Enable debug logging (default: false)\n",[37,365,366],{"class":39,"line":154},[37,367,282],{},[37,369,370],{"class":39,"line":160},[37,371,76],{"emptyLinePlaceholder":75},[37,373,374],{"class":39,"line":166},[37,375,376],{},"client := nolag.New(\"your-actor-token\", options)\n",[18,378,380],{"id":379},"subscribing-to-topics","Subscribing to Topics",[14,382,383,386,387,390,391,394],{},[34,384,385],{},"Subscribe",", ",[34,388,389],{},"Unsubscribe",", and all filter methods return ",[34,392,393],{},"error",".\nAlways check the returned error.",[23,396,397],{},[26,398,400],{"className":60,"code":399,"filename":62,"language":44,"meta":32,"style":32},"// Basic subscription. Subscribe returns an error\nerr := client.Subscribe(\"chat/messages\", func(data any, meta nolag.MessageMeta) {\n    fmt.Printf(\"Message from %s: %v\\n\", meta.Sender, data)\n})\nif err != nil {\n    fmt.Printf(\"Subscribe failed: %v\\n\", err)\n}\n\n// With options (load balancing + filters)\nloadBalance := true\nerr = client.Subscribe(\"tasks\", handler, nolag.SubscribeOptions{\n    LoadBalance:      &loadBalance,\n    LoadBalanceGroup: \"workers\",\n    Filters:          []any{\"priority:high\", \"region:us\"},\n})\nif err != nil {\n    fmt.Printf(\"Subscribe failed: %v\\n\", err)\n}\n\n// Unsubscribe (also returns an error)\nif err := client.Unsubscribe(\"chat/messages\"); err != nil {\n    fmt.Printf(\"Unsubscribe failed: %v\\n\", err)\n}\n",[34,401,402,407,412,417,422,427,432,436,440,445,450,455,460,465,470,474,478,482,486,490,495,500,505],{"__ignoreMap":32},[37,403,404],{"class":39,"line":40},[37,405,406],{},"// Basic subscription. Subscribe returns an error\n",[37,408,409],{"class":39,"line":72},[37,410,411],{},"err := client.Subscribe(\"chat/messages\", func(data any, meta nolag.MessageMeta) {\n",[37,413,414],{"class":39,"line":79},[37,415,416],{},"    fmt.Printf(\"Message from %s: %v\\n\", meta.Sender, data)\n",[37,418,419],{"class":39,"line":85},[37,420,421],{},"})\n",[37,423,424],{"class":39,"line":91},[37,425,426],{},"if err != nil {\n",[37,428,429],{"class":39,"line":97},[37,430,431],{},"    fmt.Printf(\"Subscribe failed: %v\\n\", err)\n",[37,433,434],{"class":39,"line":102},[37,435,282],{},[37,437,438],{"class":39,"line":108},[37,439,76],{"emptyLinePlaceholder":75},[37,441,442],{"class":39,"line":114},[37,443,444],{},"// With options (load balancing + filters)\n",[37,446,447],{"class":39,"line":119},[37,448,449],{},"loadBalance := true\n",[37,451,452],{"class":39,"line":125},[37,453,454],{},"err = client.Subscribe(\"tasks\", handler, nolag.SubscribeOptions{\n",[37,456,457],{"class":39,"line":131},[37,458,459],{},"    LoadBalance:      &loadBalance,\n",[37,461,462],{"class":39,"line":137},[37,463,464],{},"    LoadBalanceGroup: \"workers\",\n",[37,466,467],{"class":39,"line":142},[37,468,469],{},"    Filters:          []any{\"priority:high\", \"region:us\"},\n",[37,471,472],{"class":39,"line":148},[37,473,421],{},[37,475,476],{"class":39,"line":154},[37,477,426],{},[37,479,480],{"class":39,"line":160},[37,481,431],{},[37,483,484],{"class":39,"line":166},[37,485,282],{},[37,487,488],{"class":39,"line":172},[37,489,76],{"emptyLinePlaceholder":75},[37,491,492],{"class":39,"line":177},[37,493,494],{},"// Unsubscribe (also returns an error)\n",[37,496,497],{"class":39,"line":183},[37,498,499],{},"if err := client.Unsubscribe(\"chat/messages\"); err != nil {\n",[37,501,502],{"class":39,"line":189},[37,503,504],{},"    fmt.Printf(\"Unsubscribe failed: %v\\n\", err)\n",[37,506,507],{"class":39,"line":195},[37,508,282],{},[18,510,512],{"id":511},"publishing-messages","Publishing Messages",[14,514,515,518,519,521,522,525],{},[34,516,517],{},"Emit"," returns an ",[34,520,393],{},". Use ",[34,523,524],{},"EmitOptions"," to set retain, echo,\nand filter targeting.",[23,527,528],{},[26,529,531],{"className":60,"code":530,"filename":62,"language":44,"meta":32,"style":32},"// Publish any data (maps, structs, strings, etc.). Emit returns an error\nif err := client.Emit(\"chat/messages\", map[string]any{\"text\": \"Hello!\"}); err != nil {\n    fmt.Printf(\"Emit failed: %v\\n\", err)\n}\n\n// With options\necho := false\nerr := client.Emit(\"status\", map[string]any{\"online\": true}, nolag.EmitOptions{\n    Retain: true,     // Retain last message for new subscribers\n    Echo:   &echo,    // Don't receive this message back (default: true)\n    Filter: \"room-1\", // Target specific filter subscribers\n})\nif err != nil {\n    fmt.Printf(\"Emit failed: %v\\n\", err)\n}\n",[34,532,533,538,543,548,552,556,561,566,571,576,581,586,590,594,598],{"__ignoreMap":32},[37,534,535],{"class":39,"line":40},[37,536,537],{},"// Publish any data (maps, structs, strings, etc.). Emit returns an error\n",[37,539,540],{"class":39,"line":72},[37,541,542],{},"if err := client.Emit(\"chat/messages\", map[string]any{\"text\": \"Hello!\"}); err != nil {\n",[37,544,545],{"class":39,"line":79},[37,546,547],{},"    fmt.Printf(\"Emit failed: %v\\n\", err)\n",[37,549,550],{"class":39,"line":85},[37,551,282],{},[37,553,554],{"class":39,"line":91},[37,555,76],{"emptyLinePlaceholder":75},[37,557,558],{"class":39,"line":97},[37,559,560],{},"// With options\n",[37,562,563],{"class":39,"line":102},[37,564,565],{},"echo := false\n",[37,567,568],{"class":39,"line":108},[37,569,570],{},"err := client.Emit(\"status\", map[string]any{\"online\": true}, nolag.EmitOptions{\n",[37,572,573],{"class":39,"line":114},[37,574,575],{},"    Retain: true,     // Retain last message for new subscribers\n",[37,577,578],{"class":39,"line":119},[37,579,580],{},"    Echo:   &echo,    // Don't receive this message back (default: true)\n",[37,582,583],{"class":39,"line":125},[37,584,585],{},"    Filter: \"room-1\", // Target specific filter subscribers\n",[37,587,588],{"class":39,"line":131},[37,589,421],{},[37,591,592],{"class":39,"line":137},[37,593,426],{},[37,595,596],{"class":39,"line":142},[37,597,547],{},[37,599,600],{"class":39,"line":148},[37,601,282],{},[18,603,605],{"id":604},"fluent-api-setapp-setroom","Fluent API (SetApp / SetRoom)",[14,607,608,609,613,614,617,618,621],{},"The fluent API scopes all operations to an ",[610,611,612],"strong",{},"app/room"," pair.\nTopics are automatically prefixed, so ",[34,615,616],{},"room.Emit(\"messages\", ...)"," publishes\nto ",[34,619,620],{},"\"chat/general/messages\"",".",[23,623,624],{},[26,625,627],{"className":60,"code":626,"filename":62,"language":44,"meta":32,"style":32},"// The fluent API scopes operations to an app/room.\n// Topics are automatically prefixed with \"app/room/\".\nroom := client.SetApp(\"chat\").SetRoom(\"general\")\n\n// Subscribe: topic becomes \"chat/general/messages\"\nerr := room.Subscribe(\"messages\", func(data any, meta nolag.MessageMeta) {\n    fmt.Printf(\"Message: %v\\n\", data)\n})\nif err != nil {\n    fmt.Printf(\"Subscribe failed: %v\\n\", err)\n}\n\n// Emit: topic becomes \"chat/general/messages\"\nif err := room.Emit(\"messages\", map[string]any{\"text\": \"Hello!\"}); err != nil {\n    fmt.Printf(\"Emit failed: %v\\n\", err)\n}\n\n// Unsubscribe\nroom.Unsubscribe(\"messages\")\n\n// Filter management on a room\nroom.SetFilters(\"messages\", []any{\"priority:high\"})\nroom.AddFilters(\"messages\", []string{\"priority:medium\"})\nroom.RemoveFilters(\"messages\", []string{\"priority:high\"})\n\n// Event handlers on scoped topics\nroom.On(\"messages\", func(args ...any) {\n    fmt.Println(\"Custom event on chat/general/messages\")\n})\nroom.Off(\"messages\")\n\n// Get the full topic prefix\nfmt.Println(room.Prefix()) // \"chat/general\"\n",[34,628,629,634,639,644,648,653,658,663,667,671,675,679,683,688,693,697,701,705,710,715,719,724,729,734,739,743,748,753,758,762,767,771,776],{"__ignoreMap":32},[37,630,631],{"class":39,"line":40},[37,632,633],{},"// The fluent API scopes operations to an app/room.\n",[37,635,636],{"class":39,"line":72},[37,637,638],{},"// Topics are automatically prefixed with \"app/room/\".\n",[37,640,641],{"class":39,"line":79},[37,642,643],{},"room := client.SetApp(\"chat\").SetRoom(\"general\")\n",[37,645,646],{"class":39,"line":85},[37,647,76],{"emptyLinePlaceholder":75},[37,649,650],{"class":39,"line":91},[37,651,652],{},"// Subscribe: topic becomes \"chat/general/messages\"\n",[37,654,655],{"class":39,"line":97},[37,656,657],{},"err := room.Subscribe(\"messages\", func(data any, meta nolag.MessageMeta) {\n",[37,659,660],{"class":39,"line":102},[37,661,662],{},"    fmt.Printf(\"Message: %v\\n\", data)\n",[37,664,665],{"class":39,"line":108},[37,666,421],{},[37,668,669],{"class":39,"line":114},[37,670,426],{},[37,672,673],{"class":39,"line":119},[37,674,431],{},[37,676,677],{"class":39,"line":125},[37,678,282],{},[37,680,681],{"class":39,"line":131},[37,682,76],{"emptyLinePlaceholder":75},[37,684,685],{"class":39,"line":137},[37,686,687],{},"// Emit: topic becomes \"chat/general/messages\"\n",[37,689,690],{"class":39,"line":142},[37,691,692],{},"if err := room.Emit(\"messages\", map[string]any{\"text\": \"Hello!\"}); err != nil {\n",[37,694,695],{"class":39,"line":148},[37,696,547],{},[37,698,699],{"class":39,"line":154},[37,700,282],{},[37,702,703],{"class":39,"line":160},[37,704,76],{"emptyLinePlaceholder":75},[37,706,707],{"class":39,"line":166},[37,708,709],{},"// Unsubscribe\n",[37,711,712],{"class":39,"line":172},[37,713,714],{},"room.Unsubscribe(\"messages\")\n",[37,716,717],{"class":39,"line":177},[37,718,76],{"emptyLinePlaceholder":75},[37,720,721],{"class":39,"line":183},[37,722,723],{},"// Filter management on a room\n",[37,725,726],{"class":39,"line":189},[37,727,728],{},"room.SetFilters(\"messages\", []any{\"priority:high\"})\n",[37,730,731],{"class":39,"line":195},[37,732,733],{},"room.AddFilters(\"messages\", []string{\"priority:medium\"})\n",[37,735,736],{"class":39,"line":201},[37,737,738],{},"room.RemoveFilters(\"messages\", []string{\"priority:high\"})\n",[37,740,741],{"class":39,"line":207},[37,742,76],{"emptyLinePlaceholder":75},[37,744,745],{"class":39,"line":212},[37,746,747],{},"// Event handlers on scoped topics\n",[37,749,750],{"class":39,"line":217},[37,751,752],{},"room.On(\"messages\", func(args ...any) {\n",[37,754,755],{"class":39,"line":222},[37,756,757],{},"    fmt.Println(\"Custom event on chat/general/messages\")\n",[37,759,760],{"class":39,"line":228},[37,761,421],{},[37,763,764],{"class":39,"line":234},[37,765,766],{},"room.Off(\"messages\")\n",[37,768,769],{"class":39,"line":240},[37,770,76],{"emptyLinePlaceholder":75},[37,772,773],{"class":39,"line":245},[37,774,775],{},"// Get the full topic prefix\n",[37,777,778],{"class":39,"line":250},[37,779,780],{},"fmt.Println(room.Prefix()) // \"chat/general\"\n",[18,782,784],{"id":783},"filter-management","Filter Management",[14,786,787,788,386,791,794,795,798,799,802],{},"Filters narrow which messages a subscriber receives. You can set filters at subscribe time\nor manage them dynamically with ",[34,789,790],{},"SetFilters",[34,792,793],{},"AddFilters",", and\n",[34,796,797],{},"RemoveFilters",". On the publish side, use ",[34,800,801],{},"EmitOptions.Filter"," to\ntarget specific subscribers.",[23,804,805],{},[26,806,808],{"className":60,"code":807,"filename":62,"language":44,"meta":32,"style":32},"// Subscribe with initial filters\nerr := client.Subscribe(\"orders\", handler, nolag.SubscribeOptions{\n    Filters: []any{\"region:us\", \"status:pending\"},\n})\n\n// Replace all filters for a topic (empty slice = receive all messages)\nerr = client.SetFilters(\"orders\", []any{\"region:eu\", \"status:shipped\"})\n\n// Add filters to existing set (deduplicates automatically)\nerr = client.AddFilters(\"orders\", []string{\"status:delivered\"})\n\n// Remove specific filters\nerr = client.RemoveFilters(\"orders\", []string{\"status:shipped\"})\n\n// Emit with a filter value. Only subscribers with matching filter receive it\nerr = client.Emit(\"orders\", orderData, nolag.EmitOptions{\n    Filter: \"region:us\",\n})\n",[34,809,810,815,820,825,829,833,838,843,847,852,857,861,866,871,875,880,885,890],{"__ignoreMap":32},[37,811,812],{"class":39,"line":40},[37,813,814],{},"// Subscribe with initial filters\n",[37,816,817],{"class":39,"line":72},[37,818,819],{},"err := client.Subscribe(\"orders\", handler, nolag.SubscribeOptions{\n",[37,821,822],{"class":39,"line":79},[37,823,824],{},"    Filters: []any{\"region:us\", \"status:pending\"},\n",[37,826,827],{"class":39,"line":85},[37,828,421],{},[37,830,831],{"class":39,"line":91},[37,832,76],{"emptyLinePlaceholder":75},[37,834,835],{"class":39,"line":97},[37,836,837],{},"// Replace all filters for a topic (empty slice = receive all messages)\n",[37,839,840],{"class":39,"line":102},[37,841,842],{},"err = client.SetFilters(\"orders\", []any{\"region:eu\", \"status:shipped\"})\n",[37,844,845],{"class":39,"line":108},[37,846,76],{"emptyLinePlaceholder":75},[37,848,849],{"class":39,"line":114},[37,850,851],{},"// Add filters to existing set (deduplicates automatically)\n",[37,853,854],{"class":39,"line":119},[37,855,856],{},"err = client.AddFilters(\"orders\", []string{\"status:delivered\"})\n",[37,858,859],{"class":39,"line":125},[37,860,76],{"emptyLinePlaceholder":75},[37,862,863],{"class":39,"line":131},[37,864,865],{},"// Remove specific filters\n",[37,867,868],{"class":39,"line":137},[37,869,870],{},"err = client.RemoveFilters(\"orders\", []string{\"status:shipped\"})\n",[37,872,873],{"class":39,"line":142},[37,874,76],{"emptyLinePlaceholder":75},[37,876,877],{"class":39,"line":148},[37,878,879],{},"// Emit with a filter value. Only subscribers with matching filter receive it\n",[37,881,882],{"class":39,"line":154},[37,883,884],{},"err = client.Emit(\"orders\", orderData, nolag.EmitOptions{\n",[37,886,887],{"class":39,"line":160},[37,888,889],{},"    Filter: \"region:us\",\n",[37,891,892],{"class":39,"line":166},[37,893,421],{},[18,895,897],{"id":896},"connection-events","Connection Events",[23,899,900],{},[26,901,903],{"className":60,"code":902,"filename":62,"language":44,"meta":32,"style":32},"// Listen for connection events\nclient.On(\"connected\", func(args ...any) {\n    fmt.Println(\"Connected!\")\n})\n\nclient.On(\"disconnected\", func(args ...any) {\n    fmt.Println(\"Disconnected\")\n})\n\nclient.On(\"reconnecting\", func(args ...any) {\n    attempt := args[0].(int)\n    fmt.Printf(\"Reconnecting... attempt %d\\n\", attempt)\n})\n\n// Prefer OnError for broker errors: it delivers a typed *nolag.ServerError\n// with the error code, topic, and remediation hint. See Error Handling below.\nclient.OnError(func(err *nolag.ServerError) {\n    fmt.Printf(\"Error: %v\\n\", err)\n})\n\nclient.On(\"presence\", func(args ...any) {\n    topic := args[0].(string)\n    data := args[1]\n    fmt.Printf(\"Presence update on %s: %v\\n\", topic, data)\n})\n\n// Remove all handlers for an event\nclient.Off(\"error\")\n\n// Check connection status\nif client.Status() == nolag.StatusConnected {\n    fmt.Println(\"We're connected!\")\n}\n\n// Get the actor ID assigned by the server after authentication\nfmt.Println(\"Actor ID:\", client.ActorID())\n",[34,904,905,910,915,920,924,928,933,938,942,946,951,956,961,965,969,974,979,984,989,993,997,1002,1007,1012,1017,1021,1025,1030,1035,1039,1044,1049,1054,1058,1062,1067],{"__ignoreMap":32},[37,906,907],{"class":39,"line":40},[37,908,909],{},"// Listen for connection events\n",[37,911,912],{"class":39,"line":72},[37,913,914],{},"client.On(\"connected\", func(args ...any) {\n",[37,916,917],{"class":39,"line":79},[37,918,919],{},"    fmt.Println(\"Connected!\")\n",[37,921,922],{"class":39,"line":85},[37,923,421],{},[37,925,926],{"class":39,"line":91},[37,927,76],{"emptyLinePlaceholder":75},[37,929,930],{"class":39,"line":97},[37,931,932],{},"client.On(\"disconnected\", func(args ...any) {\n",[37,934,935],{"class":39,"line":102},[37,936,937],{},"    fmt.Println(\"Disconnected\")\n",[37,939,940],{"class":39,"line":108},[37,941,421],{},[37,943,944],{"class":39,"line":114},[37,945,76],{"emptyLinePlaceholder":75},[37,947,948],{"class":39,"line":119},[37,949,950],{},"client.On(\"reconnecting\", func(args ...any) {\n",[37,952,953],{"class":39,"line":125},[37,954,955],{},"    attempt := args[0].(int)\n",[37,957,958],{"class":39,"line":131},[37,959,960],{},"    fmt.Printf(\"Reconnecting... attempt %d\\n\", attempt)\n",[37,962,963],{"class":39,"line":137},[37,964,421],{},[37,966,967],{"class":39,"line":142},[37,968,76],{"emptyLinePlaceholder":75},[37,970,971],{"class":39,"line":148},[37,972,973],{},"// Prefer OnError for broker errors: it delivers a typed *nolag.ServerError\n",[37,975,976],{"class":39,"line":154},[37,977,978],{},"// with the error code, topic, and remediation hint. See Error Handling below.\n",[37,980,981],{"class":39,"line":160},[37,982,983],{},"client.OnError(func(err *nolag.ServerError) {\n",[37,985,986],{"class":39,"line":166},[37,987,988],{},"    fmt.Printf(\"Error: %v\\n\", err)\n",[37,990,991],{"class":39,"line":172},[37,992,421],{},[37,994,995],{"class":39,"line":177},[37,996,76],{"emptyLinePlaceholder":75},[37,998,999],{"class":39,"line":183},[37,1000,1001],{},"client.On(\"presence\", func(args ...any) {\n",[37,1003,1004],{"class":39,"line":189},[37,1005,1006],{},"    topic := args[0].(string)\n",[37,1008,1009],{"class":39,"line":195},[37,1010,1011],{},"    data := args[1]\n",[37,1013,1014],{"class":39,"line":201},[37,1015,1016],{},"    fmt.Printf(\"Presence update on %s: %v\\n\", topic, data)\n",[37,1018,1019],{"class":39,"line":207},[37,1020,421],{},[37,1022,1023],{"class":39,"line":212},[37,1024,76],{"emptyLinePlaceholder":75},[37,1026,1027],{"class":39,"line":217},[37,1028,1029],{},"// Remove all handlers for an event\n",[37,1031,1032],{"class":39,"line":222},[37,1033,1034],{},"client.Off(\"error\")\n",[37,1036,1037],{"class":39,"line":228},[37,1038,76],{"emptyLinePlaceholder":75},[37,1040,1041],{"class":39,"line":234},[37,1042,1043],{},"// Check connection status\n",[37,1045,1046],{"class":39,"line":240},[37,1047,1048],{},"if client.Status() == nolag.StatusConnected {\n",[37,1050,1051],{"class":39,"line":245},[37,1052,1053],{},"    fmt.Println(\"We're connected!\")\n",[37,1055,1056],{"class":39,"line":250},[37,1057,282],{},[37,1059,1060],{"class":39,"line":256},[37,1061,76],{"emptyLinePlaceholder":75},[37,1063,1064],{"class":39,"line":262},[37,1065,1066],{},"// Get the actor ID assigned by the server after authentication\n",[37,1068,1069],{"class":39,"line":267},[37,1070,1071],{},"fmt.Println(\"Actor ID:\", client.ActorID())\n",[18,1073,1075],{"id":1074},"presence","Presence",[23,1077,1078],{},[26,1079,1081],{"className":60,"code":1080,"filename":62,"language":44,"meta":32,"style":32},"// Set your presence data\nif err := client.SetPresence(map[string]any{\n    \"status\": \"online\",\n    \"typing\": false,\n}); err != nil {\n    fmt.Printf(\"SetPresence failed: %v\\n\", err)\n}\n\n// Get presence of all actors in a topic\npresenceList, err := client.GetPresence(\"chat/room-1\")\nif err == nil {\n    for _, actor := range presenceList {\n        fmt.Printf(\"%s (%s): %v (joined %s)\\n\",\n            actor.ActorTokenID,\n            actor.ActorType,\n            actor.Presence,\n            actor.JoinedAt,\n        )\n    }\n}\n\n// Listen for presence changes\nclient.On(\"presence\", func(args ...any) {\n    topic := args[0].(string)\n    presence := args[1]\n    fmt.Printf(\"Presence update in %s: %v\\n\", topic, presence)\n})\n",[34,1082,1083,1088,1093,1098,1103,1108,1113,1117,1121,1126,1131,1136,1141,1146,1151,1156,1161,1166,1171,1175,1179,1183,1188,1192,1196,1201,1206],{"__ignoreMap":32},[37,1084,1085],{"class":39,"line":40},[37,1086,1087],{},"// Set your presence data\n",[37,1089,1090],{"class":39,"line":72},[37,1091,1092],{},"if err := client.SetPresence(map[string]any{\n",[37,1094,1095],{"class":39,"line":79},[37,1096,1097],{},"    \"status\": \"online\",\n",[37,1099,1100],{"class":39,"line":85},[37,1101,1102],{},"    \"typing\": false,\n",[37,1104,1105],{"class":39,"line":91},[37,1106,1107],{},"}); err != nil {\n",[37,1109,1110],{"class":39,"line":97},[37,1111,1112],{},"    fmt.Printf(\"SetPresence failed: %v\\n\", err)\n",[37,1114,1115],{"class":39,"line":102},[37,1116,282],{},[37,1118,1119],{"class":39,"line":108},[37,1120,76],{"emptyLinePlaceholder":75},[37,1122,1123],{"class":39,"line":114},[37,1124,1125],{},"// Get presence of all actors in a topic\n",[37,1127,1128],{"class":39,"line":119},[37,1129,1130],{},"presenceList, err := client.GetPresence(\"chat/room-1\")\n",[37,1132,1133],{"class":39,"line":125},[37,1134,1135],{},"if err == nil {\n",[37,1137,1138],{"class":39,"line":131},[37,1139,1140],{},"    for _, actor := range presenceList {\n",[37,1142,1143],{"class":39,"line":137},[37,1144,1145],{},"        fmt.Printf(\"%s (%s): %v (joined %s)\\n\",\n",[37,1147,1148],{"class":39,"line":142},[37,1149,1150],{},"            actor.ActorTokenID,\n",[37,1152,1153],{"class":39,"line":148},[37,1154,1155],{},"            actor.ActorType,\n",[37,1157,1158],{"class":39,"line":154},[37,1159,1160],{},"            actor.Presence,\n",[37,1162,1163],{"class":39,"line":160},[37,1164,1165],{},"            actor.JoinedAt,\n",[37,1167,1168],{"class":39,"line":166},[37,1169,1170],{},"        )\n",[37,1172,1173],{"class":39,"line":172},[37,1174,163],{},[37,1176,1177],{"class":39,"line":177},[37,1178,282],{},[37,1180,1181],{"class":39,"line":183},[37,1182,76],{"emptyLinePlaceholder":75},[37,1184,1185],{"class":39,"line":189},[37,1186,1187],{},"// Listen for presence changes\n",[37,1189,1190],{"class":39,"line":195},[37,1191,1001],{},[37,1193,1194],{"class":39,"line":201},[37,1195,1006],{},[37,1197,1198],{"class":39,"line":207},[37,1199,1200],{},"    presence := args[1]\n",[37,1202,1203],{"class":39,"line":212},[37,1204,1205],{},"    fmt.Printf(\"Presence update in %s: %v\\n\", topic, presence)\n",[37,1207,1208],{"class":39,"line":217},[37,1209,421],{},[18,1211,1213],{"id":1212},"error-handling","Error Handling",[14,1215,1216],{},"Errors reach you through two separate channels, and confusing them is the most\ncommon reason a Go client appears to do nothing:",[1218,1219,1220,1227],"ul",{},[1221,1222,1223,1226],"li",{},[610,1224,1225],{},"Returned errors"," come from local, synchronous problems: not connected, encode\nfailures, timeouts. Every operation returns one.",[1221,1228,1229,1232,1233,1235,1236,1238,1239,1241,1242,1245],{},[610,1230,1231],{},"Broker errors"," are asynchronous. ",[34,1234,385],{}," and ",[34,1237,517],{}," are fire-and-forget,\nso a rejected subscription or an unwritable topic is reported later on the error\nevent, not as a return value. ",[34,1240,385],{}," returning ",[34,1243,1244],{},"nil"," means the frame was\nsent, not that the broker accepted it.",[14,1247,1248,1249,1252,1253,1256],{},"Register ",[34,1250,1251],{},"OnError"," before calling ",[34,1254,1255],{},"Connect"," so nothing is missed during the\nhandshake.",[1258,1259,1261],"h3",{"id":1260},"broker-errors","Broker Errors",[23,1263,1264],{},[26,1265,1267],{"className":60,"code":1266,"filename":62,"language":44,"meta":32,"style":32},"client := nolag.New(\"your-actor-token\")\n\nclient.OnError(func(err *nolag.ServerError) {\n    // err also satisfies the error interface\n    log.Printf(\"nolag: %v\", err)\n\n    switch err.Name {\n    case \"unknown_topic\":\n        // The room has not been created. Provision it via the rooms API.\n        log.Printf(\"missing room for topic %s: %s\", err.Topic, err.Hint)\n    case \"not_authorized\":\n        log.Printf(\"actor lacks access to %s\", err.Topic)\n    }\n})\n\nif err := client.Connect(); err != nil {\n    log.Fatal(err)\n}\n",[34,1268,1269,1274,1278,1282,1287,1292,1296,1301,1306,1311,1316,1321,1326,1330,1334,1338,1343,1348],{"__ignoreMap":32},[37,1270,1271],{"class":39,"line":40},[37,1272,1273],{},"client := nolag.New(\"your-actor-token\")\n",[37,1275,1276],{"class":39,"line":72},[37,1277,76],{"emptyLinePlaceholder":75},[37,1279,1280],{"class":39,"line":79},[37,1281,983],{},[37,1283,1284],{"class":39,"line":85},[37,1285,1286],{},"    // err also satisfies the error interface\n",[37,1288,1289],{"class":39,"line":91},[37,1290,1291],{},"    log.Printf(\"nolag: %v\", err)\n",[37,1293,1294],{"class":39,"line":97},[37,1295,76],{"emptyLinePlaceholder":75},[37,1297,1298],{"class":39,"line":102},[37,1299,1300],{},"    switch err.Name {\n",[37,1302,1303],{"class":39,"line":108},[37,1304,1305],{},"    case \"unknown_topic\":\n",[37,1307,1308],{"class":39,"line":114},[37,1309,1310],{},"        // The room has not been created. Provision it via the rooms API.\n",[37,1312,1313],{"class":39,"line":119},[37,1314,1315],{},"        log.Printf(\"missing room for topic %s: %s\", err.Topic, err.Hint)\n",[37,1317,1318],{"class":39,"line":125},[37,1319,1320],{},"    case \"not_authorized\":\n",[37,1322,1323],{"class":39,"line":131},[37,1324,1325],{},"        log.Printf(\"actor lacks access to %s\", err.Topic)\n",[37,1327,1328],{"class":39,"line":137},[37,1329,163],{},[37,1331,1332],{"class":39,"line":142},[37,1333,421],{},[37,1335,1336],{"class":39,"line":148},[37,1337,76],{"emptyLinePlaceholder":75},[37,1339,1340],{"class":39,"line":154},[37,1341,1342],{},"if err := client.Connect(); err != nil {\n",[37,1344,1345],{"class":39,"line":160},[37,1346,1347],{},"    log.Fatal(err)\n",[37,1349,1350],{"class":39,"line":166},[37,1351,282],{},[14,1353,1354,1357],{},[34,1355,1356],{},"ServerError"," carries the full frame:",[1359,1360,1361,1377],"table",{},[1362,1363,1364],"thead",{},[1365,1366,1367,1371,1374],"tr",{},[1368,1369,1370],"th",{},"Field",[1368,1372,1373],{},"Type",[1368,1375,1376],{},"Description",[1378,1379,1380,1400,1419,1433,1447],"tbody",{},[1365,1381,1382,1388,1393],{},[1383,1384,1385],"td",{},[34,1386,1387],{},"Code",[1383,1389,1390],{},[34,1391,1392],{},"int",[1383,1394,1395,1396,1399],{},"Numeric error code, for example ",[34,1397,1398],{},"42940",". Zero if the broker sent none",[1365,1401,1402,1407,1412],{},[1383,1403,1404],{},[34,1405,1406],{},"Name",[1383,1408,1409],{},[34,1410,1411],{},"string",[1383,1413,1414,1415,1418],{},"Machine-readable name, for example ",[34,1416,1417],{},"unknown_topic",". Always set",[1365,1420,1421,1426,1430],{},[1383,1422,1423],{},[34,1424,1425],{},"Topic",[1383,1427,1428],{},[34,1429,1411],{},[1383,1431,1432],{},"The topic the error refers to, when topic-scoped",[1365,1434,1435,1440,1444],{},[1383,1436,1437],{},[34,1438,1439],{},"Hint",[1383,1441,1442],{},[34,1443,1411],{},[1383,1445,1446],{},"Remediation hint from the broker, when provided",[1365,1448,1449,1454,1458],{},[1383,1450,1451],{},[34,1452,1453],{},"MsgRef",[1383,1455,1456],{},[34,1457,1411],{},[1383,1459,1460],{},"The publish this error responds to, when applicable",[1462,1463,1465],"callout",{"type":1464},"info",[14,1466,1467,1235,1469,1471,1472,1475,1476,1479,1480,1482],{},[34,1468,1387],{},[34,1470,1439],{}," require protocol version 2. The SDK requests v2 automatically and\nthe negotiated result is available from ",[34,1473,1474],{},"client.ProtocolVersion()",". Against an older\nbroker this returns ",[34,1477,1478],{},"1"," and only ",[34,1481,1406],{}," is populated.",[1258,1484,1486],{"id":1485},"returned-errors","Returned Errors",[23,1488,1489],{},[26,1490,1492],{"className":60,"code":1491,"filename":62,"language":44,"meta":32,"style":32},"package main\n\nimport (\n    \"errors\"\n    \"fmt\"\n\n    nolag \"github.com/NoLagApp/go-sdk\"\n)\n\nfunc main() {\n    client := nolag.New(\"your-actor-token\")\n\n    // Connect with error handling\n    if err := client.Connect(); err != nil {\n        fmt.Printf(\"Connection failed: %v\\n\", err)\n        return\n    }\n    defer client.Close()\n\n    // All operations return errors\n    if err := client.Subscribe(\"topic\", handler); err != nil {\n        // Check for specific error types\n        if errors.Is(err, nolag.ErrNotConnected) {\n            fmt.Println(\"Not connected!\")\n        }\n        fmt.Printf(\"Subscribe failed: %v\\n\", err)\n    }\n\n    if err := client.Emit(\"topic\", \"data\"); err != nil {\n        fmt.Printf(\"Emit failed: %v\\n\", err)\n    }\n\n    if err := client.Unsubscribe(\"topic\"); err != nil {\n        fmt.Printf(\"Unsubscribe failed: %v\\n\", err)\n    }\n\n    if err := client.SetFilters(\"topic\", []any{\"filter1\"}); err != nil {\n        fmt.Printf(\"SetFilters failed: %v\\n\", err)\n    }\n}\n\n// Sentinel errors available:\n// nolag.ErrNotConnected - operation attempted while disconnected\n// nolag.ErrAuthFailed   - authentication failed\n// nolag.ErrTimeout      - operation timed out\n",[34,1493,1494,1498,1502,1506,1511,1515,1519,1523,1527,1531,1535,1539,1543,1548,1552,1557,1562,1566,1570,1574,1579,1584,1589,1594,1599,1604,1609,1613,1617,1622,1626,1630,1634,1639,1644,1648,1652,1657,1662,1667,1672,1677,1683,1689,1695],{"__ignoreMap":32},[37,1495,1496],{"class":39,"line":40},[37,1497,69],{},[37,1499,1500],{"class":39,"line":72},[37,1501,76],{"emptyLinePlaceholder":75},[37,1503,1504],{"class":39,"line":79},[37,1505,82],{},[37,1507,1508],{"class":39,"line":85},[37,1509,1510],{},"    \"errors\"\n",[37,1512,1513],{"class":39,"line":91},[37,1514,88],{},[37,1516,1517],{"class":39,"line":97},[37,1518,76],{"emptyLinePlaceholder":75},[37,1520,1521],{"class":39,"line":102},[37,1522,105],{},[37,1524,1525],{"class":39,"line":108},[37,1526,111],{},[37,1528,1529],{"class":39,"line":114},[37,1530,76],{"emptyLinePlaceholder":75},[37,1532,1533],{"class":39,"line":119},[37,1534,122],{},[37,1536,1537],{"class":39,"line":125},[37,1538,134],{},[37,1540,1541],{"class":39,"line":131},[37,1542,76],{"emptyLinePlaceholder":75},[37,1544,1545],{"class":39,"line":137},[37,1546,1547],{},"    // Connect with error handling\n",[37,1549,1550],{"class":39,"line":142},[37,1551,151],{},[37,1553,1554],{"class":39,"line":148},[37,1555,1556],{},"        fmt.Printf(\"Connection failed: %v\\n\", err)\n",[37,1558,1559],{"class":39,"line":154},[37,1560,1561],{},"        return\n",[37,1563,1564],{"class":39,"line":160},[37,1565,163],{},[37,1567,1568],{"class":39,"line":166},[37,1569,169],{},[37,1571,1572],{"class":39,"line":172},[37,1573,76],{"emptyLinePlaceholder":75},[37,1575,1576],{"class":39,"line":177},[37,1577,1578],{},"    // All operations return errors\n",[37,1580,1581],{"class":39,"line":183},[37,1582,1583],{},"    if err := client.Subscribe(\"topic\", handler); err != nil {\n",[37,1585,1586],{"class":39,"line":189},[37,1587,1588],{},"        // Check for specific error types\n",[37,1590,1591],{"class":39,"line":195},[37,1592,1593],{},"        if errors.Is(err, nolag.ErrNotConnected) {\n",[37,1595,1596],{"class":39,"line":201},[37,1597,1598],{},"            fmt.Println(\"Not connected!\")\n",[37,1600,1601],{"class":39,"line":207},[37,1602,1603],{},"        }\n",[37,1605,1606],{"class":39,"line":212},[37,1607,1608],{},"        fmt.Printf(\"Subscribe failed: %v\\n\", err)\n",[37,1610,1611],{"class":39,"line":217},[37,1612,163],{},[37,1614,1615],{"class":39,"line":222},[37,1616,76],{"emptyLinePlaceholder":75},[37,1618,1619],{"class":39,"line":228},[37,1620,1621],{},"    if err := client.Emit(\"topic\", \"data\"); err != nil {\n",[37,1623,1624],{"class":39,"line":234},[37,1625,237],{},[37,1627,1628],{"class":39,"line":240},[37,1629,163],{},[37,1631,1632],{"class":39,"line":245},[37,1633,76],{"emptyLinePlaceholder":75},[37,1635,1636],{"class":39,"line":250},[37,1637,1638],{},"    if err := client.Unsubscribe(\"topic\"); err != nil {\n",[37,1640,1641],{"class":39,"line":256},[37,1642,1643],{},"        fmt.Printf(\"Unsubscribe failed: %v\\n\", err)\n",[37,1645,1646],{"class":39,"line":262},[37,1647,163],{},[37,1649,1650],{"class":39,"line":267},[37,1651,76],{"emptyLinePlaceholder":75},[37,1653,1654],{"class":39,"line":273},[37,1655,1656],{},"    if err := client.SetFilters(\"topic\", []any{\"filter1\"}); err != nil {\n",[37,1658,1659],{"class":39,"line":279},[37,1660,1661],{},"        fmt.Printf(\"SetFilters failed: %v\\n\", err)\n",[37,1663,1665],{"class":39,"line":1664},39,[37,1666,163],{},[37,1668,1670],{"class":39,"line":1669},40,[37,1671,282],{},[37,1673,1675],{"class":39,"line":1674},41,[37,1676,76],{"emptyLinePlaceholder":75},[37,1678,1680],{"class":39,"line":1679},42,[37,1681,1682],{},"// Sentinel errors available:\n",[37,1684,1686],{"class":39,"line":1685},43,[37,1687,1688],{},"// nolag.ErrNotConnected - operation attempted while disconnected\n",[37,1690,1692],{"class":39,"line":1691},44,[37,1693,1694],{},"// nolag.ErrAuthFailed   - authentication failed\n",[37,1696,1698],{"class":39,"line":1697},45,[37,1699,1700],{},"// nolag.ErrTimeout      - operation timed out\n",[18,1702,1704],{"id":1703},"rest-api-client","REST API Client",[14,1706,1707],{},"The SDK also includes a REST API client for managing apps, rooms, actors, and scopes:",[23,1709,1710],{},[26,1711,1713],{"className":60,"code":1712,"filename":62,"language":44,"meta":32,"style":32},"package main\n\nimport (\n    \"context\"\n    \"fmt\"\n\n    nolag \"github.com/NoLagApp/go-sdk\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    // Create API client with project-scoped API key\n    api := nolag.NewAPI(\"nlg_live_xxx.secret\")\n\n    // List all apps in your project\n    apps, err := api.Apps.List(ctx, nil)\n    if err != nil {\n        panic(err)\n    }\n    fmt.Printf(\"Found %d apps\\n\", len(apps.Data))\n\n    // Create a new app\n    app, err := api.Apps.Create(ctx, nolag.AppCreate{\n        Name:        \"my-chat-app\",\n        Description: \"A real-time chat application\",\n    })\n    if err != nil {\n        panic(err)\n    }\n    fmt.Printf(\"Created app: %s\\n\", app.AppID)\n\n    // Create a room in the app\n    room, err := api.Rooms.Create(ctx, app.AppID, nolag.RoomCreate{\n        Name: \"general\",\n        Slug: \"general\",\n    })\n    if err != nil {\n        panic(err)\n    }\n    fmt.Printf(\"Created room: %s\\n\", room.RoomID)\n\n    // Create an actor (save the access token!)\n    actor, err := api.Actors.Create(ctx, nolag.ActorCreate{\n        Name:      \"web-client\",\n        ActorType: nolag.ActorDevice,\n    })\n    if err != nil {\n        panic(err)\n    }\n    fmt.Printf(\"Actor token: %s\\n\", actor.AccessToken)\n}\n",[34,1714,1715,1719,1723,1727,1732,1736,1740,1744,1748,1752,1756,1761,1765,1770,1775,1779,1784,1789,1793,1797,1801,1806,1810,1815,1820,1825,1830,1834,1838,1842,1846,1851,1855,1860,1865,1870,1875,1879,1883,1887,1891,1896,1900,1905,1910,1915,1921,1926,1931,1936,1941,1947],{"__ignoreMap":32},[37,1716,1717],{"class":39,"line":40},[37,1718,69],{},[37,1720,1721],{"class":39,"line":72},[37,1722,76],{"emptyLinePlaceholder":75},[37,1724,1725],{"class":39,"line":79},[37,1726,82],{},[37,1728,1729],{"class":39,"line":85},[37,1730,1731],{},"    \"context\"\n",[37,1733,1734],{"class":39,"line":91},[37,1735,88],{},[37,1737,1738],{"class":39,"line":97},[37,1739,76],{"emptyLinePlaceholder":75},[37,1741,1742],{"class":39,"line":102},[37,1743,105],{},[37,1745,1746],{"class":39,"line":108},[37,1747,111],{},[37,1749,1750],{"class":39,"line":114},[37,1751,76],{"emptyLinePlaceholder":75},[37,1753,1754],{"class":39,"line":119},[37,1755,122],{},[37,1757,1758],{"class":39,"line":125},[37,1759,1760],{},"    ctx := context.Background()\n",[37,1762,1763],{"class":39,"line":131},[37,1764,76],{"emptyLinePlaceholder":75},[37,1766,1767],{"class":39,"line":137},[37,1768,1769],{},"    // Create API client with project-scoped API key\n",[37,1771,1772],{"class":39,"line":142},[37,1773,1774],{},"    api := nolag.NewAPI(\"nlg_live_xxx.secret\")\n",[37,1776,1777],{"class":39,"line":148},[37,1778,76],{"emptyLinePlaceholder":75},[37,1780,1781],{"class":39,"line":154},[37,1782,1783],{},"    // List all apps in your project\n",[37,1785,1786],{"class":39,"line":160},[37,1787,1788],{},"    apps, err := api.Apps.List(ctx, nil)\n",[37,1790,1791],{"class":39,"line":166},[37,1792,204],{},[37,1794,1795],{"class":39,"line":172},[37,1796,157],{},[37,1798,1799],{"class":39,"line":177},[37,1800,163],{},[37,1802,1803],{"class":39,"line":183},[37,1804,1805],{},"    fmt.Printf(\"Found %d apps\\n\", len(apps.Data))\n",[37,1807,1808],{"class":39,"line":189},[37,1809,76],{"emptyLinePlaceholder":75},[37,1811,1812],{"class":39,"line":195},[37,1813,1814],{},"    // Create a new app\n",[37,1816,1817],{"class":39,"line":201},[37,1818,1819],{},"    app, err := api.Apps.Create(ctx, nolag.AppCreate{\n",[37,1821,1822],{"class":39,"line":207},[37,1823,1824],{},"        Name:        \"my-chat-app\",\n",[37,1826,1827],{"class":39,"line":212},[37,1828,1829],{},"        Description: \"A real-time chat application\",\n",[37,1831,1832],{"class":39,"line":217},[37,1833,198],{},[37,1835,1836],{"class":39,"line":222},[37,1837,204],{},[37,1839,1840],{"class":39,"line":228},[37,1841,157],{},[37,1843,1844],{"class":39,"line":234},[37,1845,163],{},[37,1847,1848],{"class":39,"line":240},[37,1849,1850],{},"    fmt.Printf(\"Created app: %s\\n\", app.AppID)\n",[37,1852,1853],{"class":39,"line":245},[37,1854,76],{"emptyLinePlaceholder":75},[37,1856,1857],{"class":39,"line":250},[37,1858,1859],{},"    // Create a room in the app\n",[37,1861,1862],{"class":39,"line":256},[37,1863,1864],{},"    room, err := api.Rooms.Create(ctx, app.AppID, nolag.RoomCreate{\n",[37,1866,1867],{"class":39,"line":262},[37,1868,1869],{},"        Name: \"general\",\n",[37,1871,1872],{"class":39,"line":267},[37,1873,1874],{},"        Slug: \"general\",\n",[37,1876,1877],{"class":39,"line":273},[37,1878,198],{},[37,1880,1881],{"class":39,"line":279},[37,1882,204],{},[37,1884,1885],{"class":39,"line":1664},[37,1886,157],{},[37,1888,1889],{"class":39,"line":1669},[37,1890,163],{},[37,1892,1893],{"class":39,"line":1674},[37,1894,1895],{},"    fmt.Printf(\"Created room: %s\\n\", room.RoomID)\n",[37,1897,1898],{"class":39,"line":1679},[37,1899,76],{"emptyLinePlaceholder":75},[37,1901,1902],{"class":39,"line":1685},[37,1903,1904],{},"    // Create an actor (save the access token!)\n",[37,1906,1907],{"class":39,"line":1691},[37,1908,1909],{},"    actor, err := api.Actors.Create(ctx, nolag.ActorCreate{\n",[37,1911,1912],{"class":39,"line":1697},[37,1913,1914],{},"        Name:      \"web-client\",\n",[37,1916,1918],{"class":39,"line":1917},46,[37,1919,1920],{},"        ActorType: nolag.ActorDevice,\n",[37,1922,1924],{"class":39,"line":1923},47,[37,1925,198],{},[37,1927,1929],{"class":39,"line":1928},48,[37,1930,204],{},[37,1932,1934],{"class":39,"line":1933},49,[37,1935,157],{},[37,1937,1939],{"class":39,"line":1938},50,[37,1940,163],{},[37,1942,1944],{"class":39,"line":1943},51,[37,1945,1946],{},"    fmt.Printf(\"Actor token: %s\\n\", actor.AccessToken)\n",[37,1948,1950],{"class":39,"line":1949},52,[37,1951,282],{},[18,1953,1955],{"id":1954},"access-scopes","Access Scopes",[14,1957,1958],{},"Manage access scopes for tenant isolation:",[23,1960,1961],{},[26,1962,1964],{"className":60,"code":1963,"filename":62,"language":44,"meta":32,"style":32},"import nolag \"github.com/NoLagApp/go-sdk\"\n\napi := nolag.NewAPI(\"nlg_live_xxx.secret\")\nctx := context.Background()\n\n// List scopes\nscopes, err := api.Scopes.List(ctx)\nif err != nil {\n    panic(err)\n}\nfmt.Printf(\"Found %d scopes\\n\", len(scopes))\n\n// Create a scope\nscope, err := api.Scopes.Create(ctx, nolag.ScopeCreate{\n    Slug: \"tenant-acme\",\n    Name: \"Acme Corp\",\n})\nif err != nil {\n    panic(err)\n}\nfmt.Printf(\"Created scope: %s\\n\", scope.AccessScopeID)\n\n// Assign an actor to the scope\nscopeID := scope.AccessScopeID\n_, err = api.Actors.Update(ctx, actorId, nolag.ActorUpdate{\n    AccessScopeID: &scopeID,\n})\n\n// List actors in a scope\nactors, err := api.Scopes.ListActors(ctx, scope.AccessScopeID)\n\n// Update a scope\nnewName := \"Acme Corporation\"\n_, err = api.Scopes.Update(ctx, scope.AccessScopeID, nolag.ScopeUpdate{\n    Name: &newName,\n})\n\n// Delete a scope (must unscope actors first)\nerr = api.Scopes.Delete(ctx, scope.AccessScopeID)\n",[34,1965,1966,1971,1975,1980,1985,1989,1994,1999,2003,2008,2012,2017,2021,2026,2031,2036,2041,2045,2049,2053,2057,2062,2066,2071,2076,2081,2086,2090,2094,2099,2104,2108,2113,2118,2123,2128,2132,2136,2141],{"__ignoreMap":32},[37,1967,1968],{"class":39,"line":40},[37,1969,1970],{},"import nolag \"github.com/NoLagApp/go-sdk\"\n",[37,1972,1973],{"class":39,"line":72},[37,1974,76],{"emptyLinePlaceholder":75},[37,1976,1977],{"class":39,"line":79},[37,1978,1979],{},"api := nolag.NewAPI(\"nlg_live_xxx.secret\")\n",[37,1981,1982],{"class":39,"line":85},[37,1983,1984],{},"ctx := context.Background()\n",[37,1986,1987],{"class":39,"line":91},[37,1988,76],{"emptyLinePlaceholder":75},[37,1990,1991],{"class":39,"line":97},[37,1992,1993],{},"// List scopes\n",[37,1995,1996],{"class":39,"line":102},[37,1997,1998],{},"scopes, err := api.Scopes.List(ctx)\n",[37,2000,2001],{"class":39,"line":108},[37,2002,426],{},[37,2004,2005],{"class":39,"line":114},[37,2006,2007],{},"    panic(err)\n",[37,2009,2010],{"class":39,"line":119},[37,2011,282],{},[37,2013,2014],{"class":39,"line":125},[37,2015,2016],{},"fmt.Printf(\"Found %d scopes\\n\", len(scopes))\n",[37,2018,2019],{"class":39,"line":131},[37,2020,76],{"emptyLinePlaceholder":75},[37,2022,2023],{"class":39,"line":137},[37,2024,2025],{},"// Create a scope\n",[37,2027,2028],{"class":39,"line":142},[37,2029,2030],{},"scope, err := api.Scopes.Create(ctx, nolag.ScopeCreate{\n",[37,2032,2033],{"class":39,"line":148},[37,2034,2035],{},"    Slug: \"tenant-acme\",\n",[37,2037,2038],{"class":39,"line":154},[37,2039,2040],{},"    Name: \"Acme Corp\",\n",[37,2042,2043],{"class":39,"line":160},[37,2044,421],{},[37,2046,2047],{"class":39,"line":166},[37,2048,426],{},[37,2050,2051],{"class":39,"line":172},[37,2052,2007],{},[37,2054,2055],{"class":39,"line":177},[37,2056,282],{},[37,2058,2059],{"class":39,"line":183},[37,2060,2061],{},"fmt.Printf(\"Created scope: %s\\n\", scope.AccessScopeID)\n",[37,2063,2064],{"class":39,"line":189},[37,2065,76],{"emptyLinePlaceholder":75},[37,2067,2068],{"class":39,"line":195},[37,2069,2070],{},"// Assign an actor to the scope\n",[37,2072,2073],{"class":39,"line":201},[37,2074,2075],{},"scopeID := scope.AccessScopeID\n",[37,2077,2078],{"class":39,"line":207},[37,2079,2080],{},"_, err = api.Actors.Update(ctx, actorId, nolag.ActorUpdate{\n",[37,2082,2083],{"class":39,"line":212},[37,2084,2085],{},"    AccessScopeID: &scopeID,\n",[37,2087,2088],{"class":39,"line":217},[37,2089,421],{},[37,2091,2092],{"class":39,"line":222},[37,2093,76],{"emptyLinePlaceholder":75},[37,2095,2096],{"class":39,"line":228},[37,2097,2098],{},"// List actors in a scope\n",[37,2100,2101],{"class":39,"line":234},[37,2102,2103],{},"actors, err := api.Scopes.ListActors(ctx, scope.AccessScopeID)\n",[37,2105,2106],{"class":39,"line":240},[37,2107,76],{"emptyLinePlaceholder":75},[37,2109,2110],{"class":39,"line":245},[37,2111,2112],{},"// Update a scope\n",[37,2114,2115],{"class":39,"line":250},[37,2116,2117],{},"newName := \"Acme Corporation\"\n",[37,2119,2120],{"class":39,"line":256},[37,2121,2122],{},"_, err = api.Scopes.Update(ctx, scope.AccessScopeID, nolag.ScopeUpdate{\n",[37,2124,2125],{"class":39,"line":262},[37,2126,2127],{},"    Name: &newName,\n",[37,2129,2130],{"class":39,"line":267},[37,2131,421],{},[37,2133,2134],{"class":39,"line":273},[37,2135,76],{"emptyLinePlaceholder":75},[37,2137,2138],{"class":39,"line":279},[37,2139,2140],{},"// Delete a scope (must unscope actors first)\n",[37,2142,2143],{"class":39,"line":1664},[37,2144,2145],{},"err = api.Scopes.Delete(ctx, scope.AccessScopeID)\n",[18,2147,2149],{"id":2148},"load-balancing","Load Balancing",[14,2151,2152],{},"Distribute messages across multiple subscribers:",[23,2154,2155],{},[26,2156,2158],{"className":60,"code":2157,"filename":62,"language":44,"meta":32,"style":32},"// Enable load balancing per-subscription\nloadBalance := true\nerr := client.Subscribe(\"tasks\", processTask, nolag.SubscribeOptions{\n    LoadBalance:      &loadBalance,\n    LoadBalanceGroup: \"task-workers\",\n})\nif err != nil {\n    fmt.Printf(\"Subscribe failed: %v\\n\", err)\n}\n\n// Or enable load balancing globally via connection options\nclient := nolag.New(\"your-actor-token\", nolag.Options{\n    LoadBalance:      true,\n    LoadBalanceGroup: \"task-workers\",\n})\n",[34,2159,2160,2165,2169,2174,2178,2183,2187,2191,2195,2199,2203,2208,2213,2218,2222],{"__ignoreMap":32},[37,2161,2162],{"class":39,"line":40},[37,2163,2164],{},"// Enable load balancing per-subscription\n",[37,2166,2167],{"class":39,"line":72},[37,2168,449],{},[37,2170,2171],{"class":39,"line":79},[37,2172,2173],{},"err := client.Subscribe(\"tasks\", processTask, nolag.SubscribeOptions{\n",[37,2175,2176],{"class":39,"line":85},[37,2177,459],{},[37,2179,2180],{"class":39,"line":91},[37,2181,2182],{},"    LoadBalanceGroup: \"task-workers\",\n",[37,2184,2185],{"class":39,"line":97},[37,2186,421],{},[37,2188,2189],{"class":39,"line":102},[37,2190,426],{},[37,2192,2193],{"class":39,"line":108},[37,2194,431],{},[37,2196,2197],{"class":39,"line":114},[37,2198,282],{},[37,2200,2201],{"class":39,"line":119},[37,2202,76],{"emptyLinePlaceholder":75},[37,2204,2205],{"class":39,"line":125},[37,2206,2207],{},"// Or enable load balancing globally via connection options\n",[37,2209,2210],{"class":39,"line":131},[37,2211,2212],{},"client := nolag.New(\"your-actor-token\", nolag.Options{\n",[37,2214,2215],{"class":39,"line":137},[37,2216,2217],{},"    LoadBalance:      true,\n",[37,2219,2220],{"class":39,"line":142},[37,2221,2182],{},[37,2223,2224],{"class":39,"line":148},[37,2225,421],{},[18,2227,2229],{"id":2228},"type-definitions","Type Definitions",[23,2231,2232],{},[26,2233,2235],{"className":60,"code":2234,"filename":62,"language":44,"meta":32,"style":32},"import nolag \"github.com/NoLagApp/go-sdk\"\n\n// WebSocket Client\nnolag.Client           // The real-time messaging client\nnolag.Options          // Connection options (URL, Reconnect, LoadBalance, etc.)\nnolag.SubscribeOptions // Subscription options (LoadBalance, Filters, etc.)\nnolag.EmitOptions      // Publish options (Retain, Echo, Filter)\nnolag.App              // Intermediate context from SetApp()\nnolag.Room             // Scoped pub/sub context from SetApp().SetRoom()\n\n// Enums / Constants\nnolag.ConnectionStatus // StatusDisconnected, StatusConnecting, StatusConnected, StatusReconnecting\nnolag.ActorType        // ActorDevice, ActorUser, ActorService, ActorSession,\n                       // ActorAgent, ActorOrchestrator, ActorObserver\nnolag.QoS              // QoSAtMostOnce, QoSAtLeastOnce, QoSExactlyOnce\n\n// Sentinel Errors\nnolag.ErrNotConnected  // Not connected to broker\nnolag.ErrAuthFailed    // Authentication failed\nnolag.ErrTimeout       // Operation timed out\n\n// Data types\nnolag.MessageMeta      // Message metadata (Sender, Timestamp, IsReplay, MsgID, Filter)\nnolag.ActorPresence    // Presence info (ActorTokenID, ActorType, Presence, JoinedAt)\nnolag.MessageHandler   // func(data any, meta MessageMeta)\nnolag.EventHandler     // func(args ...any)\n\n// REST API Client\nnolag.API              // REST API client\nnolag.APIOptions       // API client options\nnolag.NoLagAPIError    // API error type\nnolag.APIError         // Raw API error details\n\n// Resources\nnolag.AppResource, nolag.AppCreate, nolag.AppUpdate\nnolag.RoomResource, nolag.RoomCreate, nolag.RoomUpdate\nnolag.ActorResource, nolag.ActorWithToken, nolag.ActorCreate, nolag.ActorUpdate\nnolag.ScopeResource, nolag.ScopeCreate, nolag.ScopeUpdate\nnolag.PaginatedApps, nolag.ListOptions\n",[34,2236,2237,2241,2245,2250,2255,2260,2265,2270,2275,2280,2284,2289,2294,2299,2304,2309,2313,2318,2323,2328,2333,2337,2342,2347,2352,2357,2362,2366,2371,2376,2381,2386,2391,2395,2400,2405,2410,2415,2420],{"__ignoreMap":32},[37,2238,2239],{"class":39,"line":40},[37,2240,1970],{},[37,2242,2243],{"class":39,"line":72},[37,2244,76],{"emptyLinePlaceholder":75},[37,2246,2247],{"class":39,"line":79},[37,2248,2249],{},"// WebSocket Client\n",[37,2251,2252],{"class":39,"line":85},[37,2253,2254],{},"nolag.Client           // The real-time messaging client\n",[37,2256,2257],{"class":39,"line":91},[37,2258,2259],{},"nolag.Options          // Connection options (URL, Reconnect, LoadBalance, etc.)\n",[37,2261,2262],{"class":39,"line":97},[37,2263,2264],{},"nolag.SubscribeOptions // Subscription options (LoadBalance, Filters, etc.)\n",[37,2266,2267],{"class":39,"line":102},[37,2268,2269],{},"nolag.EmitOptions      // Publish options (Retain, Echo, Filter)\n",[37,2271,2272],{"class":39,"line":108},[37,2273,2274],{},"nolag.App              // Intermediate context from SetApp()\n",[37,2276,2277],{"class":39,"line":114},[37,2278,2279],{},"nolag.Room             // Scoped pub/sub context from SetApp().SetRoom()\n",[37,2281,2282],{"class":39,"line":119},[37,2283,76],{"emptyLinePlaceholder":75},[37,2285,2286],{"class":39,"line":125},[37,2287,2288],{},"// Enums / Constants\n",[37,2290,2291],{"class":39,"line":131},[37,2292,2293],{},"nolag.ConnectionStatus // StatusDisconnected, StatusConnecting, StatusConnected, StatusReconnecting\n",[37,2295,2296],{"class":39,"line":137},[37,2297,2298],{},"nolag.ActorType        // ActorDevice, ActorUser, ActorService, ActorSession,\n",[37,2300,2301],{"class":39,"line":142},[37,2302,2303],{},"                       // ActorAgent, ActorOrchestrator, ActorObserver\n",[37,2305,2306],{"class":39,"line":148},[37,2307,2308],{},"nolag.QoS              // QoSAtMostOnce, QoSAtLeastOnce, QoSExactlyOnce\n",[37,2310,2311],{"class":39,"line":154},[37,2312,76],{"emptyLinePlaceholder":75},[37,2314,2315],{"class":39,"line":160},[37,2316,2317],{},"// Sentinel Errors\n",[37,2319,2320],{"class":39,"line":166},[37,2321,2322],{},"nolag.ErrNotConnected  // Not connected to broker\n",[37,2324,2325],{"class":39,"line":172},[37,2326,2327],{},"nolag.ErrAuthFailed    // Authentication failed\n",[37,2329,2330],{"class":39,"line":177},[37,2331,2332],{},"nolag.ErrTimeout       // Operation timed out\n",[37,2334,2335],{"class":39,"line":183},[37,2336,76],{"emptyLinePlaceholder":75},[37,2338,2339],{"class":39,"line":189},[37,2340,2341],{},"// Data types\n",[37,2343,2344],{"class":39,"line":195},[37,2345,2346],{},"nolag.MessageMeta      // Message metadata (Sender, Timestamp, IsReplay, MsgID, Filter)\n",[37,2348,2349],{"class":39,"line":201},[37,2350,2351],{},"nolag.ActorPresence    // Presence info (ActorTokenID, ActorType, Presence, JoinedAt)\n",[37,2353,2354],{"class":39,"line":207},[37,2355,2356],{},"nolag.MessageHandler   // func(data any, meta MessageMeta)\n",[37,2358,2359],{"class":39,"line":212},[37,2360,2361],{},"nolag.EventHandler     // func(args ...any)\n",[37,2363,2364],{"class":39,"line":217},[37,2365,76],{"emptyLinePlaceholder":75},[37,2367,2368],{"class":39,"line":222},[37,2369,2370],{},"// REST API Client\n",[37,2372,2373],{"class":39,"line":228},[37,2374,2375],{},"nolag.API              // REST API client\n",[37,2377,2378],{"class":39,"line":234},[37,2379,2380],{},"nolag.APIOptions       // API client options\n",[37,2382,2383],{"class":39,"line":240},[37,2384,2385],{},"nolag.NoLagAPIError    // API error type\n",[37,2387,2388],{"class":39,"line":245},[37,2389,2390],{},"nolag.APIError         // Raw API error details\n",[37,2392,2393],{"class":39,"line":250},[37,2394,76],{"emptyLinePlaceholder":75},[37,2396,2397],{"class":39,"line":256},[37,2398,2399],{},"// Resources\n",[37,2401,2402],{"class":39,"line":262},[37,2403,2404],{},"nolag.AppResource, nolag.AppCreate, nolag.AppUpdate\n",[37,2406,2407],{"class":39,"line":267},[37,2408,2409],{},"nolag.RoomResource, nolag.RoomCreate, nolag.RoomUpdate\n",[37,2411,2412],{"class":39,"line":273},[37,2413,2414],{},"nolag.ActorResource, nolag.ActorWithToken, nolag.ActorCreate, nolag.ActorUpdate\n",[37,2416,2417],{"class":39,"line":279},[37,2418,2419],{},"nolag.ScopeResource, nolag.ScopeCreate, nolag.ScopeUpdate\n",[37,2421,2422],{"class":39,"line":1664},[37,2423,2424],{},"nolag.PaginatedApps, nolag.ListOptions\n",[18,2426,2428],{"id":2427},"requirements","Requirements",[1218,2430,2431,2434,2437],{},[1221,2432,2433],{},"Go 1.21+",[1221,2435,2436],{},"github.com/gorilla/websocket v1.5.1",[1221,2438,2439],{},"github.com/vmihailenco/msgpack/v5 v5.4.1",[18,2441,2443],{"id":2442},"next-steps","Next Steps",[1218,2445,2446,2453,2459],{},[1221,2447,2448],{},[2449,2450,2452],"a",{"href":2451},"/docs/concepts/topics","Learn about Topics",[1221,2454,2455],{},[2449,2456,2458],{"href":2457},"/docs/concepts/presence","Presence Tracking",[1221,2460,2461],{},[2449,2462,2464],{"href":2463},"/docs/api-reference","REST API Reference",[2466,2467,2468],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":32,"searchDepth":72,"depth":72,"links":2470},[2471,2472,2473,2474,2475,2476,2477,2478,2479,2480,2484,2485,2486,2487,2488,2489],{"id":20,"depth":72,"text":21},{"id":54,"depth":72,"text":55},{"id":285,"depth":72,"text":286},{"id":379,"depth":72,"text":380},{"id":511,"depth":72,"text":512},{"id":604,"depth":72,"text":605},{"id":783,"depth":72,"text":784},{"id":896,"depth":72,"text":897},{"id":1074,"depth":72,"text":1075},{"id":1212,"depth":72,"text":1213,"children":2481},[2482,2483],{"id":1260,"depth":79,"text":1261},{"id":1485,"depth":79,"text":1486},{"id":1703,"depth":72,"text":1704},{"id":1954,"depth":72,"text":1955},{"id":2148,"depth":72,"text":2149},{"id":2228,"depth":72,"text":2229},{"id":2427,"depth":72,"text":2428},{"id":2442,"depth":72,"text":2443},"Complete reference for the NoLag Go SDK. Connect, subscribe, publish, and manage real-time messaging with idiomatic Go patterns.","md",{},"/docs/sdks/go",{"title":5,"description":2490},"docs/sdks/go","CMKp07xevXE7eu9uie6uCV1CLVIyZ4PorAzMlgNQL8U",1788160344548]