ingest

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

func NewEngine

func NewEngine(
	restartMarkFile RestartMarkFileReadRemover,
	wgPeers WgPeers,
	store Store,
	logger zerolog.Logger,
) Engine

func (*Engine) Run

func (e *Engine) Run(ctx context.Context, tick <-chan struct{}, restartMarkFileName string) error

type PeerUsage

type PeerUsage struct {
	Upload    uint
	Download  uint
	PublicKey string
}

type RestartMarkFileReadRemover

type RestartMarkFileReadRemover interface {
	Read(filename string) ([1]byte, error)
	Remove(filename string) error
}

type Store

type Store interface {
	LoadBeforeRestartUsage(ctx context.Context) (map[string]PeerUsage, error)
	IngestUsage(ctx context.Context, peersUsage []PeerUsage, gatheredAt time.Time) error
}

type WgPeers

type WgPeers interface {
	Usage(ctx context.Context) (peersUsage []PeerUsage, gatheredAt time.Time, err error)
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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