18 lines
646 B
Go
18 lines
646 B
Go
|
|
package contract
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
"io"
|
||
|
|
)
|
||
|
|
|
||
|
|
// FileStorage delegates customer-service file persistence to the host system.
|
||
|
|
// The customer-service module keeps only its asset metadata and never owns a
|
||
|
|
// second set of local/cloud storage settings.
|
||
|
|
type FileStorage interface {
|
||
|
|
DefaultProvider(ctx context.Context) (string, error)
|
||
|
|
Upload(ctx context.Context, provider, key, filename, mimeType string, size int64, reader io.Reader) (string, error)
|
||
|
|
Open(ctx context.Context, provider, key string) (io.ReadCloser, error)
|
||
|
|
URL(ctx context.Context, provider, key string) (string, error)
|
||
|
|
Delete(ctx context.Context, provider, key string) error
|
||
|
|
}
|