- make stream fast path honor adaptive soft payload limits end-to-end - split oversized fast-stream payloads into sequential frames before batching - use adaptive soft cap when encoding stream batch payloads - move timeout-like error detection into production code for adaptive tx - tune notify FrameReader read size explicitly to avoid throughput regression - drop local stario replace and depend on released b612.me/stario v0.1.1
93 lines
3.8 KiB
Go
93 lines
3.8 KiB
Go
package notify
|
|
|
|
import (
|
|
"context"
|
|
"net"
|
|
"time"
|
|
)
|
|
|
|
type Client interface {
|
|
SetDefaultLink(func(message *Message))
|
|
SetLink(string, func(*Message))
|
|
SetFileHandler(func(FileEvent))
|
|
SetStreamHandler(func(StreamAcceptInfo) error)
|
|
SetRecordStreamHandler(func(RecordAcceptInfo) error)
|
|
SetBulkHandler(func(BulkAcceptInfo) error)
|
|
SetTransferHandler(func(TransferAcceptInfo) (TransferReceiveOptions, error))
|
|
GetStreamConfig() StreamConfig
|
|
SetStreamConfig(StreamConfig)
|
|
SetTransferResumeStore(TransferResumeStore)
|
|
RecoverTransferSnapshots(context.Context) error
|
|
SetBulkNetworkProfile(BulkNetworkProfile)
|
|
BulkNetworkProfile() BulkNetworkProfile
|
|
SetBulkDefaultOpenMode(BulkOpenMode)
|
|
BulkDefaultOpenMode() BulkOpenMode
|
|
SetBulkOpenTuning(BulkOpenTuning)
|
|
BulkOpenTuning() BulkOpenTuning
|
|
SetBulkDedicatedAttachConfig(BulkDedicatedAttachConfig)
|
|
BulkDedicatedAttachConfig() BulkDedicatedAttachConfig
|
|
SetFileReceiveDir(dir string) error
|
|
send(msg TransferMsg) (WaitMsg, error)
|
|
sendEnvelope(env Envelope) error
|
|
sendWait(msg TransferMsg, timeout time.Duration) (Message, error)
|
|
Send(key string, value MsgVal) error
|
|
SendWait(key string, value MsgVal, timeout time.Duration) (Message, error)
|
|
SendWaitObj(key string, value interface{}, timeout time.Duration) (Message, error)
|
|
SendCtx(ctx context.Context, key string, value MsgVal) (Message, error)
|
|
Reply(m Message, value MsgVal) error
|
|
// Deprecated: ExchangeKey drives the legacy RSA-based key exchange flow.
|
|
// Prefer UseModernPSKClient.
|
|
ExchangeKey(newKey []byte) error
|
|
Connect(network string, addr string) error
|
|
ConnectTimeout(network string, addr string, timeout time.Duration) error
|
|
ConnectByConn(conn net.Conn) error
|
|
ConnectByFactory(ctx context.Context, dialFn func(context.Context) (net.Conn, error)) error
|
|
// Deprecated: SkipExchangeKey only controls the legacy RSA-based key exchange.
|
|
SkipExchangeKey() bool
|
|
// Deprecated: SetSkipExchangeKey only controls the legacy RSA-based key exchange.
|
|
SetSkipExchangeKey(bool)
|
|
|
|
GetMsgEn() func([]byte, []byte) []byte
|
|
// Deprecated: SetMsgEn overrides the transport codec directly.
|
|
// Prefer UseModernPSKClient or UseLegacySecurityClient.
|
|
SetMsgEn(func([]byte, []byte) []byte)
|
|
GetMsgDe() func([]byte, []byte) []byte
|
|
// Deprecated: SetMsgDe overrides the transport codec directly.
|
|
// Prefer UseModernPSKClient or UseLegacySecurityClient.
|
|
SetMsgDe(func([]byte, []byte) []byte)
|
|
|
|
Heartbeat()
|
|
HeartbeatPeroid() time.Duration
|
|
SetHeartbeatPeroid(duration time.Duration)
|
|
|
|
GetSecretKey() []byte
|
|
// Deprecated: SetSecretKey injects a raw transport key directly.
|
|
// Prefer UseModernPSKClient or UseLegacySecurityClient.
|
|
SetSecretKey(key []byte)
|
|
// Deprecated: RsaPubKey exposes the legacy RSA handshake key. Prefer UseModernPSKClient.
|
|
RsaPubKey() []byte
|
|
// Deprecated: SetRsaPubKey configures the legacy RSA handshake key. Prefer UseModernPSKClient.
|
|
SetRsaPubKey([]byte)
|
|
|
|
Stop() error
|
|
StopMonitorChan() <-chan struct{}
|
|
Status() Status
|
|
ShowError(bool)
|
|
DebugMode(bool)
|
|
IsDebugMode() bool
|
|
|
|
GetSequenceEn() func(interface{}) ([]byte, error)
|
|
SetSequenceEn(func(interface{}) ([]byte, error))
|
|
GetSequenceDe() func([]byte) (interface{}, error)
|
|
SetSequenceDe(func([]byte) (interface{}, error))
|
|
SendObjCtx(ctx context.Context, key string, val interface{}) (Message, error)
|
|
SendObj(key string, val interface{}) error
|
|
OpenStream(ctx context.Context, opt StreamOpenOptions) (Stream, error)
|
|
OpenRecordStream(ctx context.Context, opt RecordOpenOptions) (RecordStream, error)
|
|
OpenBulk(ctx context.Context, opt BulkOpenOptions) (Bulk, error)
|
|
OpenSharedBulk(ctx context.Context, opt BulkOpenOptions) (Bulk, error)
|
|
OpenDedicatedBulk(ctx context.Context, opt BulkOpenOptions) (Bulk, error)
|
|
SendTransfer(ctx context.Context, opt TransferSendOptions) (TransferHandle, error)
|
|
SendFile(ctx context.Context, filePath string) error
|
|
}
|