ressync

package
v0.0.0-...-ffd2651 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KWMaxDelay = keywords.Keyword{
		Aliases:       []string{"sync_max_delay"},
		Attr:          "MaxDelay",
		Converter:     converters.Duration,
		DefaultOption: "sync_max_delay",
		Option:        "max_delay",
		Text:          keywords.NewText(fs, "text/kw/max_delay"),
	}
	KWSchedule = keywords.Keyword{
		Attr:          "Schedule",
		DefaultOption: "sync_schedule",
		Example:       "00:00-01:00 mon",
		Option:        "schedule",
		Scopable:      true,
		Text:          keywords.NewText(fs, "text/kw/schedule"),
	}

	BaseKeywords = append(
		[]keywords.Keyword{},
		KWMaxDelay,
		KWSchedule,
	)
)

Functions

This section is empty.

Types

type Stats

type Stats struct {
	Endpoint      string
	SentBytes     uint64
	ReceivedBytes uint64
	Begin         time.Time
	End           time.Time
}

func NewStats

func NewStats(endpoint string) *Stats

func (*Stats) Close

func (t *Stats) Close()

func (*Stats) Duration

func (t *Stats) Duration() (duration time.Duration)

func (*Stats) SpeedBPS

func (t *Stats) SpeedBPS() (speed float64)

type T

type T struct {
	resource.T
	MaxDelay *time.Duration `json:"max_delay"`
	Schedule string         `json:"schedule"`
	Path     naming.Path    `json:"path"`
}

func (*T) CopyWithStats

func (t *T) CopyWithStats(ctx context.Context, dst io.Writer, src io.Reader, stats *Stats) (uint64, error)

func (*T) GetMaxDelay

func (t *T) GetMaxDelay(lastSync time.Time) *time.Duration

GetMaxDelay return the configured max_delay if set. If not set, return the duration from now to the end of the next schedule period.

func (*T) GetTargetNodenames

func (t *T) GetTargetNodenames(target, nodes, drpNodes []string) []string

func (*T) GetTargetPeernames

func (t *T) GetTargetPeernames(target, nodes, drpNodes []string) []string

func (*T) IsInstanceSufficientlyStarted

func (t *T) IsInstanceSufficientlyStarted(ctx context.Context) (v bool, rids []string)

func (*T) StatusLastSync

func (t *T) StatusLastSync(nodenames []string) status.T

func (T) WriteLastSync

func (t T) WriteLastSync(nodename string) error

func (T) WritePeerLastSync

func (t T) WritePeerLastSync(peer string, peers []string) error

Jump to

Keyboard shortcuts

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