Documentation ¶
Index ¶
- Constants
- type Error
- type File
- func (f *File) Close() error
- func (f *File) Fd() uintptr
- func (f *File) Lock() error
- func (f *File) Name() string
- func (f *File) Read(p []byte) (n int, err error)
- func (f *File) SetDeadline(t time.Time) error
- func (f *File) SetReadDeadline(t time.Time) error
- func (f *File) SetWriteDeadline(t time.Time) error
- func (f *File) Unlock()
- func (f *File) Write(p []byte) (n int, err error)
- func (f *File) WriteString(s string) (int, error)
- type OsFile
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error int
Error is the type for the errors returned by poller functions and methods. See also the ErrXXX constants.
const ( ErrClosed Error = 1 // Use of closed poller file-descriptor ErrTimeout Error = 2 // Operation timed-out )
Errors returned by poller functions and methods. In addition to these, poller functions and methods may return the errors reported by the underlying system calls (open(2), read(2), write(2), etc.), as well as io.EOF and io.ErrUnexpectedEOF.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is an *os.File like object who adds polling capabilities
func NewFromFile ¶
NewFromFile returns a new *poll.File based on the given *os.File. You don't need to worry about closing the *os.File, *poll.File already does it.
func (*File) Close ¶
Close closes the File, rendering it unusable for I/O. It returns an error, if any.
func (*File) Lock ¶
Lock locks the file. It must be called before perfoming miscellaneous operations (e.g. ioctls) on the underlying system file descriptor.
func (*File) Read ¶
Read reads up to len(b) bytes from the File. It returns the number of bytes read and an error, if any.
func (*File) SetDeadline ¶
SetDeadline sets the deadline for Read and write operations on File.
func (*File) SetReadDeadline ¶
SetReadDeadline sets the deadline for Read operations on File.
func (*File) SetWriteDeadline ¶
SetWriteDeadline sets the deadline for Write operations on File.