job

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2019 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithLogger

func WithLogger(ctx context.Context, l Logger) context.Context

Types

type ActiveSide

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

func (*ActiveSide) Name

func (j *ActiveSide) Name() string

func (*ActiveSide) OwnedDatasetSubtreeRoot

func (j *ActiveSide) OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool)

func (*ActiveSide) RegisterMetrics

func (j *ActiveSide) RegisterMetrics(registerer prometheus.Registerer)

func (*ActiveSide) Run

func (j *ActiveSide) Run(ctx context.Context)

func (*ActiveSide) Status

func (j *ActiveSide) Status() *Status

type ActiveSideState

type ActiveSideState int
const (
	ActiveSideReplicating ActiveSideState = 1 << iota
	ActiveSidePruneSender
	ActiveSidePruneReceiver
	ActiveSideDone // also errors
)

func ActiveSideStateString

func ActiveSideStateString(s string) (ActiveSideState, error)

ActiveSideStateString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ActiveSideStateValues

func ActiveSideStateValues() []ActiveSideState

ActiveSideStateValues returns all values of the enum

func (ActiveSideState) IsAActiveSideState

func (i ActiveSideState) IsAActiveSideState() bool

IsAActiveSideState returns "true" if the value is listed in the enum definition. "false" otherwise

func (ActiveSideState) String

func (i ActiveSideState) String() string

type ActiveSideStatus

type ActiveSideStatus struct {
	Replication                    *report.Report
	PruningSender, PruningReceiver *pruner.Report
}

type Job

type Job interface {
	Name() string
	Run(ctx context.Context)
	Status() *Status
	RegisterMetrics(registerer prometheus.Registerer)
	// Jobs that return a subtree of the dataset hierarchy
	// must return the root of that subtree as rfs and ok = true
	OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool)
}

func JobsFromConfig

func JobsFromConfig(c *config.Config) ([]Job, error)

type Logger

type Logger = logger.Logger

func GetLogger

func GetLogger(ctx context.Context) Logger

type PassiveSide

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

func (*PassiveSide) Name

func (j *PassiveSide) Name() string

func (*PassiveSide) OwnedDatasetSubtreeRoot

func (j *PassiveSide) OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool)

func (*PassiveSide) RegisterMetrics

func (*PassiveSide) RegisterMetrics(registerer prometheus.Registerer)

func (*PassiveSide) Run

func (j *PassiveSide) Run(ctx context.Context)

func (*PassiveSide) Status

func (s *PassiveSide) Status() *Status

type PassiveStatus

type PassiveStatus struct{}

type SnapJob

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

func (*SnapJob) Name

func (j *SnapJob) Name() string

func (*SnapJob) OwnedDatasetSubtreeRoot

func (j *SnapJob) OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool)

func (*SnapJob) RegisterMetrics

func (j *SnapJob) RegisterMetrics(registerer prometheus.Registerer)

func (*SnapJob) Run

func (j *SnapJob) Run(ctx context.Context)

func (*SnapJob) Status

func (j *SnapJob) Status() *Status

func (*SnapJob) Type

func (j *SnapJob) Type() Type

type SnapJobStatus

type SnapJobStatus struct {
	Pruning *pruner.Report
}

type Status

type Status struct {
	Type        Type
	JobSpecific interface{}
}

func (*Status) MarshalJSON

func (s *Status) MarshalJSON() ([]byte, error)

func (*Status) UnmarshalJSON

func (s *Status) UnmarshalJSON(in []byte) (err error)

type Type

type Type string
const (
	TypeInternal Type = "internal"
	TypeSnap     Type = "snap"
	TypePush     Type = "push"
	TypeSink     Type = "sink"
	TypePull     Type = "pull"
	TypeSource   Type = "source"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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