status

package
v3.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Null        = Status{"", -1}
	Indexed     = Status{"indexed", 0}
	Retrying    = Status{"retrying", 0}
	Queued      = Status{"queued", 1}
	Downloading = Status{"downloading", 2}
	Uploading   = Status{"uploading", 2}
	Skipped     = Status{"skipped", 3}
	Ignored     = Status{"ignored", 3}
	Complete    = Status{"complete", 4}
	Canceled    = Status{"canceled", 5}
	Errored     = Status{"errored", 5}

	Included = []GetStatus{Indexed, Queued, Retrying, Downloading, Uploading, Complete, Canceled, Errored}
	Excluded = []GetStatus{Skipped, Ignored}
	Valid    = []GetStatus{Indexed, Queued, Retrying, Downloading, Uploading, Complete}
	Invalid  = []GetStatus{Null, Canceled, Errored, Skipped, Ignored}
	Running  = []GetStatus{Downloading, Uploading}
	Ended    = []GetStatus{Complete, Canceled, Errored, Skipped, Ignored}
)

Functions

This section is empty.

Types

type Change

type Change struct {
	Status
	time.Time
	Err error
}

type Changes

type Changes []Change

func (Changes) Count

func (c Changes) Count(s Status) (count int)

type GetStatus

type GetStatus interface {
	Status() Status
}

type Log

type Log struct {
	Path   string
	Action string
}

type Status

type Status struct {
	Name  string
	Value int
}

func SetStatus

func SetStatus(old GetStatus, new GetStatus, err error) (Status, bool)

func (Status) Any

func (e Status) Any(statuses ...GetStatus) bool

func (Status) Has

func (e Status) Has(statuses ...GetStatus) bool

func (Status) Is

func (e Status) Is(statuses ...GetStatus) bool

func (Status) IsNot

func (e Status) IsNot(statuses ...GetStatus) bool

func (Status) Status

func (e Status) Status() Status

func (Status) String

func (e Status) String() string

Jump to

Keyboard shortcuts

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