file

package
v0.0.0-...-89416fd Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataStartIndex = 23 // file: begin 0755 default.dat\n<data>\nend\n
	DataEndIndex   = -3
)

Variables

This section is empty.

Functions

func DatFileFooter

func DatFileFooter() []byte

func DatFileHeader

func DatFileHeader(file string) []byte

func DecodeBlock

func DecodeBlock(rows []string) ([]byte, error)

DecodeBlock decodes a uuencoded text block

func DecodeLine

func DecodeLine(s string) ([]byte, error)

DecodeLine decodes a single line of uuencoded text

func Encode

func Encode(data []byte, filename, mode string) ([]byte, error)

Encode encodes data into uuencoded format, with header and footer

func EncodeBlock

func EncodeBlock(data []byte) ([]byte, error)

EncodeBlock encodes data in raw uuencoded format

func NewDatFile

func NewDatFile(dir, fileName string) (*os.File, error)

Types

type Arena

type Arena []byte

func (*Arena) Get

func (na *Arena) Get(len_ int) []byte

type Decoded

type Decoded struct {
	Data     []byte
	Filename string
	Mode     string
}

func Decode

func Decode(data []byte) (*Decoded, error)

type Map

type Map interface {
	io.ReadWriteCloser
	io.Seeker
	io.ReaderAt
	Bytes() []byte
	Len() int
	Pos() int
	MLock() error
	MUnlock() error
	Append([]byte) (int, int, error)
	Peek([]byte, int64, int64) (int, error)
}

func NewMap

func NewMap(f *os.File, opts ...Option) (Map, error)

type Option

type Option func(m *mmap)

func Flag

func Flag(f int) Option

func Length

func Length(s int) Option

func Offset

func Offset(o int64) Option

func Prot

func Prot(p int) Option

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func ScanCSV

func ScanCSV(data string) *Reader

func (*Reader) Close

func (s *Reader) Close()

func (*Reader) Err

func (s *Reader) Err() *gerrors.Error

func (*Reader) Init

func (s *Reader) Init()

func (*Reader) Rows

func (s *Reader) Rows() [][]string

func (*Reader) Scan

func (s *Reader) Scan() bool

Jump to

Keyboard shortcuts

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