timekey

package
v0.0.0-...-b52dbaa Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2015 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package timekey implements a customized Fid to get/set time/mime/size info in fid for seaweedfs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fid

type Fid struct {
	Id     uint32 // volume id
	Key    uint64 // file key for volume
	Cookie uint32 // cookie
}

func NewFid

func NewFid(volId, fullPath string) (*Fid, error)

func ParseFid

func ParseFid(s string) (*Fid, error)

func (*Fid) InsertCookie

func (f *Fid) InsertCookie(dataSize int, mimeType ...string)

Set Fid.Cookie(32 bits) according to the file infomation Fid.Cookie contains the mime type info and file size(in KB) midx takes the left 10 bits mask: 0xffc00000 size tekes the rigth 22 bits mask: 0x003fffff

func (*Fid) InsertKeyAndCookie

func (f *Fid) InsertKeyAndCookie(fullPath string) error

func (*Fid) InsertTimeKey

func (f *Fid) InsertTimeKey()

Set Fid.Key to current nano seconds since 1970's which is monotonouse increased :) Let's hope this key would not collides with each other

func (*Fid) MimeType

func (f *Fid) MimeType() string

mime type for this fid

func (*Fid) Size

func (f *Fid) Size() int

Size in KB

func (*Fid) String

func (f *Fid) String() string

Fid in string form

func (*Fid) Time

func (f *Fid) Time() time.Time

func (*Fid) VolumeID

func (f *Fid) VolumeID() string

Jump to

Keyboard shortcuts

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