- Notifications
You must be signed in to change notification settings - Fork1.1k
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
b552283d6dd9e7c2ccfaba8a3781901d695d6c75707fc66d663cbc7982258ef5ac70d5b232f288a549a9dc44a71daff0abd237b195356400ec46e59983f216c422399f921a1dc0fa5efFile 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.