Documentation ¶
Index ¶
- Constants
- func CreateDirIfNotExist(dir string) (err error)
- func GetEnv(env string) string
- func GetIdentifyIDByFile(f *os.File) (uint64, error)
- func GetIdentifyIDByPath(path string) (uint64, error)
- func GetRealPath(path string) (newPath string, fi os.FileInfo, err error)
- func MongoDail(host string, mode string, syncTimeoutInS int64) (session *mgo.Session, err error)
- func ReadDirByTime(dir string) (files []os.FileInfo, err error)
- func SetMode(s *mgo.Session, modeFriendly string, refresh bool)
- func SortFilesByTime(files []os.FileInfo) (soredfiles []os.FileInfo)
- func TrimeList(strs []string) (ret []string)
- func TuoDecode(value []byte) (values [][]byte, err error)
- func TuoEncode(values []sql.RawBytes) (ret []byte)
- func WaitForInterrupt(interrupt func())
- type Collection
- type ErrorResponse
- type File
- type Int64Slice
- type KeyValue
- type MongoConfig
- type Option
- type StatsError
- type StatsInfo
Constants ¶
View Source
const (
GlobalKeyName = "name"
)
Variables ¶
This section is empty.
Functions ¶
func CreateDirIfNotExist ¶
CreateDirIfNotExist 检查文件夹,不存在时创建
func GetIdentifyIDByPath ¶
func GetRealPath ¶
GetRealPath 处理软链接等,找到文件真实路径
func ReadDirByTime ¶
ReadDirByTime 读取文件目录后按时间排序,时间最新的文件在前
func SortFilesByTime ¶
SortFilesByTime 按照文件更新的unixnano从大到小排,即最新的文件在前
func WaitForInterrupt ¶
func WaitForInterrupt(interrupt func())
Types ¶
type Collection ¶
type Collection struct {
*mgo.Collection
}
func (Collection) CloseSession ¶
func (c Collection) CloseSession() (err error)
type ErrorResponse ¶ added in v1.2.3
type ErrorResponse struct {
Error error `json:"error"`
}
func NewErrorResponse ¶ added in v1.2.3
func NewErrorResponse(err error) *ErrorResponse
type File ¶
func GetLogFiles ¶
type Int64Slice ¶
type Int64Slice []int64
Int64Slice attaches the methods of Interface to []int64, sorting in decreasing order.
func (Int64Slice) Len ¶
func (p Int64Slice) Len() int
func (Int64Slice) Less ¶
func (p Int64Slice) Less(i, j int) bool
func (Int64Slice) Swap ¶
func (p Int64Slice) Swap(i, j int)
type MongoConfig ¶
type StatsError ¶
type StatsError struct { StatsInfo ErrorDetail error `json:"error"` Ft bool `json:"-"` ErrorIndex []int }
func (*StatsError) AddErrors ¶
func (se *StatsError) AddErrors()
func (*StatsError) AddSuccess ¶
func (se *StatsError) AddSuccess()
func (*StatsError) Error ¶
func (se *StatsError) Error() string
func (*StatsError) ErrorIndexIn ¶
func (se *StatsError) ErrorIndexIn(idx int) bool
Click to show internal directories.
Click to hide internal directories.