Skip to content

cmd/tap: split tap service from command#1292

Draft
davecheney wants to merge 1 commit intomainfrom
dfc/split-cmd-tap
Draft

cmd/tap: split tap service from command#1292
davecheney wants to merge 1 commit intomainfrom
dfc/split-cmd-tap

Conversation

@davecheney
Copy link
Contributor

@davecheney davecheney commented Jan 27, 2026

This PR explores seperating the cmd/tap, the binary that holds main(), from tap, the service (or perhaps component if one was so keen as to run tap as part of a larger application).

Some plusses; main.NewTap becomes tap.New(), main.TapConfig becomes tap.Config, which is always pleasing to see. The downside is the shadowing of tap, err := tap.New(...), which is perfectly cromulent, but the shadowing may not be to everyone's taste. This could be resolved by t, err := tap.New(...) if you're ok with the brevity, or theTap, err := tap.New(...) if you feel like pushing the boat out.

This also gives names to the other tap components, eg, tap.Crawler which is a hint that it may not belong in the tap package. Another clue is tap.Crawler (crawler.go) doesn't import any of the usual suspects like ../tap/models. This is something to explore in the future.

Not really for review, more for discussion

@davecheney davecheney force-pushed the dfc/split-cmd-tap branch 2 times, most recently from b76239f to 21c88bc Compare January 27, 2026 22:29
Copy link
Member

@jcalabro jcalabro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one question, otherwise I'm down with the pattern

I was heavily using ./internal in https://github.com/bluesky-social/indigo/tree/jc/cask

This PR explores seperating the cmd/tap, the binary that holds main(),
from tap, the service (or perhaps component if one was so keen as to run
tap as part of a larger application).

Some plusses; main.NewTap becomes tap.New(), main.TapConfig becomes
tap.Config, which is always pleasing to see. The downside is the
shadowing of `tap, err := tap.New(...)`, which is perfectly cromulent,
but the shaddowing may not be to everyone's taste. This could be
resolved by `t, err := tap.New(...)` if you're ok with the brevity, or
`theTap, err := tap.New(...)` if you feel like pushing the boat out.
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.

2 participants