- Notifications
You must be signed in to change notification settings - Fork1k
chore: Add workspace proxy enterprise cli commands#7176
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
b552283
d6dd9e7
c2ccfab
a8a3781
901d695
d6c7570
7fc66d6
63cbc79
82258ef
5ac70d5
b232f28
8a549a9
dc44a71
daff0ab
d237b19
5356400
ec46e59
983f216
c422399
f921a1d
c0fa5ef
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -192,3 +192,35 @@ func (textFormat) AttachOptions(_ *clibase.OptionSet) {} | ||
func (textFormat) Format(_ context.Context, data any) (string, error) { | ||
return fmt.Sprintf("%s", data), nil | ||
} | ||
// DataChangeFormat allows manipulating the data passed to an output format. | ||
// This is because sometimes the data needs to be manipulated before it can be | ||
// passed to the output format. | ||
// For example, you may want to pass something different to the text formatter | ||
// than what you pass to the json formatter. | ||
type DataChangeFormat struct { | ||
Emyrk marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
format OutputFormat | ||
change func(data any) (any, error) | ||
} | ||
// ChangeFormatterData allows manipulating the data passed to an output | ||
// format. | ||
func ChangeFormatterData(format OutputFormat, change func(data any) (any, error)) *DataChangeFormat { | ||
return &DataChangeFormat{format: format, change: change} | ||
} | ||
func (d *DataChangeFormat) ID() string { | ||
return d.format.ID() | ||
} | ||
func (d *DataChangeFormat) AttachOptions(opts *clibase.OptionSet) { | ||
d.format.AttachOptions(opts) | ||
} | ||
func (d *DataChangeFormat) Format(ctx context.Context, data any) (string, error) { | ||
newData, err := d.change(data) | ||
if err != nil { | ||
return "", err | ||
} | ||
return d.format.Format(ctx, newData) | ||
} |
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1697,6 +1697,10 @@ func (q *querier) GetWorkspaceProxyByID(ctx context.Context, id uuid.UUID) (data | ||
return fetch(q.log, q.auth, q.db.GetWorkspaceProxyByID)(ctx, id) | ||
} | ||
func (q *querier) GetWorkspaceProxyByName(ctx context.Context, name string) (database.WorkspaceProxy, error) { | ||
Emyrk marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
return fetch(q.log, q.auth, q.db.GetWorkspaceProxyByName)(ctx, name) | ||
} | ||
func (q *querier) GetWorkspaceProxyByHostname(ctx context.Context, hostname string) (database.WorkspaceProxy, error) { | ||
return fetch(q.log, q.auth, q.db.GetWorkspaceProxyByHostname)(ctx, hostname) | ||
} | ||
@@ -1705,11 +1709,11 @@ func (q *querier) InsertWorkspaceProxy(ctx context.Context, arg database.InsertW | ||
return insert(q.log, q.auth, rbac.ResourceWorkspaceProxy, q.db.InsertWorkspaceProxy)(ctx, arg) | ||
} | ||
func (q *querier)RegisterWorkspaceProxy(ctx context.Context, arg database.RegisterWorkspaceProxyParams) (database.WorkspaceProxy, error) { | ||
fetch := func(ctx context.Context, arg database.RegisterWorkspaceProxyParams) (database.WorkspaceProxy, error) { | ||
return q.db.GetWorkspaceProxyByID(ctx, arg.ID) | ||
} | ||
return updateWithReturn(q.log, q.auth, fetch, q.db.RegisterWorkspaceProxy)(ctx, arg) | ||
} | ||
func (q *querier) UpdateWorkspaceProxyDeleted(ctx context.Context, arg database.UpdateWorkspaceProxyDeletedParams) error { | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.