io

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: MulanPSL-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(name string, perm os.FileMode) (*os.File, error)

func IsDir

func IsDir(path string) bool

func OpenFile

func OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

func PathExists

func PathExists(path string) bool

func WriteJson

func WriteJson(fn string, m map[string]interface{}) error

Types

type RingStream added in v0.2.0

type RingStream struct {
	msync.Closer
	// contains filtered or unexported fields
}

func NewRingStream added in v0.2.0

func NewRingStream(size int) *RingStream

func (*RingStream) Len added in v0.2.0

func (b *RingStream) Len() int

func (*RingStream) Read added in v0.2.0

func (b *RingStream) Read(buf []byte) (int, error)

func (*RingStream) ReadBytes added in v0.2.0

func (b *RingStream) ReadBytes(n int, cb func([]byte)) (int, error)

如果n<=0,全部读取

func (*RingStream) TryReadBytes added in v0.2.0

func (b *RingStream) TryReadBytes(n int, cb func([]byte)) int

如果n<=0,全部读取

func (*RingStream) TryWrite added in v0.2.0

func (b *RingStream) TryWrite(p []byte) (int, error)

func (*RingStream) Write added in v0.2.0

func (b *RingStream) Write(p []byte) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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