client

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	Conf *Conf
	// contains filtered or unexported fields
}

Broker is the client struct

func (*Broker) GetState

func (broker *Broker) GetState() sts.SourceState

GetState returns the standard state struct providing a snapshot of the client

func (*Broker) Start

func (broker *Broker) Start(stop <-chan bool, done chan<- bool)

Start runs the client

type Conf

type Conf struct {
	Name string // The name assigned to this broker/client instance

	// Components
	Store        sts.FileSource          // The source of file objects from which to read (and delete)
	Cache        sts.FileCache           // The persistent cache of file metadata from the store
	Queue        sts.FileQueue           // The queue that takes files ready to send and chunks them up in its configured order
	Recoverer    sts.Recover             // The function that determines what chunks need to be sent first
	BuildPayload sts.PayloadFactory      // The function that creates a Payload instance
	Transmitter  sts.Transmit            // The transmission implementation
	TxRecoverer  sts.RecoverTransmission // The transmission recovery implementation
	Validator    sts.Validate            // The validation implementation
	Logger       sts.SendLogger          // The logger used to log completed files

	// Helpers
	Tagger  sts.Translate // Takes a file name and provides a tag name
	Renamer sts.Rename    // Takes a file and provides a new target file name

	// Options
	CacheAge     time.Duration    // How long to keep files in the cache after being sent
	ScanDelay    time.Duration    // How long to wait between scans of the store (0 means only once and we're done)
	Threads      int              // How many go routines for sending data
	PayloadSize  units.Base2Bytes // How large a single transmission payload should be (before any compression by the transmitter)
	StatPayload  bool             // Whether or not to record single-payload throughput stats
	StatInterval time.Duration    // How long to wait between logging transmission rate statistics
	PollDelay    time.Duration    // How long to wait before validating completed files after final transmission
	PollInterval time.Duration    // How long to wait between between validation requests
	PollAttempts int              // How many times to attempt validation for a single file before giving up
	Tags         []*FileTag       // Options for files of a particular pattern
	ErrorBackoff float64          // Multiplier for backoff time
}

Conf is the struct for storing all the settable components and options for this client to manage the outgoing data flow

type FileTag

type FileTag struct {
	Name        string // The name of the tag to be matched by the tagger
	InOrder     bool   // Whether or not the order files are received matters
	Delete      bool
	DeleteDelay time.Duration
}

FileTag is the struct for defining settings relevant to files of a "tag" that are relevant at the client level

Jump to

Keyboard shortcuts

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