dnav

package
v0.0.0-...-4d41b22 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MainRootVar     = "MAINROOT"
	MainDumpVar     = "DUMPROOT"
	DefaultRoot     = "/newage/NEWAGE"
	DefaultRootName = "NEWAGE"
	DefaultDump     = "/dump"
)

Variables

View Source
var Debug bool

Functions

func Dprintf

func Dprintf(format string, a ...interface{}) (n int, err error)

func FindDumpPath

func FindDumpPath(d DumpDate, roots Roots) string

FindDumpPath looks for a path as close as possible to the date, but which may be equal or smaller

func IsDump

func IsDump(path string, roots Roots) bool

IsDump finds if a path belongs to the dump

func RdRoots

func RdRoots(roots *Roots)

RdRoots finds the first path which exists for each of the environment variables. If none exist, it sets the default values.

Types

type DumpDate

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

A DumpDate represents a path in the Dump in an abstract way, by a description of the time. It is an opaque type without exported fields

func NewDumpDate

func NewDumpDate(years int, months int, days int, hours int) *DumpDate

NewDumpDate creates a new DumpDate from the description.

func ParseDumpPath

func ParseDumpPath(path string, roots Roots) (d DumpDate, err error)

ParseDumpPath interprets a dump path as a date (years, months, days, hours). The smallest values may be missing and interpeted as zero.

func SumDates

func SumDates(d1 DumpDate, d2 DumpDate) (ds DumpDate)

only for offset...

func TInDumpDate

func TInDumpDate(t time.Time) DumpDate

Convert a time into a DumpDate

func TimeAddDate

func TimeAddDate(t time.Time, deltaT DumpDate) DumpDate

Add DumpDate to a time to obtain a DumpDate

func (*DumpDate) IsAfter

func (d *DumpDate) IsAfter(d2 DumpDate) bool

func (*DumpDate) IsBefore

func (d *DumpDate) IsBefore(d2 DumpDate) bool

func (*DumpDate) IsBeforeSparse

func (d *DumpDate) IsBeforeSparse(d2 DumpDate) bool

ignoring zeros

func (*DumpDate) SameDay

func (d *DumpDate) SameDay(d2 *DumpDate) bool

func (*DumpDate) SameHour

func (d *DumpDate) SameHour(d2 *DumpDate) bool

func (*DumpDate) SameMonth

func (d *DumpDate) SameMonth(d2 *DumpDate) bool

func (*DumpDate) SameYear

func (d *DumpDate) SameYear(d2 *DumpDate) bool

func (*DumpDate) String

func (d *DumpDate) String() string

type Roots

type Roots struct {
	MainRoot string
	DumpRoot string
	RootName string
}

Jump to

Keyboard shortcuts

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