transport

package
v0.0.0-...-a16fe4d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

File upload by Elkeid

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBufferOverflow = errors.New("buffer overflow")
	ErrAgentDataType  = errors.New("agent datatype is not support")
)
View Source
var (
	PluginTaskChan   = make(chan *proto.Task)
	PluginConfigChan = make(chan map[string]*proto.Config)
)

The channel to dispatch to plugin

View Source
var Trans = NewTransfer()

Functions

func Startup

func Startup(ctx context.Context, wg *sync.WaitGroup)

retries here, and some bugs

func TaskError

func TaskError(token string, msg string)

func TaskSuccess

func TaskSuccess(token string, msg string)

func UploadFile

func UploadFile(req UploadRequest) (err error)

Types

type Transfer

type Transfer struct {
	// contains filtered or unexported fields
}

func NewTransfer

func NewTransfer() *Transfer

func (*Transfer) GetState

func (t *Transfer) GetState(now time.Time) (txTPS, rxTPS float64)

func (*Transfer) Receive

func (t *Transfer) Receive(client proto.Transfer_TransferClient) (err error)

func (*Transfer) Send

func (t *Transfer) Send(client proto.Transfer_TransferClient) (err error)

Send the record from buffer

func (*Transfer) Transmission

func (t *Transfer) Transmission(rec *proto.Record, important bool) (err error)

Save the record to the buffer, control the buffer

func (*Transfer) TransmissionSDK

func (t *Transfer) TransmissionSDK(rec protocol.ProtoType, important bool) (err error)

TransmissionSDK is an wrapper to satisfy the SDK interface

type UploadRequest

type UploadRequest struct {
	Path    string `json:"path"`
	BufSize int64  `json:"buf_size"`
	// contains filtered or unexported fields
}

Directories

Path Synopsis
Package compressor is a wrapper for using github.com/golang/snappy with gRPC.
Package compressor is a wrapper for using github.com/golang/snappy with gRPC.
Connection
Connection

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL