Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
189 changes: 0 additions & 189 deletions LICENSE

This file was deleted.

57 changes: 35 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
# Lattice SDK Go library
# Lattice SDK Go Library

![](https://www.anduril.com/lattice-sdk/)

The Lattice SDK Go library provides convenient access to the Lattice API from Go.

The Lattice SDK Go library provides convenient access to the Lattice SDK APIs from Go.

## Documentation

API reference documentation is available [here](https://developer.anduril.com/).

## Requirements

To use the SDK please ensure you have the following installed:

* [Go](https://go.dev/doc/install)

## Installation

Install the Lattice SDK package with

```
go get github.com/anduril/lattice-sdk-go/v2
```

## Support
## Reference

For support with this library please reach out to your Anduril representative.
A full reference for this library is available [here](./reference.md).

## Usage

Expand All @@ -36,8 +23,8 @@ package example
import (
client "github.com/anduril/lattice-sdk-go/v2/client"
option "github.com/anduril/lattice-sdk-go/v2/option"
context "context"
Lattice "github.com/anduril/lattice-sdk-go/v2"
context "context"
)

func do() {
Expand All @@ -46,11 +33,12 @@ func do() {
"<token>",
),
)
request := &Lattice.EntityEventRequest{
SessionToken: "sessionToken",
}
client.Entities.LongPollEntityEvents(
context.TODO(),
&Lattice.EntityEventRequest{
SessionToken: "sessionToken",
},
request,
)
}
```
Expand Down Expand Up @@ -139,6 +127,9 @@ A request is deemed retryable when any of the following HTTP status codes is ret
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)

If the `Retry-After` header is present in the response, the SDK will prioritize respecting its value exactly
over the default exponential backoff.

Use the `option.WithMaxAttempts` option to configure this behavior for the entire client or an individual request:

```go
Expand All @@ -162,3 +153,25 @@ defer cancel()

response, err := client.Entities.LongPollEntityEvents(ctx, ...)
```

### Explicit Null

If you want to send the explicit `null` JSON value through an optional parameter, you can use the setters\
that come with every object. Calling a setter method for a property will flip a bit in the `explicitFields`
bitfield for that setter's object; during serialization, any property with a flipped bit will have its
omittable status stripped, so zero or `nil` values will be sent explicitly rather than omitted altogether:

```go
type ExampleRequest struct {
// An optional string parameter.
Name *string `json:"name,omitempty" url:"-"`

// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}

request := &ExampleRequest{}
request.SetName(nil)

response, err := client.Entities.LongPollEntityEvents(ctx, request, ...)
```
11 changes: 5 additions & 6 deletions client/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/client_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions core/request_option.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading