Files
navidrome/model/plugin.go
T

38 lines
1.4 KiB
Go

package model
import (
"context"
"time"
"github.com/deluan/rest"
)
type Plugin struct {
ID string `db:"id" json:"id"`
Path string `db:"path" json:"path"`
Manifest string `db:"manifest" json:"manifest"`
Config string `db:"config" json:"config,omitempty"`
Users string `db:"users" json:"users,omitempty"`
AllUsers bool `db:"all_users" json:"allUsers,omitempty"`
Libraries string `db:"libraries" json:"libraries,omitempty"`
AllLibraries bool `db:"all_libraries" json:"allLibraries,omitempty"`
AllowWriteAccess bool `db:"allow_write_access" json:"allowWriteAccess,omitempty"`
Enabled bool `db:"enabled" json:"enabled"`
LastError string `db:"last_error" json:"lastError,omitempty"`
SHA256 string `db:"sha256" json:"sha256"`
CreatedAt time.Time `db:"created_at,noupdate" json:"createdAt"`
UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
}
type Plugins []Plugin
type PluginRepository interface {
rest.Repository[Plugin]
ClearErrors(ctx context.Context) error
CountAll(ctx context.Context, options ...QueryOptions) (int64, error)
Delete(ctx context.Context, id string) error
Get(ctx context.Context, id string) (*Plugin, error)
GetAll(ctx context.Context, options ...QueryOptions) (Plugins, error)
Put(ctx context.Context, p *Plugin) error
}