mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-03 01:48:32 +02:00
Fix type-checking errors in snippets (code only, no .md)
This commit both: - Fixes pre-existing mistakes in snippets, aka wrong code samples. - Adds hidden (`@hide`) statements that do not appear in the docs, but satisfy typecheckers.
This commit is contained in:
+2
-1
@@ -1,9 +1,10 @@
|
||||
|
||||
using Qdrant.Client; // @hide
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334); // @hide
|
||||
await client.CollectionExistsAsync("{collection_name}");
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -1,7 +1,16 @@
|
||||
package snippet
|
||||
|
||||
import "context"
|
||||
import "github.com/qdrant/go-client/qdrant" // @hide
|
||||
|
||||
func Main() {
|
||||
// @hide-start
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
if err != nil { panic(err) }
|
||||
// @hide-end
|
||||
|
||||
client.CollectionExists(context.Background(), "my_collection")
|
||||
}
|
||||
|
||||
+4
@@ -2,6 +2,10 @@ package com.example.snippets_amalgamation;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
// @hide-start
|
||||
io.qdrant.client.QdrantClient client =
|
||||
new io.qdrant.client.QdrantClient(io.qdrant.client.QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
// @hide-end
|
||||
client.collectionExistsAsync("{collection_name}").get();
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -1,6 +1,8 @@
|
||||
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = qdrant_client::Qdrant::from_url("http://localhost:6334").build()?; // @hide
|
||||
|
||||
client.collection_exists("{collection_name}").await?;
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user