Go
The Go client uses gRPC against the clone API. This is not CrowdStrike
production. Dial Compose Traefik at crowdstrike-grpc.localhost:8088.
The product sample is Hosts QueryDevices. Hello GetHello is a sample
health RPC, not a Falcon collection.
import (
"context"
"log"
"os"
platformsdk "github.com/cloud/platform/sdk/go"
genv1 "github.com/cloud/platform/sdk/go/genv1"
)
cl, err := platformsdk.Dial("crowdstrike-grpc.localhost:8088",
platformsdk.WithInsecure(),
platformsdk.WithToken(os.Getenv("PLATFORM_TOKEN")),
)
if err != nil {
log.Fatal(err)
}
defer cl.Close()
ctx := cl.Context(context.Background())
resp, err := cl.Hosts.QueryDevices(ctx, &genv1.QueryDevicesRequest{})
export PLATFORM_GRPC=crowdstrike-grpc.localhost:8088
export PLATFORM_TOKEN='<access_token from POST /oauth2/token>'
go run ./sdk/go/examples/hosts
Hello sample
hello, err := cl.Hello.GetHello(ctx, &genv1.GetHelloRequest{})
go run ./sdk/go/examples/hello
Install
- macOS
- Linux
- Windows
Needs Go 1.25+.
go get github.com/cloud/platform/sdk/go
Run that from the directory that contains your go.mod. Apple Silicon and
Intel both work.
Needs Go 1.25+.
go get github.com/cloud/platform/sdk/go
Run that from the directory that contains your go.mod.
Install Go 1.25+. In PowerShell, from the directory that
contains your go.mod:
go get github.com/cloud/platform/sdk/go