-
Notifications
You must be signed in to change notification settings - Fork 1
feat: migrate CLI to Cobra/Viper (#93) #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
09f2860
to
bf4b3e9
Compare
@@ -1,41 +0,0 @@ | |||
package main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've assumed this was a one-off helper, and removed it, I don't see it referenced anywhere in the go code or terraform.
@@ -48,7 +48,8 @@ func (p *PDPService) ProofSet(ctx context.Context, id int64) (*ProofSet, error) | |||
|
|||
// Step 5: Build the response. | |||
response := &ProofSet{ | |||
ID: proofSet.ID, | |||
ID: proofSet.ID, | |||
// TODO this will panic if ProveAtEpoch is nill, which it is when the proofset is first created |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not caused by this change, but found during testing - #111
8585fd7
to
e535ce1
Compare
e535ce1
to
4dbe20b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM and excited with this transition -- the automatic env var generation is great as are the config files.
This definitely gets me excited to expand the surface area of cobra/viper to other repos
`, | ||
} | ||
|
||
GenerateCmd = &cobra.Command{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
random formatting question -- why is generate declared up here but parse is declared below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, I got lazy, moved Parse to this same var declaration block.
cmd/api/client.go
Outdated
@@ -0,0 +1,52 @@ | |||
package api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious: how is this an API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ehh, it's not - naming is hard - renamed this to client
.
…93) Restructure CLI with clear separation between server and client operations, replacing urfave/cli with Cobra and Viper for improved configuration management. Architecture changes: - Introduce `piri serve <ucan|pdp>` for running different server types: - `piri serve pdp`: Start PDP (Provable Data Possession) server - `piri serve ucan`: Start UCAN authorization server - Add `piri client` commands for interacting with servers: - `piri client upload`: Upload data to storage servers - `piri client pdp`: PDP-specific client operations - piece info/management - proofset create/get/status operations - Clear separation of concerns between server hosting and client interactions Configuration improvements: - Unified config system supporting TOML files, env vars (PIRI_), and CLI flags - Type-safe configuration with validation - Proper precedence: flags > env > config file > defaults
4dbe20b
to
76a60c3
Compare
- all vas delcared together.
Restructure CLI with clear separation between server and client operations,
replacing urfave/cli with Cobra and Viper for improved configuration management.
Architecture changes:
piri serve <ucan|pdp>
for running different server types:piri serve pdp
: Start PDP (Provable Data Possession) serverpiri serve ucan
: Start UCAN authorization serverpiri client
commands for interacting with servers:piri client upload
: Upload data to storage serverspiri client pdp
: PDP-specific client operationsConfiguration improvements:
Closes #93