Remove unuused parameters
This commit removes names for unusued parameters where they are no longer needed.
This commit is contained in:
parent
b45233b87c
commit
8ad8cf7994
24 changed files with 30 additions and 30 deletions
|
|
@ -31,7 +31,7 @@ var (
|
|||
errPasswordSet = errors.New("password was updated")
|
||||
)
|
||||
|
||||
func (panel *UserPanel) routePassword(ctx context.Context) http.Handler {
|
||||
func (panel *UserPanel) routePassword(context.Context) http.Handler {
|
||||
tpl := passwordTemplate.Prepare(panel.dependencies.Templating)
|
||||
|
||||
return &form.Form[struct{}]{
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ type SSHTemplateContext struct {
|
|||
Services []ssh2.Intercept
|
||||
}
|
||||
|
||||
func (panel *UserPanel) sshRoute(ctx context.Context) http.Handler {
|
||||
func (panel *UserPanel) sshRoute(context.Context) http.Handler {
|
||||
tpl := sshTemplate.Prepare(
|
||||
panel.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
@ -143,7 +143,7 @@ type addKeyResult struct {
|
|||
Key ssh.PublicKey
|
||||
}
|
||||
|
||||
func (panel *UserPanel) sshAddRoute(ctx context.Context) http.Handler {
|
||||
func (panel *UserPanel) sshAddRoute(context.Context) http.Handler {
|
||||
tpl := sshAddTemplate.Prepare(
|
||||
panel.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ type TokenTemplateContext struct {
|
|||
Tokens []models.Token
|
||||
}
|
||||
|
||||
func (panel *UserPanel) tokensRoute(ctx context.Context) http.Handler {
|
||||
func (panel *UserPanel) tokensRoute(context.Context) http.Handler {
|
||||
tpl := tokensTemplate.Prepare(
|
||||
panel.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
@ -122,7 +122,7 @@ type TokenCreateContext struct {
|
|||
Token *models.Token
|
||||
}
|
||||
|
||||
func (panel *UserPanel) tokensAddRoute(ctx context.Context) http.Handler {
|
||||
func (panel *UserPanel) tokensAddRoute(context.Context) http.Handler {
|
||||
tplForm := tokensAddTemplate.Prepare(
|
||||
panel.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ var totpEnable = templating.Parse[userFormContext](
|
|||
templating.Assets(assets.AssetsUser),
|
||||
)
|
||||
|
||||
func (panel *UserPanel) routeTOTPEnable(ctx context.Context) http.Handler {
|
||||
func (panel *UserPanel) routeTOTPEnable(context.Context) http.Handler {
|
||||
tpl := totpEnable.Prepare(panel.dependencies.Templating)
|
||||
|
||||
return &form.Form[struct{}]{
|
||||
|
|
@ -88,7 +88,7 @@ type totpEnrollContext struct {
|
|||
TOTPURL template.URL
|
||||
}
|
||||
|
||||
func (panel *UserPanel) routeTOTPEnroll(ctx context.Context) http.Handler {
|
||||
func (panel *UserPanel) routeTOTPEnroll(context.Context) http.Handler {
|
||||
tpl := totpEnrollTemplate.Prepare(
|
||||
panel.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
@ -174,7 +174,7 @@ var totpDisableTemplate = templating.Parse[userFormContext](
|
|||
templating.Assets(assets.AssetsUser),
|
||||
)
|
||||
|
||||
func (panel *UserPanel) routeTOTPDisable(ctx context.Context) http.Handler {
|
||||
func (panel *UserPanel) routeTOTPDisable(context.Context) http.Handler {
|
||||
tpl := totpDisableTemplate.Prepare(panel.dependencies.Templating)
|
||||
|
||||
return &form.Form[struct{}]{
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ func (g GrantWithURL) AdminURL() template.URL {
|
|||
return template.URL("/admin/instance/" + g.Slug)
|
||||
}
|
||||
|
||||
func (panel *UserPanel) routeUser(ctx context.Context) http.Handler {
|
||||
func (panel *UserPanel) routeUser(context.Context) http.Handler {
|
||||
actions := []component.MenuItem{
|
||||
menuChangePassword,
|
||||
menuTOTPAction,
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ func (auth *Auth) authLogin(ctx context.Context) http.Handler {
|
|||
}
|
||||
|
||||
// authLogout implements the authLogout view to logout a user
|
||||
func (auth *Auth) authLogout(ctx context.Context) http.Handler {
|
||||
func (auth *Auth) authLogout(context.Context) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// do the logout
|
||||
auth.Logout(w, r)
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ func (snapshots *Exporter) resolveParts(ctx context.Context, parts []string, sna
|
|||
}
|
||||
}
|
||||
|
||||
func (snapshot *Snapshot) makeParts(ctx context.Context, progress io.Writer, snapshots *Exporter, instance *wisski.WissKI, needsRunning bool) (errmap map[string]error, logmap map[string]string) {
|
||||
func (snapshot *Snapshot) makeParts(ctx context.Context, progress io.Writer, _ *Exporter, instance *wisski.WissKI, needsRunning bool) (errmap map[string]error, logmap map[string]string) {
|
||||
if !needsRunning && !snapshot.Description.Keepalive {
|
||||
stack := instance.Barrel().Stack()
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ type indexContext struct {
|
|||
Instances []status.WissKI
|
||||
}
|
||||
|
||||
func (admin *Admin) index(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) index(context.Context) http.Handler {
|
||||
tpl := indexTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
templating.Actions(
|
||||
|
|
@ -126,7 +126,7 @@ func (admin *Admin) index(ctx context.Context) http.Handler {
|
|||
})
|
||||
}
|
||||
|
||||
func (admin *Admin) instances(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) instances(context.Context) http.Handler {
|
||||
tpl := instancesTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ type instanceContext struct {
|
|||
Info status.WissKI
|
||||
}
|
||||
|
||||
func (admin *Admin) instance(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) instance(context.Context) http.Handler {
|
||||
tpl := instanceTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ type instanceDataContext struct {
|
|||
Prefixes []string
|
||||
}
|
||||
|
||||
func (admin *Admin) instanceData(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) instanceData(context.Context) http.Handler {
|
||||
tpl := instanceDataTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ type instanceDrupalContext struct {
|
|||
LastCron time.Time
|
||||
}
|
||||
|
||||
func (admin *Admin) instanceDrupal(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) instanceDrupal(context.Context) http.Handler {
|
||||
tpl := instanceDrupalTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import (
|
|||
_ "embed"
|
||||
)
|
||||
|
||||
func (admin *Admin) instanceProvision(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) instanceProvision(context.Context) http.Handler {
|
||||
tpl := instanceSystemTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ type instancePurgeContext struct {
|
|||
Instance *wisski.WissKI
|
||||
}
|
||||
|
||||
func (admin *Admin) instancePurge(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) instancePurge(context.Context) http.Handler {
|
||||
tpl := instancePurgeTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ func (isc *instanceSystemContext) prepare(rebuild bool) {
|
|||
isc.DefaultPHPVersion = models.DefaultPHPVersion
|
||||
}
|
||||
|
||||
func (admin *Admin) instanceRebuild(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) instanceRebuild(context.Context) http.Handler {
|
||||
tpl := instanceSystemTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ type instanceSnapshotsContext struct {
|
|||
Snapshots []models.Export
|
||||
}
|
||||
|
||||
func (admin *Admin) instanceSnapshots(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) instanceSnapshots(context.Context) http.Handler {
|
||||
tpl := instanceSnapshotsTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ type instanceSSHContext struct {
|
|||
Port uint16
|
||||
}
|
||||
|
||||
func (admin *Admin) instanceSSH(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) instanceSSH(context.Context) http.Handler {
|
||||
tpl := instanceSSHTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ type instanceStatsContext struct {
|
|||
Statistics status.Statistics
|
||||
}
|
||||
|
||||
func (admin *Admin) instanceStats(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) instanceStats(context.Context) http.Handler {
|
||||
tpl := instanceStatsTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ type instanceTriplestoreContext struct {
|
|||
Instance *wisski.WissKI
|
||||
}
|
||||
|
||||
func (admin *Admin) instanceTS(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) instanceTS(context.Context) http.Handler {
|
||||
tpl := instanceTriplestoreTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ type instanceUsersContext struct {
|
|||
Grants []models.Grant // grants that exist for the user
|
||||
}
|
||||
|
||||
func (admin *Admin) instanceUsers(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) instanceUsers(context.Context) http.Handler {
|
||||
tpl := instanceUsersTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ type usersContext struct {
|
|||
Users []*auth.AuthUser
|
||||
}
|
||||
|
||||
func (admin *Admin) users(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) users(context.Context) http.Handler {
|
||||
tpl := usersTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
@ -71,7 +71,7 @@ type createUserResult struct {
|
|||
Admin bool
|
||||
}
|
||||
|
||||
func (admin *Admin) createUser(ctx context.Context) http.Handler {
|
||||
func (admin *Admin) createUser(context.Context) http.Handler {
|
||||
tpl := userCreateTemplate.Prepare(
|
||||
admin.dependencies.Templating,
|
||||
templating.Crumbs(
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ func (home *Home) HandleRoute(ctx context.Context, route string) (http.Handler,
|
|||
}), nil
|
||||
}
|
||||
|
||||
func (home *Home) serveWissKI(w http.ResponseWriter, slug string, r *http.Request) {
|
||||
func (home *Home) serveWissKI(w http.ResponseWriter, slug string, _ *http.Request) {
|
||||
if _, ok := home.dependencies.ListInstances.Names()[slug]; !ok {
|
||||
// Get(nil) guaranteed to work by precondition
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ type publicContext struct {
|
|||
|
||||
const logoHTML = template.HTML(`<img src="/logo.svg" alt="WissKI Distillery Logo" class="biglogo">`)
|
||||
|
||||
func (home *Home) publicHandler(ctx context.Context) http.Handler {
|
||||
func (home *Home) publicHandler(context.Context) http.Handler {
|
||||
config := component.GetStill(home).Config.Home
|
||||
|
||||
tpl := publicTemplate.Prepare(
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import (
|
|||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
|
||||
)
|
||||
|
||||
func (home *Home) loadRedirect(ctx context.Context) (redirect Redirect, err error) {
|
||||
func (home *Home) loadRedirect(context.Context) (redirect Redirect, err error) {
|
||||
if redirect.Overrides == nil {
|
||||
redirect.Overrides = make(map[string]string)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ func (ssh2 *SSH2) ReadOrMakeHostKey(progress io.Writer, ctx context.Context, pri
|
|||
}
|
||||
|
||||
// loadHostKey loadsa host key
|
||||
func (ssh2 *SSH2) loadHostKey(progress io.Writer, ctx context.Context, key HostKey, path string) (err error) {
|
||||
func (ssh2 *SSH2) loadHostKey(progress io.Writer, _ context.Context, key HostKey, path string) (err error) {
|
||||
fmt.Fprintf(progress, "Loading hostkey (algorithm %s) from %q\n", key.Algorithm(), path)
|
||||
|
||||
// read all the bytes from the file
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue