chore(provider): fix lint errors and add missing file
This commit is contained in:
parent
7e1e9eb26b
commit
1760c847c9
4 changed files with 25 additions and 4 deletions
|
@ -23,6 +23,4 @@ provider "forgejo" {
|
||||||
api_token = var.forgejo_api_token
|
api_token = var.forgejo_api_token
|
||||||
base_url = "https://git.adyxax.org/"
|
base_url = "https://git.adyxax.org/"
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO
|
|
||||||
```
|
```
|
||||||
|
|
23
internal/client/settings_api.go
Normal file
23
internal/client/settings_api.go
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
package client
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/url"
|
||||||
|
)
|
||||||
|
|
||||||
|
type SettingsApi struct {
|
||||||
|
MaxResponseItems int `json:"max_response_items"`
|
||||||
|
DefaultPagingNum int `json:"default_paging_num"`
|
||||||
|
DefaultGitTreesPerPage int `json:"default_git_trees_per_page"`
|
||||||
|
DefaultMaxBlobSize int `json:"default_max_blob_size"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) settingsApiGet() (*SettingsApi, error) {
|
||||||
|
uriRef := url.URL{Path: "api/v1/settings/api"}
|
||||||
|
response := SettingsApi{}
|
||||||
|
if _, err := c.send(context.Background(), "GET", &uriRef, nil, &response); err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get settings api: %w", err)
|
||||||
|
}
|
||||||
|
return &response, nil
|
||||||
|
}
|
|
@ -138,7 +138,7 @@ func (d *RepositoryActionsVariableResource) Update(ctx context.Context, req reso
|
||||||
plannedData.Name.ValueString(),
|
plannedData.Name.ValueString(),
|
||||||
plannedData.Data.ValueString())
|
plannedData.Data.ValueString())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
resp.Diagnostics.AddError("UpdateRepositoryActionsVariable", fmt.Sprintf("failed to update repository actions variable %s %s: %s", stateData.Name.ValueString(), err))
|
resp.Diagnostics.AddError("UpdateRepositoryActionsVariable", fmt.Sprintf("failed to update repository actions variable: %s", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp.Diagnostics.Append(resp.State.Set(ctx, &plannedData)...)
|
resp.Diagnostics.Append(resp.State.Set(ctx, &plannedData)...)
|
||||||
|
|
|
@ -187,5 +187,5 @@ func (d *RepositoryPushMirrorResource) Read(ctx context.Context, req resource.Re
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *RepositoryPushMirrorResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
|
func (d *RepositoryPushMirrorResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
|
||||||
resp.Diagnostics.AddError("UpdateRepositoryPushMirror", fmt.Sprintf("unreachable code"))
|
resp.Diagnostics.AddError("UpdateRepositoryPushMirror", "unreachable code")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue