summaryrefslogtreecommitdiff
path: root/lib/diskio/file_iface.go
blob: 206db0c5c2d56d2f7f1a4dc889f195b2426ced52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (C) 2022  Luke Shumaker <lukeshu@lukeshu.com>
//
// SPDX-License-Identifier: GPL-2.0-or-later

package diskio

import (
	"io"
)

type File[A ~int64] interface {
	Name() string
	Size() A
	Close() error
	ReadAt(p []byte, off A) (n int, err error)
	WriteAt(p []byte, off A) (n int, err error)
}

type assertAddr int64

var (
	_ io.WriterAt = File[int64](nil)
	_ io.ReaderAt = File[int64](nil)
)