20 lines
555 B
Go
Raw Normal View History

2025-02-05 18:07:53 +08:00
package model
2025-02-07 18:00:10 +08:00
import "context"
2025-02-05 18:07:53 +08:00
type IOType string
const (
Input IOType = "input"
Output IOType = "output"
)
type IO[T any] interface {
2025-02-07 18:00:10 +08:00
ReadData(ctx context.Context, limit int, query map[string]any, fields []string, sort []string) ([]T, error)
WriteData(ctx context.Context, items []T) (int, error)
ReadMapping(ctx context.Context) (map[string]any, error)
WriteMapping(ctx context.Context, mapping map[string]any) error
ReadSetting(ctx context.Context) (map[string]any, error)
WriteSetting(ctx context.Context, setting map[string]any) error
2025-02-05 18:07:53 +08:00
}