Documentation
¶
Index ¶
- func GetChecksumString(checksum []byte) string
- func GetSHA1Sum(str string) (string, error)
- func ParseTime(s string) (time.Time, error)
- func StackTraceFromPanic(logger *log.Entry)
- func TimeString(t time.Time) string
- type FileBlockHelper
- func (helper *FileBlockHelper) GetAllBlockIDs(offset int64, length int) []int64
- func (helper *FileBlockHelper) GetBlockID(offset int64) int64
- func (helper *FileBlockHelper) GetBlockIDs(offset int64, length int) (int64, int64)
- func (helper *FileBlockHelper) GetBlockOffset(offset int64) int64
- func (helper *FileBlockHelper) GetBlockRange(offset int64, length int, blockID int64) (int64, int)
- func (helper *FileBlockHelper) GetBlockSize() int
- func (helper *FileBlockHelper) GetBlockStart(blockID int64) int64
- func (helper *FileBlockHelper) GetLastBlockID(size int64) int64
- func (helper *FileBlockHelper) IsAligned(offset int64) bool
- type StacktraceTextFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetChecksumString ¶
GetChecksumString returns string from checksum bytes
func GetSHA1Sum ¶
GetSHA1Sum returns sha1 check sum string
func StackTraceFromPanic ¶
func TimeString ¶
TimeString formats time.Time as RFC3339 string
Types ¶
type FileBlockHelper ¶
type FileBlockHelper struct {
// contains filtered or unexported fields
}
FileBlockHelper helps block/offset related calculation
func NewFileBlockHelper ¶
func NewFileBlockHelper(blockSize int) *FileBlockHelper
func (*FileBlockHelper) GetAllBlockIDs ¶
func (helper *FileBlockHelper) GetAllBlockIDs(offset int64, length int) []int64
GetAllBlockIDs returns all block ids for the given range
func (*FileBlockHelper) GetBlockID ¶
func (helper *FileBlockHelper) GetBlockID(offset int64) int64
GetBlockID returns block index for a given offset
func (*FileBlockHelper) GetBlockIDs ¶
func (helper *FileBlockHelper) GetBlockIDs(offset int64, length int) (int64, int64)
GetBlockIDs returns first and last block id for the given range
func (*FileBlockHelper) GetBlockOffset ¶
func (helper *FileBlockHelper) GetBlockOffset(offset int64) int64
GetBlockOffset returns offset within a block for a given absolute offset
func (*FileBlockHelper) GetBlockRange ¶
GetBlockRange returns offset and length for given block, within given offset and length
func (*FileBlockHelper) GetBlockSize ¶
func (helper *FileBlockHelper) GetBlockSize() int
GetBlockSize returns block size
func (*FileBlockHelper) GetBlockStart ¶
func (helper *FileBlockHelper) GetBlockStart(blockID int64) int64
GetBlockStart returns block start offset for a given block ID
func (*FileBlockHelper) GetLastBlockID ¶
func (helper *FileBlockHelper) GetLastBlockID(size int64) int64
GetLastBlockID returns the last block of the file
func (*FileBlockHelper) IsAligned ¶
func (helper *FileBlockHelper) IsAligned(offset int64) bool
IsAligned checks if offset is aligned to block start
type StacktraceTextFormatter ¶
type StacktraceTextFormatter struct {
TextFormatter log.TextFormatter
}