Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyCommonCfgToRW(rw RW, cfg *ExtraCfg)
- func FileExtFromCompressCfg(c *CompressCfg) string
- func NewCmdCfg() *cmd.Cfg
- func NewGzipReader(r io.ReadCloser, cfg *CompressCfg) io.ReadCloser
- func NewGzipWritter(w io.WriteCloser, cfg *CompressCfg) io.WriteCloser
- func NewSnappyReader(r io.ReadCloser, _ *CompressCfg) io.ReadCloser
- func NewSnappyWriter(w io.WriteCloser, cfg *CompressCfg) io.WriteCloser
- func NewZstdReader(r io.ReadCloser, cfg *CompressCfg) io.ReadCloser
- func NewZstdWriter(w io.WriteCloser, cfg *CompressCfg) io.WriteCloser
- type Cfg
- type Cmd
- type Compress
- type CompressCfg
- type CompressLevel
- type CompressType
- type Copy
- type CopyCfg
- type ExtraCfg
- type File
- type FileCfg
- type Ftp
- type FtpCfg
- type Nop
- type NopCfg
- type Null
- type NullCfg
- type OSS
- type OSSCfg
- type RW
- type ReadHook
- type Role
- type SSH
- type SSHCfg
- type Tail
- type TailCfg
- type Type
- type WriteHook
Constants ¶
View Source
const ( TypeCompress Type = "compress" CompressTypeNop CompressType = "nop" CompressTypeGzip CompressType = "gzip" CompressTypeSnappy CompressType = "snappy" CompressTypeZstd CompressType = "zstd" CompressLevelFast CompressLevel = "fast" CompressLevelBetter CompressLevel = "better" CompressLevelBest CompressLevel = "best" )
Variables ¶
View Source
var ( ErrChecksumNotMatch = errors.New("checksum not match") CreateBase = newBase )
Functions ¶
func ApplyCommonCfgToRW ¶
func FileExtFromCompressCfg ¶
func FileExtFromCompressCfg(c *CompressCfg) string
func NewGzipReader ¶
func NewGzipReader(r io.ReadCloser, cfg *CompressCfg) io.ReadCloser
func NewGzipWritter ¶
func NewGzipWritter(w io.WriteCloser, cfg *CompressCfg) io.WriteCloser
func NewSnappyReader ¶
func NewSnappyReader(r io.ReadCloser, _ *CompressCfg) io.ReadCloser
func NewSnappyWriter ¶
func NewSnappyWriter(w io.WriteCloser, cfg *CompressCfg) io.WriteCloser
func NewZstdReader ¶
func NewZstdReader(r io.ReadCloser, cfg *CompressCfg) io.ReadCloser
func NewZstdWriter ¶
func NewZstdWriter(w io.WriteCloser, cfg *CompressCfg) io.WriteCloser
Types ¶
type Compress ¶
type Compress struct { RW *CompressCfg // contains filtered or unexported fields }
func NewCompress ¶
func NewCompress() *Compress
func (*Compress) NestReader ¶
func (c *Compress) NestReader(r io.ReadCloser)
func (*Compress) NestWriter ¶
func (c *Compress) NestWriter(w io.WriteCloser)
type CompressCfg ¶
type CompressCfg struct { Type CompressType `json:"type" validate:"required" yaml:"type"` Level CompressLevel `json:"level" validate:"required" yaml:"level"` Concurrency int `json:"concurrency" yaml:"concurrency"` }
func NewCompressCfg ¶
func NewCompressCfg() *CompressCfg
type CompressLevel ¶
type CompressLevel string
type CompressType ¶
type CompressType string
type CopyCfg ¶
type CopyCfg struct {
BufSize int `json:"bufSize" yaml:"bufSize"`
}
func NewCopyCfg ¶
func NewCopyCfg() *CopyCfg
type ExtraCfg ¶
type ExtraCfg struct { RateLimiterCfg *ratelimit.RateLimiterCfg `json:"rateLimiterCfg" yaml:"rateLimiterCfg"` BufSize int `json:"bufSize" yaml:"bufSize"` Deadline int `json:"deadline" yaml:"deadline"` AsyncChanBufSize int `json:"asyncChanBufSize" yaml:"asyncChanBufSize"` EnableMonitorSpeed bool `json:"enableMonitorSpeed" yaml:"enableMonitorSpeed"` EnableCalcHash bool `json:"enableCalcHash" yaml:"enableCalcHash"` EnableRateLimit bool `json:"enableRateLimit" yaml:"enableRateLimit"` EnableAsync bool `json:"enableAsync" yaml:"enableAsync"` Checksum string `json:"checksum" yaml:"checksum"` HashAlgo string `json:"hashAlgo" yaml:"hashAlgo"` }
type FileCfg ¶
func NewFileCfg ¶
func NewFileCfg() *FileCfg
type FtpCfg ¶
type FtpCfg struct { Addr string `json:"addr" validate:"required" yaml:"addr"` User string `json:"user" validate:"required" yaml:"user"` Pwd string `json:"pwd" validate:"required" yaml:"pwd"` Path string `json:"path" validate:"required" yaml:"path"` Timeout int `json:"timeout" yaml:"timeout"` Retry int `json:"retry" yaml:"retry"` }
type OSSCfg ¶
type OSSCfg struct { URL string `json:"url" validate:"required" yaml:"url"` Ak string `json:"ak" validate:"required" yaml:"ak"` Sk string `json:"sk" validate:"required" yaml:"sk"` Region string `json:"region" yaml:"region"` Append bool `json:"append" yaml:"append"` Timeout int `json:"timeout" yaml:"timeout"` Retry int `json:"retry" yaml:"retry"` }
type RW ¶
type RW interface { runner.Runner io.ReadWriteCloser plugin.Plugin NestReader(io.ReadCloser) NestWriter(io.WriteCloser) Reader() io.ReadCloser Writer() io.WriteCloser Flush() error HookRead(...ReadHook) HookWrite(...WriteHook) Nwrite() uint64 Nread() uint64 Hash() string EnableMonitorSpeed() EnableCalcHash(hashAlgo string) EnableChecksum(checksum string, hashAlgo string) EnableRateLimit(ratelimit.RxTxRateLimiter) EnableWriteBuf(bufSize int, deadline int, async bool, asyncChanBufSize int) EnableReadBuf(bufSize int, async bool, asyncChanBufSize int) IsAsyncOrDeadline() bool AsyncChanLen() int AsyncChanCap() int AsStarter() IsStarter() bool AsReader() IsReader() bool AsWriter() IsWriter() bool As(Role) Is(Role) bool Role() Role }
type SSHCfg ¶
type SSHCfg struct { Addr string `json:"addr" validate:"required" yaml:"addr"` User string `json:"user" validate:"required" yaml:"user"` Pwd string `json:"pwd" yaml:"pwd"` PrivateKey string `json:"privateKey" yaml:"privateKey"` Timeout int `json:"timeout" yaml:"timeout"` Path string `json:"path" validate:"required" yaml:"path"` }
type TailCfg ¶
func NewTailCfg ¶
func NewTailCfg() *TailCfg
Click to show internal directories.
Click to hide internal directories.