Documentation ¶
Index ¶
- Constants
- Variables
- type Fav4Board
- type Fav4Folder
- type FavBoard
- type FavFolder
- type FavLine
- type FavRaw
- func (f *FavRaw) AddBoard(bid ptttype.Bid) (favType *FavType, err error)
- func (f *FavRaw) AddFolder() (favType *FavType, err error)
- func (f *FavRaw) AddLine() (favType *FavType, err error)
- func (f *FavRaw) CleanRoot()
- func (f *FavRaw) GetBoard(bid ptttype.Bid) (favType *FavType, err error)
- func (f *FavRaw) GetFavItem(theID int, theType FavT) (favType *FavType)
- func (f *FavRaw) Increase(theType FavT, fp interface{})
- func (f *FavRaw) PreAppend(theType FavT, fp interface{}) (favType *FavType, err error)
- func (f *FavRaw) Save(userID *ptttype.UserID_t) (*FavRaw, error)
- func (f *FavRaw) WriteFavrec(file *os.File) error
- type FavT
- type FavType
- type Favh
- type Fid
- type Lid
Constants ¶
View Source
const ( FAV_MAXDEPTH = 5 MAX_FAV = 1024 MAX_LINE = 64 MAX_FOLDER = 64 NEW_FAV_THRESHOLD = 12 )
View Source
const ( FAV = ".fav" FAV4 = ".fav4" FAVNB = ".favnb" )
View Source
const (
FAV_VERSION int16 = 3363
)
View Source
const SIZE_OF_FAV4_BOARD = unsafe.Sizeof(Fav4Board{})
View Source
const SIZE_OF_FAV4_FOLDER = unsafe.Sizeof(Fav4Folder{})
View Source
const SIZE_OF_FAV_BOARD = unsafe.Sizeof(FavBoard{})
View Source
const SIZE_OF_FAV_FOLDER = unsafe.Sizeof(FavFolder{})
View Source
const SIZE_OF_FAV_LINE = unsafe.Sizeof(FavLine{})
Variables ¶
View Source
var ( ErrInvalidFavBoard = errors.New("invalid fav-board") ErrInvalidFavLine = errors.New("invalid fav-line") ErrInvalidFavFolder = errors.New("invalid fav-folder") ErrInvalidFavType = errors.New("invalid fav-type") ErrInvalidFavRecord = errors.New("invalid fav-record") ErrInvalidFav4Record = errors.New("invalid fav4-record") ErrOutdatedFav = errors.New("outdated fav") ErrTooManyFavs = errors.New("too many favs") ErrTooManyLines = errors.New("too many lines") ErrTooManyFolders = errors.New("too many folders") )
Functions ¶
This section is empty.
Types ¶
type Fav4Folder ¶
type Fav4Folder struct { Fid Fid Title ptttype.BoardTitle_t ThisFolder int32 }
type FavRaw ¶
type FavRaw struct { MTime types.Time4 FavNum int16 Root *FavRaw NBoards int16 /* number of the boards */ NLines int8 /* number of the lines */ NFolders int8 /* number of the folders */ LineID Lid /* current max line id */ FolderID Fid /* current max folder id */ Favh []*FavType }
FavRaw
It's with it's own serialize method and does not directly copy by struct. We can add MTime in FavRaw. The content of FavFolder
func TryFav4Load ¶
func (*FavRaw) PreAppend ¶
PreAppend
https://github.com/ptt/pttbbs/blob/master/mbbsd/fav.c#L804 Although it is named PreAppend, actually it appends to DataTail
type FavT ¶
type FavT int8
func (FavT) GetFav4TypeSize ¶
func (FavT) GetTypeSize ¶
func (FavT) IsValidFavType ¶
Click to show internal directories.
Click to hide internal directories.