Skip to content
Draft
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
3 changes: 3 additions & 0 deletions .github/workflows/golang-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ jobs:
uses: protocol/multiple-go-modules@v1.4
with:
run: go vet ./...
- name: Check generated RPC client
if: always()
run: go run ./tools/gen-rpc-client -check ./client/rpc/
10 changes: 10 additions & 0 deletions Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ mod_tidy:
@find . -name go.mod -execdir $(GOCC) mod tidy \;
.PHONY: mod_tidy

rpc_client:
$(GOCC) run ./tools/gen-rpc-client -output ./client/rpc/
.PHONY: rpc_client

rpc_client_check:
$(GOCC) run ./tools/gen-rpc-client -check ./client/rpc/
.PHONY: rpc_client_check

coverage: $(COVERAGE)
.PHONY: coverage

Expand Down Expand Up @@ -124,6 +132,7 @@ help:
@echo ' nofuse - Build binary with no fuse support'
@echo ' install - Build binary and install into $$GOBIN'
@echo ' mod_tidy - Remove unused dependencies from go.mod files'
@echo ' rpc_client - Regenerate client/rpc/gen_*.go from command definitions'
# @echo ' dist_install - TODO: c.f. ./cmd/ipfs/dist/README.md'
@echo ''
@echo 'CLEANING TARGETS:'
Expand All @@ -142,6 +151,7 @@ help:
@echo ' test_go_build - Build kubo for all platforms from .github/build-platforms.yml'
@echo ' test_go_lint - Run golangci-lint'
@echo ' test_sharness - Run sharness tests'
@echo ' rpc_client_check - Verify generated RPC client is up to date'
@echo ' coverage - Collect coverage info from unit tests and sharness'
@echo
.PHONY: help
10 changes: 10 additions & 0 deletions client/rpc/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,42 +218,52 @@ func (api *HttpApi) Request(command string, args ...string) RequestBuilder {
}
}

// Deprecated: use HttpApi methods directly (e.g., api.Add, api.Ls).
func (api *HttpApi) Unixfs() iface.UnixfsAPI {
return (*UnixfsAPI)(api)
}

// Deprecated: use HttpApi methods directly (e.g., api.BlockGet, api.BlockPut, api.BlockStat).
func (api *HttpApi) Block() iface.BlockAPI {
return (*BlockAPI)(api)
}

// Deprecated: use HttpApi methods directly (e.g., api.DagGet, api.DagPut, api.DagStat).
func (api *HttpApi) Dag() iface.APIDagService {
return (*HttpDagServ)(api)
}

// Deprecated: use HttpApi methods directly (e.g., api.NamePublish, api.NameResolve).
func (api *HttpApi) Name() iface.NameAPI {
return (*NameAPI)(api)
}

// Deprecated: use HttpApi methods directly (e.g., api.KeyGen, api.KeyLs, api.KeyRm).
func (api *HttpApi) Key() iface.KeyAPI {
return (*KeyAPI)(api)
}

// Deprecated: use HttpApi methods directly (e.g., api.PinAdd, api.PinLs, api.PinRm).
func (api *HttpApi) Pin() iface.PinAPI {
return (*PinAPI)(api)
}

// Deprecated: use HttpApi methods directly (e.g., api.ObjectPatchAddLink, api.ObjectDiff).
func (api *HttpApi) Object() iface.ObjectAPI {
return (*ObjectAPI)(api)
}

// Deprecated: use HttpApi methods directly (e.g., api.SwarmPeers, api.SwarmConnect).
func (api *HttpApi) Swarm() iface.SwarmAPI {
return (*SwarmAPI)(api)
}

// Deprecated: use HttpApi methods directly (e.g., api.PubsubLs, api.PubsubPub, api.PubsubSub).
func (api *HttpApi) PubSub() iface.PubSubAPI {
return (*PubsubAPI)(api)
}

// Deprecated: use HttpApi methods directly (e.g., api.RoutingFindpeer, api.RoutingFindprovs).
func (api *HttpApi) Routing() iface.RoutingAPI {
return (*RoutingAPI)(api)
}
Expand Down
2 changes: 2 additions & 0 deletions client/rpc/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
mh "github.com/multiformats/go-multihash"
)

// Deprecated: use HttpApi.BlockGet, HttpApi.BlockPut, HttpApi.BlockRm, HttpApi.BlockStat instead.
// This type implements the legacy CoreAPI BlockAPI interface and will be removed in a future release.
type BlockAPI HttpApi

type blockStat struct {
Expand Down
2 changes: 2 additions & 0 deletions client/rpc/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
multicodec "github.com/multiformats/go-multicodec"
)

// Deprecated: use HttpApi.DagGet, HttpApi.DagPut, HttpApi.DagStat, HttpApi.DagExport, HttpApi.DagImport instead.
// These types implement the legacy CoreAPI APIDagService interface and will be removed in a future release.
type (
httpNodeAdder HttpApi
HttpDagServ httpNodeAdder
Expand Down
271 changes: 271 additions & 0 deletions client/rpc/gen_add.go

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

Loading
Loading