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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Build
run: go build ./...

- name: Lint
uses: golangci/golangci-lint-action@v7
with:
version: v2.11

- name: Check module tidiness
run: |
go mod tidy
git diff --exit-code go.mod go.sum
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/
vendor/
.idea/
.vscode/
.DS_Store
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ toolchain go1.23.4

require (
github.com/alecthomas/kong v1.11.0
github.com/anduril/lattice-sdk-go/v2 v2.2.0
github.com/anduril/lattice-sdk-go/v4 v4.5.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/alecthomas/kong v1.11.0 h1:y++1gI7jf8O7G7l4LZo5ASFhrhJvzc+WgF/arranEm
github.com/alecthomas/kong v1.11.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU=
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc=
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/anduril/lattice-sdk-go/v2 v2.2.0 h1:7qEveGHtCoKd81of9PjPkNMLMCVMXMiJKwSVvavQIrY=
github.com/anduril/lattice-sdk-go/v2 v2.2.0/go.mod h1:LZXFUrBP6Zuq+IhNpqN1tiaMuC2WayvxlGVO+ApesKo=
github.com/anduril/lattice-sdk-go/v4 v4.5.0 h1:miiQk94+fRa5ZqokWy4uZL533/4qDGxbMOXYS262E4k=
github.com/anduril/lattice-sdk-go/v4 v4.5.0/go.mod h1:bGvU1erf9umZBBtdWyJn2mGtHPCx5g4mub97naVrOmM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
Expand Down
17 changes: 8 additions & 9 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"time"

"github.com/alecthomas/kong"
api "github.com/anduril/lattice-sdk-go/v2"
client "github.com/anduril/lattice-sdk-go/v2/client"
option "github.com/anduril/lattice-sdk-go/v2/option"
api "github.com/anduril/lattice-sdk-go/v4"
client "github.com/anduril/lattice-sdk-go/v4/client"
option "github.com/anduril/lattice-sdk-go/v4/option"
)

type cli struct {
Expand All @@ -36,7 +36,7 @@ func (d *deleteCmd) Run(kongCtx *kong.Context) error {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

if err := objectStoreClient.Objects.DeleteObject(ctx, d.Path); err != nil {
if err := objectStoreClient.Objects.DeleteObject(ctx, &api.DeleteObjectRequest{ObjectPath: d.Path}); err != nil {
return fmt.Errorf("unable to delete path %q: %w", d.Path, err)
}
fmt.Printf("deleted path %q\n", d.Path)
Expand Down Expand Up @@ -77,7 +77,7 @@ func (u *uploadCmd) Run(kongCtx *kong.Context) error {
if err != nil {
return fmt.Errorf("unable to open file %q: %w", u.InputPath, err)
}
defer fileReader.Close()
defer func() { _ = fileReader.Close() }()

fileBytes, err := io.ReadAll(fileReader)
if err != nil {
Expand Down Expand Up @@ -107,7 +107,7 @@ func (o *objectMetadataCmd) Run(kongCtx *kong.Context) error {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

header, err := objectStoreClient.Objects.WithRawResponse.GetObjectMetadata(ctx, o.Path)
header, err := objectStoreClient.Objects.WithRawResponse.GetObjectMetadata(ctx, &api.GetObjectMetadataRequest{ObjectPath: o.Path})
if err != nil {
return fmt.Errorf("unable to get object metadata for path %q, err=%w", o.Path, err)
}
Expand All @@ -132,8 +132,7 @@ func (o *getCmd) Run(kongCtx *kong.Context) error {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

request := &api.GetObjectRequest{}
objectReader, err := objectStoreClient.Objects.GetObject(ctx, o.ObjectStorePath, request)
objectReader, err := objectStoreClient.Objects.GetObject(ctx, &api.GetObjectRequest{ObjectPath: o.ObjectStorePath})
if err != nil {
return fmt.Errorf("unable to get file %q from object store: %w", o.ObjectStorePath, err)
}
Expand All @@ -142,7 +141,7 @@ func (o *getCmd) Run(kongCtx *kong.Context) error {
if err != nil {
return fmt.Errorf("unable to create writer for %q: %w", o.OutputPath, err)
}
defer outputWriter.Close()
defer func() { _ = outputWriter.Close() }()

bytesCopied, err := io.Copy(outputWriter, objectReader)
if err != nil {
Expand Down
Empty file.
85 changes: 0 additions & 85 deletions vendor/github.com/alecthomas/kong/.golangci.yml

This file was deleted.

19 changes: 0 additions & 19 deletions vendor/github.com/alecthomas/kong/COPYING

This file was deleted.

Loading
Loading