Documentation
¶
Index ¶
- Constants
- func CheckDuplicates[T comparable](items []T) error
- func Diff[S ~[]E, E comparable](s1, s2 S) S
- func GetFileNumber(filename string) (uint64, error)
- func ListToMap(slice []string) map[string]bool
- func MergeChannels[T any](channels []<-chan T) <-chan T
- func SortBackupFiles(files []string) ([]string, error)
- type BytesWriteCloser
Constants ¶
View Source
const ( FileExtAsbx = ".asbx" FileExtAsb = ".asb" )
Variables ¶
This section is empty.
Functions ¶
func CheckDuplicates ¶ added in v0.8.0
func CheckDuplicates[T comparable](items []T) error
CheckDuplicates checks if a slice of ints or strings contains duplicates. It returns an error listing the duplicated values, or nil if all unique.
func Diff ¶
func Diff[S ~[]E, E comparable](s1, s2 S) S
Diff finds the difference between two slices. Returns elements from s1 that s2 don't contain.
func GetFileNumber ¶
GetFileNumber returns file number from name.
func MergeChannels ¶
func MergeChannels[T any](channels []<-chan T) <-chan T
func SortBackupFiles ¶
SortBackupFiles sort files for better restore performance.
Types ¶
type BytesWriteCloser ¶
type BytesWriteCloser struct {
// contains filtered or unexported fields
}
BytesWriteCloser implements io.WriteCloser for bytes.Buffer
func NewBytesWriteCloser ¶
func NewBytesWriteCloser(p []byte) *BytesWriteCloser
NewBytesWriteCloser returns io.WriteCloser for []bytes
func (*BytesWriteCloser) Buffer ¶
func (w *BytesWriteCloser) Buffer() *bytes.Buffer
Buffer returns buffer with data.
func (*BytesWriteCloser) Close ¶
func (w *BytesWriteCloser) Close() error
Close implements .Close() method for io.WriterCloser
Click to show internal directories.
Click to hide internal directories.