Documentation ¶
Index ¶
Constants ¶
const ( // DefaultChunkSize is the default value for the ChunkSize option DefaultChunkSize = 1024 // DefaultMaxBufferSize is the default value for the MaxBufferSize option DefaultMaxBufferSize = 1024000 // 1 MB )
Variables ¶
This section is empty.
Functions ¶
func PathExists ¶
判断文件或文件夹是否存在 如果返回的错误为nil,说明文件或文件夹存在 如果返回的错误类型使用os.IsNotExist()判断为true,说明文件或文件夹不存在 如果返回的错误为其它类型,则不确定是否在存在
func RegisterLogRouter ¶
Types ¶
type ListResponse ¶
type Options ¶
type Options struct { // ChunkSize specifies the size of the chunk that is read at once from the input. ChunkSize int // MaxBufferSize limits the maximum size of the buffer used internally. // This also limits the max line size. MaxBufferSize int }
Options contains parameters that influence the internal working of the Scanner.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is the back-scanner implementation.
func BackScannerNew ¶
New returns a new Scanner.
func NewOptions ¶
NewOptions returns a new Scanner with the given Options. Invalid option values are replaced with their default values.
func (*Scanner) Line ¶
Line returns the next line from the input and its absolute byte-position. Line ending is cut from the line. Empty lines are also returned. After returning the last line (which is the first in the input), subsequent calls report io.EOF.
func (*Scanner) LineBytes ¶
LineBytes returns the bytes of the next line from the input and its absolute byte-position. Line ending is cut from the line. Empty lines are also returned. After returning the last line (which is the first in the input), subsequent calls report io.EOF.
This method is for efficiency if you need to inspect or search in the line. The returned line slice shares data with the internal buffer of the Scanner, and its content may be overwritten in subsequent calls to LineBytes() or Line(). If you need to retain the line data, make a copy of it or use the Line() method.