Documentation ¶
Index ¶
- Constants
- func DateFileRotationIICaseI(filename string, backups uint)
- func DateFileRotationIICaseII(filename string, backups uint)
- func FileRotation(filename string, backups uint)
- func FileRotationIII(filename string, backups uint)
- func FileRotationIV(filename string, backups uint)
- func FileRotationV(filename string, backups uint)
- func FileRotationVI(filename string, backups uint)
- func WriteError(e error)
- type Comparator
- type DateComparator
- type DateComparatorII
- type IntHeap
- type PriorityQueue
- type PriorityQueueComparator
Constants ¶
View Source
const ChannelSize = 160
View Source
const CompressExt = ".gz"
View Source
const SpecialChar = ';'
Variables ¶
This section is empty.
Functions ¶
func DateFileRotationIICaseI ¶
func FileRotation ¶
func FileRotationIII ¶
func FileRotationIV ¶
func FileRotationV ¶
FileRotationV fifth algorithm
func FileRotationVI ¶
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 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 ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.