registrar

package
v0.0.0-...-8a44fb0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2022 License: MIT, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetStates

func ResetStates(states []file.State) []file.State

resetStates sets all states to finished and disable TTL on restart For all states covered by an input, TTL will be overwritten with the input value

Types

type Registrar

type Registrar struct {
	Channel chan []file.State
	// contains filtered or unexported fields
}

Registrar: 采集进度管理

func New

func New(config cfg.Registry) (*Registrar, error)

New creates a new Registrar instance, updating the registry file on `file.State` updates. New fails if the file can not be opened or created.

func (*Registrar) GetStates

func (r *Registrar) GetStates() []file.State

GetStates return the registrar states

func (*Registrar) Init

func (r *Registrar) Init() error

Init: 采集器启动时调用,同时对原采集器采集进度迁移

func (*Registrar) Start

func (r *Registrar) Start() error

Start start the registry.

func (*Registrar) Stop

func (r *Registrar) Stop()

Stop stops the registry. It waits until Run function finished.

Jump to

Keyboard shortcuts

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