journal

package
v7.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntryLevelError   = EntryLevel("error")
	EntryLevelWarning = EntryLevel("warning")
	EntryLevelSkip    = EntryLevel("skip")
	EntryLevelSuccess = EntryLevel("success")
)
View Source
const (
	EntryStatusOutdated    = EntryStatus("Outdated file")
	EntryStatusNotIncluded = EntryStatus("Not included")
	EntryStatusExcluded    = EntryStatus("Excluded")
	EntryStatusNeverDl     = EntryStatus("Never downloaded")
	EntryStatusAlreadyDl   = EntryStatus("Already downloaded")
	EntryStatusSizeDiff    = EntryStatus("Exists but size is different")
	EntryStatusHashExists  = EntryStatus("Hash sum exists")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Journal
}

Client represents an active journal object

func New

func New() *Client

New creates new journal instance

func (*Client) Add added in v7.1.0

func (c *Client) Add(entry Entry)

Add adds an entry in the journal

func (*Client) IsEmpty

func (c *Client) IsEmpty() bool

IsEmpty checks if journal is empty

type Entry added in v7.1.0

type Entry struct {
	File   string      `json:"file,omitempty"`
	Status EntryStatus `json:"status,omitempty"`
	Level  EntryLevel  `json:"level,omitempty"`
	Text   string      `json:"text,omitempty"`
}

Entry represents a journal entry

type EntryLevel added in v7.1.0

type EntryLevel string

EntryLevel represents an entry kevek

type EntryStatus added in v7.1.0

type EntryStatus string

EntryStatus represents entry status

func (*EntryStatus) IsSkipped added in v7.1.0

func (es *EntryStatus) IsSkipped() bool

type Journal added in v7.1.0

type Journal struct {
	ServerHost string  `json:"-"`
	Entries    []Entry `json:"entries,omitempty"`
	Count      struct {
		Success int `json:"success,omitempty"`
		Error   int `json:"error,omitempty"`
		Skip    int `json:"skip,omitempty"`
	} `json:"count,omitempty"`
	Status   string        `json:"status,omitempty"`
	Duration time.Duration `json:"duration,omitempty"`
}

Journal holds journal entries

func (Journal) IsEmpty added in v7.1.0

func (j Journal) IsEmpty() bool

IsEmpty checks if journal is empty

func (Journal) MarshalJSON added in v7.1.0

func (j Journal) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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