Rework actions to be loaded dynamically
This commit is contained in:
parent
e49f89d4ee
commit
08ab7b4383
22 changed files with 934 additions and 81 deletions
32
internal/dis/component/server/admin/socket/actions/cron.go
Normal file
32
internal/dis/component/server/admin/socket/actions/cron.go
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package actions
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/auth/scopes"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/wisski"
|
||||
)
|
||||
|
||||
type Cron struct {
|
||||
component.Base
|
||||
}
|
||||
|
||||
var (
|
||||
_ WebsocketInstanceAction = (*Cron)(nil)
|
||||
)
|
||||
|
||||
func (*Cron) Action() InstanceAction {
|
||||
return InstanceAction{
|
||||
Action: Action{
|
||||
Name: "cron",
|
||||
Scope: scopes.ScopeUserAdmin,
|
||||
NumParams: 0,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Cron) Act(ctx context.Context, instance *wisski.WissKI, in io.Reader, out io.Writer, params ...string) error {
|
||||
return instance.Drush().Cron(ctx, out)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue