Documentation
¶
Index ¶
- Constants
- type CryptyMW
- type File
- func (f *File) Append(nf *File) (err error)
- func (f *File) Close() (err error)
- func (f *File) Flush() (err error)
- func (f *File) Location() (loc string)
- func (f *File) NextLine() (err error)
- func (f *File) Open() (err error)
- func (f *File) PrevLine() (err error)
- func (f *File) ReadLine(fn func(*bytes.Buffer)) (err error)
- func (f *File) ReadLines(fn func(*bytes.Buffer) bool) (err error)
- func (f *File) SeekToEnd() (err error)
- func (f *File) SeekToLine(n int) (err error)
- func (f *File) SeekToStart() (err error)
- func (f *File) WriteLine(b []byte) (err error)
- type GZipMW
- type Middleware
- type Opts
Constants ¶
View Source
const ( // SyncBackend is for synchronous backends SyncBackend uint8 = iota // AsyncBackend is for asychronous backends AsyncBackend )
View Source
const ( // ErrLineNotFound is returned when a line is not found while calling SeekNextLine ErrLineNotFound = errors.Error("line not found") // ErrIsClosed is returned when an action is attempted on a closed instance ErrIsClosed = errors.Error("cannot perform action on closed instance") // ErrIsOpen is returned when an instance is attempted to be re-opened when it's already active ErrIsOpen = errors.Error("cannot open an instance which is already open") // ErrInvalidOptions is returned when options are invalid ErrInvalidOptions = errors.Error("options are invalid") // ErrInvalidLineNumber is returned when an invalid line number is provided ErrInvalidLineNumber = errors.Error("invalid line number provided") // ErrInvalidBackend is returned when an invalid backend option is set in the options ErrInvalidBackend = errors.Error("invalid backend option provided") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CryptyMW ¶
type CryptyMW struct {
// contains filtered or unexported fields
}
CryptyMW handles encryption
func NewCryptyMW ¶
NewCryptyMW returns a new Crypty middleware
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is a line-based file for easy management
func (*File) ReadLines ¶
ReadLines will return all lines in the form of an a bytes.Buffer Provided function can return true to end iteration early
func (*File) SeekToStart ¶
SeekToStart will seek the file to the start
type GZipMW ¶
type GZipMW struct {
}
GZipMW handles gzipping
type Middleware ¶
type Middleware interface {
Name() string
Writer(w io.Writer) (io.WriteCloser, error)
Reader(r io.Reader) (io.ReadCloser, error)
}
Middleware is the interface that defines an encoder/decoder chain.
Click to show internal directories.
Click to hide internal directories.