util

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileExtAsbx = ".asbx"
	FileExtAsb  = ".asb"
)

Variables

This section is empty.

Functions

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

func GetFileNumber(filename string) (uint64, error)

GetFileNumber returns file number from name.

func ListToMap

func ListToMap(slice []string) map[string]bool

func MergeChannels

func MergeChannels[T any](channels []<-chan T) <-chan T

func SortBackupFiles

func SortBackupFiles(files []string) ([]string, error)

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

func (*BytesWriteCloser) Write

func (w *BytesWriteCloser) Write(p []byte) (int, error)

Write writes data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL