journal

package
v0.0.0-...-abd8bd4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Finalize

func Finalize() error

saves and closes the DTS transfer journal (if it's been opened)

func Init

func Init() error

initialize the DTS transfer journal

func IsOpen

func IsOpen() bool

returns true if the journal is open for writing, false if not

func RecordTransfer

func RecordTransfer(record Record) error

records a completed transfer record: the record containing all transfer information

Types

type CantCloseError

type CantCloseError struct {
	Message string
}

indicates that the journal cannot be closed

func (CantCloseError) Error

func (e CantCloseError) Error() string

type CantOpenError

type CantOpenError struct {
	Message string
}

indicates that the journal cannot be opened

func (CantOpenError) Error

func (e CantOpenError) Error() string

type InvalidRecordError

type InvalidRecordError struct {
	Id      uuid.UUID
	Message string
}

indicates that the transfer record with the given ID has invalid data

func (InvalidRecordError) Error

func (e InvalidRecordError) Error() string

type NewRecordError

type NewRecordError struct {
	Id      uuid.UUID
	Message string
}

indicates that a transfer could not be recorded

func (NewRecordError) Error

func (e NewRecordError) Error() string

type NotOpenError

type NotOpenError struct {
}

indicates that the journal is not open and cannot respond to the given request

func (NotOpenError) Error

func (e NotOpenError) Error() string

type Record

type Record struct {
	// UUID associated with the transfer
	Id uuid.UUID `json:"id"`
	// the source and destination associated with the transfer
	Source      string `json:"source"`
	Destination string `json:"destination"`
	// the ORCID associated with the transfer
	Orcid string `json:"orcid"`
	// times at which the transfer was requested and at which it completed
	StartTime time.Time `json:"start_time"`
	StopTime  time.Time `json:"stop_time"`
	// status of the transfer ("succeeded", "failed", or "canceled")
	Status string `json:"status"`
	// size of the transfer's payload in bytes
	PayloadSize uint64 `json:"payload_size"`
	// number of files in the transfer's payload
	NumFiles int `json:"num_files"`
	// manifest containing metadata for the transfer's payload (stored separate from record)
	Manifest *datapackage.Package `json:"-"`
}

a record storing all information relevant to a transfer

func Records

func Records(start, stop time.Time) ([]Record, error)

retrieves records for transfers that started and finished within the time range with the given (inclusive) bounds start: the beginning of the time period of interest stop: the end of the time period of interest

type RecordNotFoundError

type RecordNotFoundError struct {
	Id uuid.UUID
}

indicates that the transfer with the given ID has no record in the journal

func (RecordNotFoundError) Error

func (e RecordNotFoundError) Error() string

type TimeRange

type TimeRange struct {
	Start, Stop time.Time
}

Jump to

Keyboard shortcuts

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