Skip to content

feat: add Command() method to bindcom.Command#15

Closed
alanshaw wants to merge 1 commit into
mainfrom
ash/feat/add-bindcom-command-method
Closed

feat: add Command() method to bindcom.Command#15
alanshaw wants to merge 1 commit into
mainfrom
ash/feat/add-bindcom-command-method

Conversation

@alanshaw
Copy link
Copy Markdown
Member

@alanshaw alanshaw commented May 19, 2026

re: fil-forge/libforge#26 (comment)

I'm not super keen but it's not terrible...

Instead of:

// content/retrieve.go

Retrieve := bindcom.Parse[*RetrieveArgs]("/content/retrieve")

// server.go

s := retrieval.NewServer(service)
s.Handle(ucan.Command(content.Retrieve), /* ... */)

You can do:

s.Handle(content.Retrieve.Command(), /* ... */)

Alternative to #16

@alanshaw alanshaw requested review from Peeja and frrist May 19, 2026 15:41
@alanshaw alanshaw closed this May 19, 2026
@alanshaw alanshaw deleted the ash/feat/add-bindcom-command-method branch May 19, 2026 19:32
alanshaw added a commit that referenced this pull request May 19, 2026
re: fil-forge/libforge#26 (comment)

Instead of:

```go
// content/retrieve.go

Retrieve := bindcom.Parse[*RetrieveArgs]("/content/retrieve")

// server.go

s := retrieval.NewServer(service)
s.Handle(ucan.Command(content.Retrieve), /* ... */)
```

You can do:

```go
s.Handle(content.Retrieve.Command, /* ... */)
```

Alternative to #15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant