Documentation
¶
Index ¶
- Constants
- Variables
- func CheckSendMsdZCEnable() bool
- func CheckSendZCEnable() bool
- func DefaultIOURingFlagsAndFeatures() (uint32, uint32)
- func IsTimeout(err error) bool
- func IsUncompleted(err error) bool
- func IsUnsupported(err error) bool
- func PerformIOURingFlagsAndFeatures() (uint32, uint32)
- func ReleaseSplicePipe(pipe *SplicePipe)
- type Curve
- type CurveTransmission
- type CurveTransmissionBuilder
- type Future
- type LeastLoadBalancer
- type LoadBalancer
- type Operation
- func (op *Operation) Addr() (addr *syscall.RawSockaddrAny, addrLen int)
- func (op *Operation) Control() []byte
- func (op *Operation) ControlLen() int
- func (op *Operation) Flags() int
- func (op *Operation) Name() string
- func (op *Operation) PrepareAccept(fd int, addr *syscall.RawSockaddrAny, addrLen int)
- func (op *Operation) PrepareCancel(target *Operation)
- func (op *Operation) PrepareClose(fd int)
- func (op *Operation) PrepareConnect(fd int, addr *syscall.RawSockaddrAny, addrLen int)
- func (op *Operation) PrepareNop() (err error)
- func (op *Operation) PrepareReceive(fd int, b []byte)
- func (op *Operation) PrepareReceiveMsg(fd int, b []byte, oob []byte, addr *syscall.RawSockaddrAny, addrLen int, ...)
- func (op *Operation) PrepareSend(fd int, b []byte)
- func (op *Operation) PrepareSendMsg(fd int, b []byte, oob []byte, addr *syscall.RawSockaddrAny, addrLen int, ...)
- func (op *Operation) PrepareSendMsgZC(fd int, b []byte, oob []byte, addr *syscall.RawSockaddrAny, addrLen int, ...)
- func (op *Operation) PrepareSendZC(fd int, b []byte)
- func (op *Operation) PrepareSplice(fdIn int, offIn int64, fdOut int, offOut int64, nbytes uint32, flags uint32)
- func (op *Operation) PrepareTee(fdIn int, fdOut int, nbytes uint32, flags uint32)
- func (op *Operation) Timeout(ctx context.Context) (timeout time.Duration)
- func (op *Operation) WithDeadline(deadline time.Time) *Operation
- type Option
- func WithCPUAffinity(use bool) Option
- func WithEntries(entries int) Option
- func WithFeatures(features uint32) Option
- func WithFlags(flags uint32) Option
- func WithLoadBalancer(lb LoadBalancer) Option
- func WithN(n int) Option
- func WithPrepareBatchSize(size uint32) Option
- func WithWaitTransmissionBuilder(builder TransmissionBuilder) Option
- type Options
- type Queue
- type RandomLoadBalancer
- type Result
- type RoundRobinLoadBalancer
- type SplicePipe
- type TimeoutError
- type Transmission
- type TransmissionBuilder
- type Vortex
- func (vortex *Vortex) Cancel(target *Operation) (ok bool)
- func (vortex *Vortex) Close() (err error)
- func (vortex *Vortex) PrepareAccept(fd int, addr *syscall.RawSockaddrAny, addrLen int, deadline time.Time) Future
- func (vortex *Vortex) PrepareClose(fd int) Future
- func (vortex *Vortex) PrepareConnect(fd int, addr *syscall.RawSockaddrAny, addrLen int, deadline time.Time) Future
- func (vortex *Vortex) PrepareOperation(op *Operation) Future
- func (vortex *Vortex) PrepareReceive(fd int, b []byte, deadline time.Time) Future
- func (vortex *Vortex) PrepareReceiveMsg(fd int, b []byte, oob []byte, addr *syscall.RawSockaddrAny, addrLen int, ...) Future
- func (vortex *Vortex) PrepareSend(fd int, b []byte, deadline time.Time) Future
- func (vortex *Vortex) PrepareSendMsg(fd int, b []byte, oob []byte, addr *syscall.RawSockaddrAny, addrLen int, ...) Future
- func (vortex *Vortex) PrepareSendMsgZC(fd int, b []byte, oob []byte, addr *syscall.RawSockaddrAny, addrLen int, ...) Future
- func (vortex *Vortex) PrepareSendZC(fd int, b []byte, deadline time.Time) Future
- func (vortex *Vortex) PrepareSplice(fdIn int, offIn int64, fdOut int, offOut int64, nbytes uint32, flags uint32) Future
- func (vortex *Vortex) PrepareTee(fdIn int, fdOut int, nbytes uint32, flags uint32) Future
- func (vortex *Vortex) Sendfile(ctx context.Context, dst int, r io.Reader, useZC bool) (written int64, err error)
- func (vortex *Vortex) SetId(id int)
- func (vortex *Vortex) Splice(ctx context.Context, dst int, src int, remain int64) (n int64, err error)
- func (vortex *Vortex) Start(ctx context.Context) (err error)
- type VortexOptions
- type Vortexes
Constants ¶
View Source
const ( ReadyOperationStatus int64 = iota ProcessingOperationStatus CompletedOperationStatus )
View Source
const (
MaxSpliceSize = 1 << 20
)
Variables ¶
View Source
var ( Uncompleted = errors.New("uncompleted") Timeout = &TimeoutError{} UnsupportedOp = errors.New("unsupported op") )
Functions ¶
func CheckSendMsdZCEnable ¶
func CheckSendMsdZCEnable() bool
func CheckSendZCEnable ¶
func CheckSendZCEnable() bool
func IsUncompleted ¶
func IsUnsupported ¶
func ReleaseSplicePipe ¶
func ReleaseSplicePipe(pipe *SplicePipe)
Types ¶
type CurveTransmission ¶
type CurveTransmission struct {
// contains filtered or unexported fields
}
type CurveTransmissionBuilder ¶
type CurveTransmissionBuilder struct {
// contains filtered or unexported fields
}
func (*CurveTransmissionBuilder) Build ¶
func (builder *CurveTransmissionBuilder) Build() Transmission
type LeastLoadBalancer ¶
type LeastLoadBalancer struct{}
func (*LeastLoadBalancer) Next ¶
func (lb *LeastLoadBalancer) Next(vs []*Vortex) (n int)
type LoadBalancer ¶
type Operation ¶
type Operation struct {
// contains filtered or unexported fields
}
func NewOperation ¶
func NewOperation() *Operation
func (*Operation) ControlLen ¶
func (*Operation) PrepareAccept ¶
func (op *Operation) PrepareAccept(fd int, addr *syscall.RawSockaddrAny, addrLen int)
func (*Operation) PrepareCancel ¶
func (*Operation) PrepareClose ¶ added in v0.2.0
func (*Operation) PrepareConnect ¶
func (op *Operation) PrepareConnect(fd int, addr *syscall.RawSockaddrAny, addrLen int)
func (*Operation) PrepareNop ¶
func (*Operation) PrepareReceive ¶
func (*Operation) PrepareReceiveMsg ¶
func (*Operation) PrepareSend ¶
func (*Operation) PrepareSendMsg ¶
func (*Operation) PrepareSendMsgZC ¶
func (*Operation) PrepareSendZC ¶
func (*Operation) PrepareSplice ¶
func (*Operation) PrepareTee ¶
type Option ¶
type Option func(*Options)
func WithCPUAffinity ¶ added in v0.7.0
func WithEntries ¶
func WithFeatures ¶
func WithLoadBalancer ¶ added in v0.9.0
func WithLoadBalancer(lb LoadBalancer) Option
func WithPrepareBatchSize ¶
func WithWaitTransmissionBuilder ¶
func WithWaitTransmissionBuilder(builder TransmissionBuilder) Option
type Options ¶
type Options struct { Entries uint32 Flags uint32 Features uint32 UseCPUAffinity bool PrepareBatchSize uint32 WaitTransmissionBuilder TransmissionBuilder Num int LoadBalancer LoadBalancer }
type RandomLoadBalancer ¶
type RandomLoadBalancer struct{}
func (*RandomLoadBalancer) Next ¶
func (lb *RandomLoadBalancer) Next(vs []*Vortex) (n int)
type RoundRobinLoadBalancer ¶
type RoundRobinLoadBalancer struct {
// contains filtered or unexported fields
}
func (*RoundRobinLoadBalancer) Next ¶
func (lb *RoundRobinLoadBalancer) Next(vs []*Vortex) (n int)
type SplicePipe ¶
type SplicePipe struct {
// contains filtered or unexported fields
}
func AcquireSplicePipe ¶
func AcquireSplicePipe() (*SplicePipe, error)
func NewSplicePipe ¶
func NewSplicePipe() *SplicePipe
func (*SplicePipe) Close ¶
func (pipe *SplicePipe) Close() (err error)
func (*SplicePipe) DrainN ¶
func (pipe *SplicePipe) DrainN(n int)
func (*SplicePipe) PumpN ¶
func (pipe *SplicePipe) PumpN(n int)
func (*SplicePipe) ReaderFd ¶
func (pipe *SplicePipe) ReaderFd() int
func (*SplicePipe) WriterFd ¶
func (pipe *SplicePipe) WriterFd() int
type TimeoutError ¶
type TimeoutError struct{}
func (*TimeoutError) Error ¶
func (e *TimeoutError) Error() string
func (*TimeoutError) Is ¶
func (e *TimeoutError) Is(err error) bool
func (*TimeoutError) Temporary ¶
func (e *TimeoutError) Temporary() bool
func (*TimeoutError) Timeout ¶
func (e *TimeoutError) Timeout() bool
type Transmission ¶
func NewCurveTransmission ¶
func NewCurveTransmission(curve Curve) Transmission
type TransmissionBuilder ¶
type TransmissionBuilder interface {
Build() Transmission
}
func NewCurveTransmissionBuilder ¶
func NewCurveTransmissionBuilder(curve Curve) TransmissionBuilder
type Vortex ¶
type Vortex struct {
// contains filtered or unexported fields
}
func NewVortex ¶
func NewVortex(options VortexOptions) (v *Vortex)
func (*Vortex) PrepareAccept ¶
func (*Vortex) PrepareClose ¶ added in v0.2.0
func (*Vortex) PrepareConnect ¶
func (*Vortex) PrepareOperation ¶
func (*Vortex) PrepareReceive ¶
func (*Vortex) PrepareReceiveMsg ¶
func (*Vortex) PrepareSend ¶
func (*Vortex) PrepareSendMsg ¶
func (*Vortex) PrepareSendMsgZC ¶
func (*Vortex) PrepareSendZC ¶
func (*Vortex) PrepareSplice ¶
func (*Vortex) PrepareTee ¶
type VortexOptions ¶
Click to show internal directories.
Click to hide internal directories.