Sybren A. Stüvel a9bec98fcd Fix linter warnings
Fix most linter warnings reported by 'staticcheck'. This doesn't fix all
of them, some unused functions are still there, and some generated code
also still triggers some warnings. Most issues are fixed, though.

No functional changes, except for the captialisation of some error
messages.
2024-12-01 14:49:25 +01:00

40 lines
1.3 KiB
Go

package dummy
// SPDX-License-Identifier: GPL-3.0-or-later
import (
"context"
"errors"
"io"
"projects.blender.org/studio/flamenco/internal/manager/api_impl"
"projects.blender.org/studio/flamenco/pkg/api"
)
// DummyShaman implements the Shaman interface from `internal/manager/api_impl/interfaces.go`
type DummyShaman struct{}
var _ api_impl.Shaman = (*DummyShaman)(nil)
//lint:ignore ST1005 Shaman is a name that's always capitalised, so also in errors.
var ErrDummyShaman = errors.New("Shaman storage component is inactive, configure Flamenco first")
func (ds *DummyShaman) IsEnabled() bool {
return false
}
func (ds *DummyShaman) Checkout(ctx context.Context, checkout api.ShamanCheckout) (string, error) {
return "", ErrDummyShaman
}
func (ds *DummyShaman) Requirements(ctx context.Context, requirements api.ShamanRequirementsRequest) (api.ShamanRequirementsResponse, error) {
return api.ShamanRequirementsResponse{}, ErrDummyShaman
}
func (ds *DummyShaman) FileStoreCheck(ctx context.Context, checksum string, filesize int64) api.ShamanFileStatus {
return api.ShamanFileStatusUnknown
}
func (ds *DummyShaman) FileStore(ctx context.Context, file io.ReadCloser, checksum string, filesize int64, canDefer bool, originalFilename string) error {
return ErrDummyShaman
}
func (ds *DummyShaman) EraseCheckout(checkoutID string) error {
return ErrDummyShaman
}