utils

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinPath

func JoinPath(dirPath string, filePath string) string

JoinPath makes the path from dir and file paths

func MakeHash

func MakeHash(s string) string

func MakeTimeToString

func MakeTimeToString(t time.Time) string

func ParseTime

func ParseTime(t string) (time.Time, error)

Types

type FileBlockHelper

type FileBlockHelper struct {
	BlockSize int
}

FileBlockHelper ...

func NewFileBlockHelper

func NewFileBlockHelper(blockSize int) *FileBlockHelper

func (*FileBlockHelper) GetBlockIDForOffset

func (helper *FileBlockHelper) GetBlockIDForOffset(offset int64) int64

GetBlockIDForOffset returns block index

func (*FileBlockHelper) GetBlockStartOffsetForBlockID

func (helper *FileBlockHelper) GetBlockStartOffsetForBlockID(blockID int64) int64

GetBlockStartOffsetForBlockID returns block start offset

func (*FileBlockHelper) GetFirstAndLastBlockIDForRW

func (helper *FileBlockHelper) GetFirstAndLastBlockIDForRW(offset int64, length int) (int64, int64)

GetFirstAndLastBlockIDForRW returns first and last block id for read or write

func (*FileBlockHelper) GetInBlockOffsetAndLength

func (helper *FileBlockHelper) GetInBlockOffsetAndLength(offset int64, length int) (int, int)

GetInBlockOffsetAndLength returns in-block offset and in-block length

Jump to

Keyboard shortcuts

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