tests

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ChannelSize = 160
View Source
const CompressExt = ".gz"
View Source
const SpecialChar = ';'

Variables

This section is empty.

Functions

func DateFileRotationIICaseI

func DateFileRotationIICaseI(filename string, backups uint)

func DateFileRotationIICaseII

func DateFileRotationIICaseII(filename string, backups uint)

func FileRotation

func FileRotation(filename string, backups uint)

func FileRotationIII

func FileRotationIII(filename string, backups uint)

func FileRotationIV

func FileRotationIV(filename string, backups uint)

func FileRotationV

func FileRotationV(filename string, backups uint)

FileRotationV fifth algorithm

func FileRotationVI

func FileRotationVI(filename string, backups uint)

FileRotationVI sixth algorithm

func WriteError

func WriteError(e error)

Types

type Comparator

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

func NewComparator

func NewComparator(fullPath string, sep string, keepFileExt, isCompress bool) *Comparator

func (*Comparator) Match

func (c *Comparator) Match(s string) int

Match This method return -1 if no matching; 0 if it is the hot file greater than 0 if there is a matching

func (*Comparator) Replace

func (c *Comparator) Replace(i int) string

type DateComparator

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

DateComparator struct

func NewDateComparator

func NewDateComparator(fullPath string, sep string, keepFileExt, isCompress bool, datePattern string) DateComparator

func (*DateComparator) Match

func (d *DateComparator) Match(s string) int

Match return the difference between now and the date saved -1

func (*DateComparator) Replace

func (d *DateComparator) Replace(i int) string

type DateComparatorII

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

func NewDateComparatorII

func NewDateComparatorII(fullPath string, sep string, keepFileExt, isCompress bool, datePattern string) DateComparatorII

func (*DateComparatorII) Match

func (d *DateComparatorII) Match(s string) (int64, int)

Match return the difference between now and the date saved -1

func (*DateComparatorII) Replace

func (d *DateComparatorII) Replace(i int) string

func (*DateComparatorII) ReplaceWithDifferentDate

func (d *DateComparatorII) ReplaceWithDifferentDate(i int, date time.Time) string

type IntHeap

type IntHeap []int

An IntHeap is a max-heap of ints.

func (*IntHeap) Len

func (h *IntHeap) Len() int

func (*IntHeap) Less

func (h *IntHeap) Less(i, j int) bool

func (*IntHeap) Pop

func (h *IntHeap) Pop() any

func (*IntHeap) Push

func (h *IntHeap) Push(x any)

func (*IntHeap) Swap

func (h *IntHeap) Swap(i, j int)

type PriorityQueue

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

func NewPriorityQueue

func NewPriorityQueue(capacity uint, compare PriorityQueueComparator) *PriorityQueue

func (*PriorityQueue) Peek

func (pq *PriorityQueue) Peek() int

Peek get the first element, but not pop it

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() int

Pop get the first element of the queue and then drop it

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(e int)

Push add an element to a priority queue

type PriorityQueueComparator

type PriorityQueueComparator func(a int, b int) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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