Skip to content

Commit 2eb0043

Browse files
Add Go workflows api reference
1 parent c6f42b0 commit 2eb0043

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+861
-122
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
repos:
22
- repo: https://github.com/errata-ai/vale
3-
rev: v3.9.5
3+
rev: v3.9.6
44
hooks:
55
- id: vale

api-reference/go/datasets/client.Collections.Create.mdx renamed to api-reference/go/datasets/Collections.Create.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
title: Client.Collections.Create
3+
sidebarTitle: Collections.Create
34
icon: layer-group
45
---
56

67
```go
7-
client.Collections.Create(
8+
func (collectionClient) Create(
89
ctx context.Context,
910
datasetID uuid.UUID,
1011
collectionName string,

api-reference/go/datasets/client.Collections.Get.mdx renamed to api-reference/go/datasets/Collections.Get.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
title: Client.Collections.Get
3+
sidebarTitle: Collections.Get
34
icon: layer-group
45
---
56

67
```go
7-
client.Collections.Get(
8+
func (collectionClient) Get(
89
ctx context.Context,
910
datasetID uuid.UUID,
1011
name string,

api-reference/go/datasets/client.Collections.List.mdx renamed to api-reference/go/datasets/Collections.List.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
title: Client.Collections.List
3+
sidebarTitle: Collections.List
34
icon: layer-group
45
---
56

67
```go
7-
client.Collections.List(
8+
func (collectionClient) List(
89
ctx context.Context,
910
datasetID uuid.UUID,
1011
) ([]*Collection, error)

api-reference/go/datasets/client.Datapoints.Delete.mdx renamed to api-reference/go/datasets/Datapoints.Delete.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
title: Client.Datapoints.Delete
3+
sidebarTitle: Datapoints.Delete
34
icon: layer-group
45
---
56

67
```go
7-
client.Datapoints.Delete(
8+
func (datapointClient) Delete(
89
ctx context.Context,
910
collectionID uuid.UUID,
1011
datapoints any,

api-reference/go/datasets/client.Datapoints.DeleteIDs.mdx renamed to api-reference/go/datasets/Datapoints.DeleteIDs.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
title: Client.Datapoints.DeleteIDs
3+
sidebarTitle: Datapoints.DeleteIDs
34
icon: layer-group
45
---
56

67
```go
7-
client.Datapoints.DeleteIDs(
8+
func (datapointClient) DeleteIDs(
89
ctx context.Context,
910
collectionID uuid.UUID,
1011
datapointIDs []uuid.UUID,

api-reference/go/datasets/client.Datapoints.Ingest.mdx renamed to api-reference/go/datasets/Datapoints.Ingest.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
title: Client.Datapoints.Ingest
3+
sidebarTitle: Datapoints.Ingest
34
icon: layer-group
45
---
56

67
```go
7-
client.Datapoints.Ingest(
8+
func (datapointClient) Ingest(
89
ctx context.Context,
910
collectionID uuid.UUID,
1011
datapoints any,

api-reference/go/datasets/client.Datapoints.Load.mdx renamed to api-reference/go/datasets/Datapoints.Load.mdx

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
title: Client.Datapoints.Load
3+
sidebarTitle: Datapoints.Load
34
icon: layer-group
45
---
56

67
```go
7-
client.Datapoints.Load(
8+
func (datapointClient) Load(
89
ctx context.Context,
910
collectionID uuid.UUID,
1011
interval interval.LoadInterval,
@@ -29,6 +30,13 @@ The output sequence can be transformed into a typed `proto.Message` using `Colle
2930
Options for loading data points
3031
</ParamField>
3132

33+
## Options
34+
35+
<ParamField path="WithSkipData()" default="false">
36+
Skip the data when loading datapoints.
37+
If set, only the required and auto-generated fields will be returned.
38+
</ParamField>
39+
3240
## Returns
3341

3442
A sequence of bytes containing the requested data points as bytes.

api-reference/go/datasets/client.Datapoints.LoadInto.mdx renamed to api-reference/go/datasets/Datapoints.LoadInto.mdx

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
title: Client.Datapoints.LoadInto
3+
sidebarTitle: Datapoints.LoadInto
34
icon: layer-group
45
---
56

67
```go
7-
client.Datapoints.LoadInto(
8+
func (datapointClient) LoadInto(
89
ctx context.Context,
910
collectionID uuid.UUID,
1011
interval interval.LoadInterval,
@@ -30,6 +31,13 @@ Load a range of data points in this collection in a specified interval.
3031
Options for loading data points
3132
</ParamField>
3233

34+
## Options
35+
36+
<ParamField path="WithSkipData()" default="false">
37+
Skip the data when loading datapoints.
38+
If set, only the required and auto-generated fields will be returned.
39+
</ParamField>
40+
3341
## Returns
3442

3543
An error if data points could not be loaded.

api-reference/go/datasets/Client.Datasets.Get.mdx renamed to api-reference/go/datasets/Get.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
title: Client.Datasets.Get
3+
sidebarTitle: Get
34
icon: laptop-code
45
---
56

67
```go
7-
client.Datasets.Get(
8+
func (datasetClient) Get(
89
ctx context.Context,
910
slug string,
1011
) (*Dataset, error)

api-reference/go/datasets/Client.Datasets.List.mdx renamed to api-reference/go/datasets/List.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
title: Client.Datasets.List
3+
sidebarTitle: List
34
icon: laptop-code
45
---
56

67
```go
7-
client.Datasets.List(ctx context.Context) ([]*Dataset, error)
8+
func (datasetClient) List(ctx context.Context) ([]*Dataset, error)
89
```
910

1011
Fetch all available datasets.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Client.Clusters.Create
3+
sidebarTitle: Clusters.Create
4+
icon: circle-nodes
5+
---
6+
7+
```go
8+
func (*ClusterClient) Create(
9+
ctx context.Context,
10+
name string,
11+
) (*Cluster, error)
12+
```
13+
14+
Create a cluster.
15+
16+
## Parameters
17+
18+
<ParamField path="name" type="string">
19+
A display name for the cluster
20+
</ParamField>
21+
22+
## Returns
23+
24+
The created cluster object.
25+
26+
<RequestExample>
27+
```go Go
28+
cluster, err := client.Clusters.Create(ctx,
29+
"My cluster"
30+
)
31+
```
32+
</RequestExample>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Client.Clusters.Delete
3+
sidebarTitle: Clusters.Delete
4+
icon: circle-nodes
5+
---
6+
7+
```go
8+
func (*ClusterClient) Delete(ctx context.Context, slug string) error
9+
```
10+
11+
Delete a cluster by its slug.
12+
13+
## Parameters
14+
15+
<ParamField path="slug" type="string">
16+
The slug of the cluster to delete
17+
</ParamField>
18+
19+
## Returns
20+
21+
An error if the cluster could not be deleted.
22+
23+
<RequestExample>
24+
```go Go
25+
err := client.Clusters.Delete(ctx,
26+
"my-cluster-tZD9Ca1qsqt3V"
27+
)
28+
```
29+
</RequestExample>
30+
31+
## Errors
32+
33+
<ParamField path="not_found" type="cluster not found">
34+
The specified cluster does not exist.
35+
</ParamField>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: Client.Clusters.Get
3+
sidebarTitle: Clusters.Get
4+
icon: circle-nodes
5+
---
6+
7+
```go
8+
func (*ClusterClient) Get(
9+
ctx context.Context,
10+
slug string,
11+
) (*Cluster, error)
12+
```
13+
14+
Get a cluster by its slug.
15+
16+
## Parameters
17+
18+
<ParamField path="slug" type="string">
19+
The slug of the cluster
20+
</ParamField>
21+
22+
## Returns
23+
24+
A cluster object.
25+
26+
<RequestExample>
27+
```go Go
28+
cluster, err := client.Clusters.Get(ctx,
29+
"my-cluster-tZD9Ca1qsqt3V"
30+
)
31+
```
32+
</RequestExample>
33+
34+
## Errors
35+
36+
<ParamField path="not_found" type="cluster not found">
37+
The specified cluster does not exist.
38+
</ParamField>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Client.Clusters.List
3+
sidebarTitle: Clusters.List
4+
icon: circle-nodes
5+
---
6+
7+
```go
8+
func (*ClusterClient) List(ctx context.Context) ([]*Cluster, error)
9+
```
10+
11+
Fetch all available clusters.
12+
13+
## Returns
14+
15+
A list of all available clusters.
16+
17+
<RequestExample>
18+
```go Go
19+
clusters, err := client.Clusters.List(ctx)
20+
```
21+
</RequestExample>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: workflows.GetCurrentCluster
3+
sidebarTitle: GetCurrentCluster
4+
icon: code
5+
---
6+
7+
```go
8+
workflows.GetCurrentCluster(ctx context.Context) (string, error)
9+
```
10+
11+
Get the current cluster slug.
12+
13+
This function is intended to be used in tasks.
14+
15+
## Returns
16+
17+
The current cluster slug.
18+
19+
<RequestExample>
20+
```go Go
21+
type Task struct{}
22+
23+
func (t *Task) Execute(ctx context.Context) error {
24+
clusterSlug, err := workflows.GetCurrentCluster(ctx)
25+
if err != nil {
26+
return fmt.Errorf("failed to get current cluster: %w", err)
27+
}
28+
29+
return nil
30+
}
31+
```
32+
</RequestExample>
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: Client.Jobs.Cancel
3+
sidebarTitle: Jobs.Cancel
4+
icon: diagram-project
5+
---
6+
7+
```go
8+
func (*JobClient) Cancel(ctx context.Context, jobID uuid.UUID) error
9+
```
10+
11+
Cancel a job. When a job is canceled, no queued tasks will be picked up by task runners and executed even if task runners are idle. Tasks that are already being executed will finish their execution and not be interrupted. All sub-tasks spawned from such tasks after the cancellation will not be picked up by task runners.
12+
13+
## Parameters
14+
15+
<ParamField path="jobID" type="uuid.UUID">
16+
The id of the job
17+
</ParamField>
18+
19+
## Returns
20+
21+
An error if the job could not be cancelled.
22+
23+
<RequestExample>
24+
```go Go
25+
err := client.Jobs.Cancel(ctx,
26+
uuid.MustParse("0195c87a-49f6-5ffa-e3cb-92215d057ea6"),
27+
)
28+
```
29+
</RequestExample>
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: Client.Jobs.Get
3+
sidebarTitle: Jobs.Get
4+
icon: diagram-project
5+
---
6+
7+
```go
8+
func (*JobClient) Get(
9+
ctx context.Context,
10+
jobID uuid.UUID,
11+
) (*Job, error)
12+
```
13+
14+
Get a job by its id.
15+
16+
## Parameters
17+
18+
<ParamField path="jobID" type="uuid.UUID">
19+
The id of the job
20+
</ParamField>
21+
22+
## Returns
23+
24+
A job object.
25+
26+
<RequestExample>
27+
```go Go
28+
job, err := client.Jobs.Get(ctx,
29+
uuid.MustParse("0195c87a-49f6-5ffa-e3cb-92215d057ea6"),
30+
)
31+
```
32+
</RequestExample>
33+
34+
## Errors
35+
36+
<ParamField path="not_found" type="job not found">
37+
The specified job does not exist.
38+
</ParamField>

0 commit comments

Comments
 (0)