Documentation ¶
Index ¶
- Constants
- Variables
- func GeneratePostSlug(post *fourc.Post) string
- func InitializeLogger()
- func LogDebug(v ...interface{})
- func LogDebugf(format string, v ...interface{})
- func LogError(v ...interface{})
- func LogErrorf(format string, v ...interface{})
- func LogInfo(v ...interface{})
- func LogInfof(format string, v ...interface{})
- func LogTrace(v ...interface{})
- func LogTracef(format string, v ...interface{})
- func Max(a int, b int) int
- func Min(a int, b int) int
- func UseSystemLocale()
- type Board
- type BoardsDir
- type FS
- type File
- type FileAccessCallback
- type FileAccessCallbackNoop
- type FileCache
- type FilenameByLocale
- type HasDirent
- type ImageDir
- func (d *ImageDir) Attr(ctx context.Context, a *fuse.Attr) error
- func (d *ImageDir) GetContentDirents() []fuse.Dirent
- func (d *ImageDir) GetDirent() fuse.Dirent
- func (d *ImageDir) Lookup(ctx context.Context, name string) (fs.Node, error)
- func (d *ImageDir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)
- func (d *ImageDir) Slug() string
- type ImageList
- func (il *ImageList) Add(files ...*RemoteFile)
- func (il *ImageList) Copy() *ImageList
- func (il *ImageList) Get(slug string) (file *RemoteFile, present bool)
- func (il *ImageList) GetContentDirents() []fuse.Dirent
- func (il *ImageList) GetIndex(file *RemoteFile) (index int, found bool)
- func (il *ImageList) GetNEntriesAfter(index int, amount int) []*RemoteFile
- func (il *ImageList) GetNEntriesBefore(index int, amount int) []*RemoteFile
- func (il *ImageList) SortByLocale()
- type Post
- func (p *Post) Attr(ctx context.Context, a *fuse.Attr) error
- func (p *Post) GetCommentSanitized() string
- func (p *Post) GetDirent() fuse.Dirent
- func (p *Post) GetImage() *RemoteFile
- func (p *Post) GetSamePrefixedSlugThumbnail() *RemoteFile
- func (p *Post) GetSubjectSanitized() string
- func (p *Post) GetThumbnail() *RemoteFile
- func (p *Post) GetUserName() string
- func (p *Post) HasImage() bool
- func (p *Post) Lookup(ctx context.Context, name string) (fs.Node, error)
- func (p *Post) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)
- func (p *Post) Slug() string
- func (p *Post) Time() time.Time
- type PostPrefetch
- type PostsDir
- type PrefetchWorkerPool
- type RemoteFile
- func (f *RemoteFile) AddPrefix(prefix string)
- func (f *RemoteFile) AddSuffix(suffix string)
- func (f *RemoteFile) Attr(ctx context.Context, a *fuse.Attr) error
- func (f *RemoteFile) Download(hasPriority bool)
- func (f *RemoteFile) GetDirent() fuse.Dirent
- func (f *RemoteFile) IsDownloaded() bool
- func (f *RemoteFile) ReadAll(ctx context.Context) ([]byte, error)
- func (f *RemoteFile) SetAccessCallback(fac FileAccessCallback)
- func (f *RemoteFile) Slug() string
- type Thread
Constants ¶
View Source
const ( HASH_BOARD_PREFIX = "bo" HASH_THREAD_PREFIX = "th" HASH_THREAD_INFO_PREFIX = "ti" HASH_THREAD_DISCUSSION = "td" HASH_POST_PREFIX = "po" HASH_POST_INFO_PREFIX = "pi" HASH_POST_IMAGE = "pm" HASH_POST_THUMBNAIL = "pt" HASH_POST_PREFIXED_THUMBNAIL = "pp" HASH_POST_COMMENT = "pc" HASH_POST_SUBJECT = "ps" HASH_IMAGE_DIR_PREFIX = "id" HASH_POSTS_DIR_PREFIX = "pd" )
View Source
const EARLY_REMOTE_DOWNLOAD = true
Download remote files early on "Attr" call. This will help with file browsers that are otherwise confused with 0 size thumbnails. The posts main images are not affacted because their size is available as meta data in advance. Disable it if you do not need thumbnails.
Variables ¶
View Source
var (
Log *log.Logger
)
Functions ¶
func GeneratePostSlug ¶
func InitializeLogger ¶
func InitializeLogger()
func UseSystemLocale ¶
func UseSystemLocale()
Types ¶
type BoardsDir ¶
type BoardsDir struct {
// contains filtered or unexported fields
}
func LoadBoards ¶
func LoadBoards() *BoardsDir
type FileAccessCallback ¶
type FileAccessCallback interface {
// contains filtered or unexported methods
}
type FileAccessCallbackNoop ¶
type FileAccessCallbackNoop struct { }
func NewFileAccessCallbackNoop ¶
func NewFileAccessCallbackNoop() *FileAccessCallbackNoop
type FilenameByLocale ¶
type FilenameByLocale []*listEntry
func (FilenameByLocale) Len ¶
func (s FilenameByLocale) Len() int
func (FilenameByLocale) Less ¶
func (s FilenameByLocale) Less(i, j int) bool
func (FilenameByLocale) Swap ¶
func (s FilenameByLocale) Swap(i, j int)
type ImageDir ¶
type ImageDir struct {
// contains filtered or unexported fields
}
func NewImageDir ¶
func NewImageDir(slug string, remoteFiles []*RemoteFile) *ImageDir
func NewImageDirFromImageList ¶
ImageList will be copied
func (*ImageDir) GetContentDirents ¶
func (*ImageDir) ReadDirAll ¶
type ImageList ¶
type ImageList struct {
// contains filtered or unexported fields
}
func NewImageList ¶
func NewImageList() *ImageList
func (*ImageList) Add ¶
func (il *ImageList) Add(files ...*RemoteFile)
func (*ImageList) GetContentDirents ¶
func (*ImageList) GetIndex ¶
func (il *ImageList) GetIndex(file *RemoteFile) (index int, found bool)
func (*ImageList) GetNEntriesAfter ¶
func (il *ImageList) GetNEntriesAfter(index int, amount int) []*RemoteFile
func (*ImageList) GetNEntriesBefore ¶
func (il *ImageList) GetNEntriesBefore(index int, amount int) []*RemoteFile
func (*ImageList) SortByLocale ¶
func (il *ImageList) SortByLocale()
type Post ¶
type Post struct {
// contains filtered or unexported fields
}
func (*Post) GetCommentSanitized ¶
func (*Post) GetImage ¶
func (p *Post) GetImage() *RemoteFile
func (*Post) GetSamePrefixedSlugThumbnail ¶
func (p *Post) GetSamePrefixedSlugThumbnail() *RemoteFile
func (*Post) GetSubjectSanitized ¶
func (*Post) GetThumbnail ¶
func (p *Post) GetThumbnail() *RemoteFile
func (*Post) GetUserName ¶
type PostPrefetch ¶
type PostPrefetch struct {
// contains filtered or unexported fields
}
func NewPostPrefetch ¶
func NewPostPrefetch(imageList *ImageList) *PostPrefetch
type PostsDir ¶
type PostsDir struct {
// contains filtered or unexported fields
}
func (*PostsDir) ReadDirAll ¶
type PrefetchWorkerPool ¶
type PrefetchWorkerPool struct {
// contains filtered or unexported fields
}
func GetPrefetchWorkerPool ¶
func GetPrefetchWorkerPool() *PrefetchWorkerPool
func NewPrefetchWorkerPool ¶
func NewPrefetchWorkerPool() *PrefetchWorkerPool
func (*PrefetchWorkerPool) Pause ¶
func (wp *PrefetchWorkerPool) Pause()
func (*PrefetchWorkerPool) Resume ¶
func (wp *PrefetchWorkerPool) Resume()
func (*PrefetchWorkerPool) ScheduleDownload ¶
func (wp *PrefetchWorkerPool) ScheduleDownload(file *RemoteFile)
type RemoteFile ¶
type RemoteFile struct {
// contains filtered or unexported fields
}
func NewRemoteFile ¶
func NewRemoteFile(inode uint64, slug string, url string, size uint64) *RemoteFile
func (*RemoteFile) AddPrefix ¶
func (f *RemoteFile) AddPrefix(prefix string)
func (*RemoteFile) AddSuffix ¶
func (f *RemoteFile) AddSuffix(suffix string)
func (*RemoteFile) Download ¶
func (f *RemoteFile) Download(hasPriority bool)
func (*RemoteFile) GetDirent ¶
func (f *RemoteFile) GetDirent() fuse.Dirent
func (*RemoteFile) IsDownloaded ¶
func (f *RemoteFile) IsDownloaded() bool
func (*RemoteFile) SetAccessCallback ¶
func (f *RemoteFile) SetAccessCallback(fac FileAccessCallback)
func (*RemoteFile) Slug ¶
func (f *RemoteFile) Slug() string
type Thread ¶
type Thread struct { *Post // contains filtered or unexported fields }
func (*Thread) GetThumbnail ¶
func (t *Thread) GetThumbnail() *RemoteFile
Source Files ¶
- board.go
- boards_dir.go
- file.go
- file_access_callback.go
- file_cache.go
- fuse_inodes.go
- fuse_util.go
- html_util.go
- image_dir.go
- image_list.go
- image_list_sort_by_locale.go
- locale.go
- logger.go
- math_util.go
- post.go
- post_prefetch.go
- post_prefetch_worker_pool.go
- posts_dir.go
- remote_file.go
- root.go
- string_util.go
- thread.go
Click to show internal directories.
Click to hide internal directories.