Documentation ¶
Index ¶
- Constants
- Variables
- func AddOrientFilter(flt []gift.Filter, orientation int) []gift.Filter
- func ApiWrap(c *gin.Context)
- func Auth(required bool) gin.HandlerFunc
- func CacheSize[K comparable, T Sizer](cache *Cache[K, T]) (size int64)
- func CalcUAID(addr, ua string) uint64
- func CfgReadYaml(fname string) (err error)
- func CfgWriteYaml(fname string) error
- func ClosePackages() (err error)
- func DirStoreSet(session *Session, puid Puid_t, dp DirProp) (err error)
- func DrawThumb(src image.Image, wdh, hgt int, orientation int) (data []byte, err error)
- func DrawTile(src image.Image, wdh, hgt int, orientation int) (data []byte, err error)
- func ExifStoreSet(session *Session, puid Puid_t, tp ExifProp) (err error)
- func ExtStoreSet(session *Session, puid Puid_t, xp ExtProp) (err error)
- func FromHHMMSS(dur string) int64
- func GetAID(c *gin.Context) (id uint64, err error)
- func GetFileExt(fname string) string
- func GetScanThreadsNum() int
- func GetUAID(r *http.Request) (uaid uint64, err error)
- func GetUID(c *gin.Context) uint64
- func GpsCachePut(puid Puid_t, tp ExifProp)
- func Handle404(c *gin.Context)
- func HasRangeBegin(r *http.Request) bool
- func Id3StoreSet(session *Session, puid Puid_t, tp Id3Prop) (err error)
- func ImgCacheTrim()
- func InPasslist(ip net.IP) bool
- func InitPackages() (err error)
- func IsRemote(syspath string) bool
- func IsStatic(fi fs.FileInfo) (static bool)
- func IsTypeDecoded(ext string) bool
- func IsTypeEXIF(ext string) bool
- func IsTypeID3(ext string) bool
- func IsTypeISO(ext string) bool
- func IsTypeImage(ext string) bool
- func IsTypeJPEG(ext string) bool
- func IsTypeMp3(ext string) bool
- func IsTypeNativeImg(ext string) bool
- func IsTypePlaylist(ext string) bool
- func IsTypeTileImg(ext string) bool
- func JoinUrl(elem ...string) string
- func LoadTemplates() (err error)
- func LoadUaMap() (err error)
- func Mp3Scan(r io.Reader) (length time.Duration, bitrate int, err error)
- func Negotiate(c *gin.Context, code int, data any)
- func OpenPackage() (err error)
- func PackInfo(fname string, pkg *wpk.Package, d time.Duration)
- func PathStarts(fpath, prefix string) bool
- func PathStorePath(session *Session, puid Puid_t) (fpath string, ok bool)
- func PrfReadYaml(fname string) (err error)
- func PrfUpdate()
- func PrfWriteYaml(fname string) error
- func RatFloat32(t *tiff.Tag) float32
- func RatFloat64(t *tiff.Tag) float64
- func ReadWhiteList(fname string) (err error)
- func ReadYaml(fname string, data ...any) (err error)
- func RequestUAID(c *gin.Context) uint64
- func Ret400(c *gin.Context, code int, err error)
- func Ret401(c *gin.Context, code int, err error)
- func Ret403(c *gin.Context, code int, err error)
- func Ret404(c *gin.Context, code int, err error)
- func Ret500(c *gin.Context, code int, err error)
- func RetErr(c *gin.Context, status, code int, err error)
- func RetOk(c *gin.Context, data any)
- func Router(r *gin.Engine)
- func ScanCat(prf *Profile, session *Session, puid Puid_t, cat string, percent float64, ...) (ret []any, err error)
- func ScanDir(prf *Profile, session *Session, dir string, isadmin bool, scanembed bool) (ret []any, skipped int, err error)
- func SpiCachesInfo(c *gin.Context)
- func SpiCloudAdd(c *gin.Context)
- func SpiCloudDel(c *gin.Context)
- func SpiDriveAdd(c *gin.Context)
- func SpiDriveDel(c *gin.Context)
- func SpiEditCopy(c *gin.Context)
- func SpiEditDelete(c *gin.Context)
- func SpiEditRename(c *gin.Context)
- func SpiEtmb(c *gin.Context)
- func SpiFile(c *gin.Context)
- func SpiFolder(c *gin.Context)
- func SpiGetLog(c *gin.Context)
- func SpiGpsRange(c *gin.Context)
- func SpiGpsScan(c *gin.Context)
- func SpiHasPath(c *gin.Context)
- func SpiMemUsage(c *gin.Context)
- func SpiMtmb(c *gin.Context)
- func SpiPage(pref, fname string) gin.HandlerFunc
- func SpiPing(c *gin.Context)
- func SpiRefresh(c *gin.Context)
- func SpiReload(c *gin.Context)
- func SpiServInfo(c *gin.Context)
- func SpiShareAdd(c *gin.Context)
- func SpiShareDel(c *gin.Context)
- func SpiSignin(c *gin.Context)
- func SpiTags(c *gin.Context)
- func SpiTagsBreak(c *gin.Context)
- func SpiTagsCheck(c *gin.Context)
- func SpiTagsStart(c *gin.Context)
- func SpiTile(c *gin.Context)
- func SpiTileBreak(c *gin.Context)
- func SpiTileCheck(c *gin.Context)
- func SpiTileStart(c *gin.Context)
- func SpiUserList(c *gin.Context)
- func SqlSession(f func(*Session) (any, error)) (any, error)
- func StripPort(addrport string) string
- func ThumbCacheTrim()
- func ToHHMMSS(dur int64) string
- func UpsertBuffer[T any](session *Session, table any, buf *[]Store[T]) (err error)
- func WaitHandlers()
- func WriteYaml(fname string, data ...any) (err error)
- type AgentStore
- type Asx
- type AsxEntry
- type AsxParam
- type AuthGetter
- type AuthResp
- type Bimap
- type Cache
- func (c *Cache[K, T]) Free(n int)
- func (c *Cache[K, T]) Get(key K) (ret T, ok bool)
- func (c *Cache[K, T]) Has(key K) (ok bool)
- func (c *Cache[K, T]) Len() int
- func (c *Cache[K, T]) OnRemove(efn func(K, T))
- func (c *Cache[K, T]) Peek(key K) (ret T, ok bool)
- func (c *Cache[K, T]) Poke(key K, val T)
- func (c *Cache[K, T]) Range(f func(K, T) bool)
- func (c *Cache[K, T]) Remove(key K) (ok bool)
- func (c *Cache[K, T]) Set(key K, val T)
- func (c *Cache[K, T]) ToLimit(limit int)
- func (c *Cache[K, T]) Until(f func(K, T) bool)
- type Cacher
- type CatGrp
- type Claims
- type DirKit
- type DirProp
- type DirStore
- type DiskPath
- type EmbedPath
- type ExifKit
- type ExifProp
- type ExifStore
- type ExtProp
- type ExtStat
- type ExtStore
- type ExtTag
- type FG_t
- type FT_t
- type FileCache
- func (fc *FileCache) Close() (err error)
- func (fc *FileCache) GetData(fpath string) (md MediaData, err error)
- func (fc *FileCache) GetFile(fpath string) (file wpk.RFile, mime string, t time.Time, err error)
- func (fc *FileCache) PutFile(fpath string, md MediaData) (err error)
- func (fc *FileCache) Sync() error
- type FileGroup
- type FileKit
- type FileMask
- type FileProp
- type GpsInfo
- type HdrRange
- type Id3Kit
- type Id3Prop
- type Id3Store
- type MapPath
- type MediaData
- func CacheThumb(session *Session, syspath string) (md MediaData, err error)
- func CacheTile(session *Session, syspath string, wdh, hgt int) (md MediaData, err error)
- func ExtractThmub(syspath string) (md MediaData, err error)
- func ExtractThumbEXIF(syspath string) (md MediaData, err error)
- func HdCacheGet(session *Session, puid Puid_t) (md MediaData, err error)
- func Id3ExtractThumb(syspath string) (md MediaData, err error)
- func MediaCacheGet(session *Session, puid Puid_t) (md MediaData, err error)
- type Mime_t
- type OpenStore
- type PathStore
- type Playlist
- func (pl *Playlist) AbsPath(fpath string) string
- func (pl *Playlist) ReadASX(r io.Reader) (num int64, err error)
- func (pl *Playlist) ReadFrom(r io.Reader) (num int64, err error)
- func (pl *Playlist) ReadM3U(r io.Reader) (num int64, err error)
- func (pl *Playlist) ReadPLS(r io.Reader) (num int64, err error)
- func (pl *Playlist) ReadWPL(r io.Reader) (num int64, err error)
- func (pl *Playlist) ReadXSPF(r io.Reader) (num int64, err error)
- func (pl *Playlist) WriteASX(w io.Writer) (num int64, err error)
- func (pl *Playlist) WriteM3U(w io.Writer) (num int64, err error)
- func (pl *Playlist) WriteM3U8(w io.Writer) (num int64, err error)
- func (pl *Playlist) WritePLS(w io.Writer) (num int64, err error)
- func (pl *Playlist) WriteTo(w io.Writer) (num int64, err error)
- func (pl *Playlist) WriteWPL(w io.Writer) (num int64, err error)
- func (pl *Playlist) WriteXSPF(w io.Writer) (num int64, err error)
- type Point
- type Profile
- func GetBasicAuth(credentials string) (user *Profile, code int, err error)
- func GetBearerAuth(tokenstr string) (prf *Profile, code int, err error)
- func GetUser(c *gin.Context) *Profile
- func NewProfile(login, password string) *Profile
- func UserFromCookie(c *gin.Context) (*Profile, int, error)
- func UserFromForm(c *gin.Context) (*Profile, int, error)
- func UserFromHeader(c *gin.Context) (*Profile, int, error)
- func UserFromQuery(c *gin.Context) (*Profile, int, error)
- func (prf *Profile) AddCloud(syspath, name string) bool
- func (prf *Profile) AddLocal(syspath, name string) bool
- func (prf *Profile) AddShare(syspath string) bool
- func (prf *Profile) DelCloud(syspath string) bool
- func (prf *Profile) DelLocal(syspath string) bool
- func (prf *Profile) DelShare(syspath string) bool
- func (prf *Profile) FindLocal()
- func (prf *Profile) GetPathGroup(fpath string, fi fs.FileInfo) (grp FG_t)
- func (prf *Profile) GetRootPath(session *Session, syspath string) (rootpath, rootname string)
- func (prf *Profile) GetSharePath(session *Session, syspath string) (shrpath, shrname string)
- func (prf *Profile) IsCloud(syspath string) bool
- func (prf *Profile) IsLocal(syspath string) bool
- func (prf *Profile) IsShared(syspath string) bool
- func (prf *Profile) PathAccess(syspath string, isadmin bool) bool
- func (prf *Profile) PathAdmin(syspath string) bool
- func (prf *Profile) PathType(fpath string, fi fs.FileInfo) FT_t
- func (prf *Profile) ScanLocal(session *Session, scanembed bool) (ret []any, err error)
- func (prf *Profile) ScanRemote(session *Session, scanembed bool) (ret []any, err error)
- func (prf *Profile) ScanShares(session *Session, scanembed bool) (ret []any, err error)
- type PuidProp
- type Puid_t
- func (pt Puid_t) MarshalJSON() ([]byte, error)
- func (pt Puid_t) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (pt Puid_t) MarshalYAML() (any, error)
- func (pt *Puid_t) Rand(bits int)
- func (pt *Puid_t) Set(puid string) error
- func (pt Puid_t) String() string
- func (pt *Puid_t) UnmarshalJSON(b []byte) error
- func (pt *Puid_t) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- func (pt *Puid_t) UnmarshalYAML(value *yaml.Node) error
- type RFile
- type RWList
- type RWMap
- func (rwm *RWMap[K, T]) Delete(key K)
- func (rwm *RWMap[K, T]) Get(key K) (ret T, ok bool)
- func (rwm *RWMap[K, T]) GetAndDelete(key K) (ret T, ok bool)
- func (rwm *RWMap[K, T]) Has(key K) (ok bool)
- func (rwm *RWMap[K, T]) Init(capacity int)
- func (rwm *RWMap[K, T]) Len() int
- func (rwm *RWMap[K, T]) Range(f func(K, T) bool)
- func (rwm *RWMap[K, T]) Set(key K, val T)
- type Session
- type Shape
- type Sizer
- type Store
- type StoreBuf
- type TM_t
- type TempCell
- type ThumbPath
- type TilePath
- type TileProp
- type Track
- type Unix_t
- func (ut *Unix_t) FromDB(b []byte) (err error)
- func (ut Unix_t) MarshalJSON() ([]byte, error)
- func (ut Unix_t) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (ut Unix_t) MarshalYAML() (any, error)
- func (ut Unix_t) String() string
- func (ut Unix_t) Time() time.Time
- func (ut Unix_t) ToDB() ([]byte, error)
- func (ut *Unix_t) UnmarshalJSON(b []byte) (err error)
- func (ut *Unix_t) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
- func (ut *Unix_t) UnmarshalYAML(value *yaml.Node) (err error)
- type Wpl
- type WplMedia
- type WplMeta
- type Xspf
- type XspfTrack
- type YamlReadWriter
Constants ¶
const ( SEC_null = iota SEC_badenc SEC_panic SEC_auth_absent SEC_auth_scheme SEC_basic_decode SEC_basic_noacc SEC_basic_deny SEC_token_noacc SEC_token_malform SEC_token_notsign SEC_token_badclaims SEC_token_expired SEC_token_notyet SEC_token_issuer SEC_token_error SEC_token_badaid SEC_param_noacc SEC_nourl SEC_signin_nobind SEC_signin_nosecret SEC_signin_smallsec SEC_signin_nouser SEC_signin_denypass SEC_signin_sigtime SEC_signin_timeout SEC_signin_hs256 SEC_signin_denyhash SEC_page_absent SEC_media_badacc SEC_media_noacc SEC_media_badmedia SEC_media_badhd SEC_media_badpath SEC_media_access SEC_media_hdgone SEC_media_hdfail SEC_media_hdnocnt SEC_media_medgone SEC_media_medfail SEC_media_mednocnt SEC_media_filegone SEC_media_fileopen SEC_etmb_badacc SEC_etmb_noacc SEC_etmb_nopuid SEC_etmb_nopath SEC_etmb_access SEC_etmb_badcnt SEC_etmb_notmb SEC_mtmb_badacc SEC_mtmb_noacc SEC_mtmb_nopuid SEC_mtmb_nopath SEC_mtmb_access SEC_mtmb_badcnt SEC_mtmb_absent SEC_tile_badacc SEC_tile_noacc SEC_tile_nopuid SEC_tile_twodim SEC_tile_badwdh SEC_tile_badhgt SEC_tile_zero SEC_tile_nopath SEC_tile_access SEC_tile_badcnt SEC_tile_absent SEC_reload_load SEC_reload_tmpl SEC_getlog_nobind SEC_folder_nobind SEC_folder_badacc SEC_folder_noacc SEC_folder_badpath SEC_folder_access SEC_folder_stat SEC_folder_noshr SEC_folder_home SEC_folder_drives SEC_folder_remote SEC_folder_media SEC_folder_map SEC_folder_nocat SEC_folder_absent SEC_folder_fail SEC_folder_open SEC_folder_m3u SEC_folder_wpl SEC_folder_pls SEC_folder_asx SEC_folder_xspf SEC_folder_format SEC_folder_tracks // res/tags SEC_ispath_nobind SEC_ispath_badacc SEC_ispath_noacc SEC_ispath_deny SEC_tilechk_nobind SEC_tilechk_badacc SEC_tilechk_noacc SEC_tilestart_nobind SEC_tilebreak_nobind SEC_drvadd_nobind SEC_drvadd_badacc SEC_drvadd_noacc SEC_drvadd_deny SEC_drvadd_badpath SEC_drvadd_miss SEC_drvdel_nobind SEC_drvdel_badacc SEC_drvdel_noacc SEC_drvdel_deny SEC_drvdel_nopath SEC_cldadd_nobind SEC_cldadd_badacc SEC_cldadd_noacc SEC_cldadd_deny SEC_cldadd_badhost SEC_cldadd_ftpdial SEC_cldadd_ftpcred SEC_cldadd_ftproot SEC_cldadd_sftpdial SEC_cldadd_sftpcli SEC_cldadd_sftppwd SEC_cldadd_sftproot SEC_cldadd_davdial SEC_clddel_nobind SEC_clddel_badacc SEC_clddel_noacc SEC_clddel_deny SEC_clddel_nopath SEC_shradd_nobind SEC_shradd_badacc SEC_shradd_noacc SEC_shradd_deny SEC_shradd_nopath SEC_shradd_access SEC_shrdel_nobind SEC_shrdel_badacc SEC_shrdel_noacc SEC_shrdel_deny SEC_shrdel_nopath SEC_shrdel_access SEC_edtcopy_nobind SEC_edtcopy_badacc SEC_edtcopy_noacc SEC_edtcopy_deny SEC_edtcopy_nopath SEC_edtcopy_nodest SEC_edtcopy_over SEC_edtcopy_opsrc SEC_edtcopy_statsrc SEC_edtcopy_mkdir SEC_edtcopy_rd SEC_edtcopy_opdst SEC_edtcopy_copy SEC_edtcopy_statfile SEC_edtren_nobind SEC_edtren_badacc SEC_edtren_noacc SEC_edtren_deny SEC_edtren_nopath SEC_edtren_nodest SEC_edtren_over SEC_edtren_move SEC_edtren_stat SEC_edtdel_nobind SEC_edtdel_badacc SEC_edtdel_noacc SEC_edtdel_deny SEC_edtdel_nopath SEC_edtdel_remove // gps/range SEC_gpsrange_nobind SEC_gpsrange_badacc SEC_gpsrange_noacc SEC_gpsrange_shpcirc SEC_gpsrange_shppoly SEC_gpsrange_shprect SEC_gpsrange_shpbad SEC_gpsrange_list // gps/scan SEC_gpsscan_nobind SEC_gpsscan_badacc SEC_gpsscan_noacc // stat/usrlst SEC_usrlst_nobind SEC_usrlst_asts SEC_usrlst_fost SEC_usrlst_post )
Service provider error codes. Each error code have unique source code point, so this error code at service reply exactly points to error place.
const ( // orientation: normal OrientNormal = 1 // orientation: horizontal reversed OrientHorzReversed = 2 // orientation: flipped OrientFlipped = 3 // orientation: flipped & horizontal reversed OrientFlipHorzReversed = 4 // orientation: clockwise turned & horizontal reversed OrientCwHorzReversed = 5 // orientation: clockwise turned OrientCw = 6 // orientation: anticlockwise turned & horizontal reversed OrientAcwHorzReversed = 7 // orientation: anticlockwise turned OrientAcw = 8 )
EXIF image orientation constants.
const ( // FPAnone - profile have no any access to specified file path. FPAnone = 0 // FPAadmin - only authorized access to specified file path. FPAadmin = 1 FPAshare = 2 )
File path access.
const ( CPhome = "<home>" CPlocal = "<local>" CPremote = "<remote>" CPmedia = "<media>" CPvideo = "<video>" CPaudio = "<audio>" CPimage = "<image>" CPbooks = "<books>" CPtexts = "<texts>" CPmap = "<map>" )
Categories paths constants.
const ExifDate = "2006-01-02 15:04:05.999"
const FGnum = 8
FGnum is count of file groups.
Variables ¶
var ( ErrNoJwtID = errors.New("jwt-token does not have user id") ErrBadJwtID = errors.New("jwt-token id does not refer to registered user") ErrNoAuth = errors.New("authorization is absent") ErrNoScheme = errors.New("authorization does not have expected scheme") ErrNoSecret = errors.New("expected password or SHA25 hash on it and current time as a nonce") ErrSmallKey = errors.New("password too small") ErrNoCred = errors.New("profile with given credentials does not registered") ErrNotPass = errors.New("password is incorrect") ErrSigTime = errors.New("signing time can not been recognized (time in RFC3339 expected)") ErrSigOut = errors.New("nonce is expired") ErrBadHash = errors.New("hash cannot be decoded in hexadecimal") ErrNoAcc = errors.New("profile is absent") )
HTTP error messages
var ( S2B = wpk.S2B B2S = wpk.B2S JoinPath = wpk.JoinPath ToSlash = wpk.ToSlash ToLower = wpk.ToLower ToKey = wpk.ToKey Cfg = cfg.Cfg Log = cfg.Log )
var ( ErrNoPUID = errors.New("file with given puid not found") ErrUncacheable = errors.New("file format is uncacheable") ErrNotHD = errors.New("image dimensions does not fit to full HD") ErrNotDisk = errors.New("file is not image of supported format") ErrNoMTime = errors.New("modify time tag does not found") ErrNoMime = errors.New("MIME tag does not found") ErrEmptyExif = errors.New("EXIF metadata is empty") ErrEmptyID3 = errors.New("ID3 metadata is empty") )
Error messages
var ( PathCache = NewBimap[Puid_t, string]() // Bidirectional map for PUIDs and system paths. GpsCache = NewCache[Puid_t, GpsInfo]() // FIFO cache with GPS coordinates. )
var ( Err404 = errors.New("page not found") ErrNotSys = errors.New("root PUID does not refers to file system path") ErrPathOut = errors.New("path cannot refers outside root PUID") ErrArgNoHD = errors.New("'hd' parameter not recognized") ErrArgNoDim = errors.New("bad tiles dimensions") ErrArgZDim = errors.New("dimensions can not be zero") ErrNotDir = errors.New("path is not directory") ErrNoPath = errors.New("path is not found") ErrDeny = errors.New("access denied for specified authorization") ErrHidden = errors.New("access to specified file path is disabled") ErrNoAccess = errors.New("profile has no access to specified file path") ErrNoCat = errors.New("specified category does not found") ErrNotPlay = errors.New("file can not be read as playlist") ErrFileOver = errors.New("to many files with same names contains") ErrShapeCirc = errors.New("circle must contains 1 coordinates point") ErrShapePoly = errors.New("polygon must contains 3 coordinates points at least") ErrShapeRect = errors.New("rectangle must contains 4 coordinates points") ErrShapeBad = errors.New("shape is not recognized") )
HTTP error messages
var ( ErrBadMedia = errors.New("media content is corrupted") ErrNoThumb = errors.New("embedded thumbnail is not found") ErrNotFile = errors.New("property is not file") ErrNotImg = errors.New("file is not image") ErrTooBig = errors.New("file is too big") ErrImgNil = errors.New("can not allocate image") )
Error messages
var ( // UserOnline is map of last AJAX query time for each user. UserOnline = map[uint64]time.Time{} // UaMap is the map of user agent hashes and associated client IDs. UaMap = map[uint64]uint64{} )
var AuthGetters = []AuthGetter{ UserFromHeader, UserFromQuery, UserFromCookie, }
AuthGetters is the list of functions to extract the authorization data from the parts of request. List and order in it can be changed.
var CatKeyPath = map[Puid_t]string{ PUIDhome: CPhome, PUIDlocal: CPlocal, PUIDremote: CPremote, PUIDshares: CPshares, PUIDmedia: CPmedia, PUIDvideo: CPvideo, PUIDaudio: CPaudio, PUIDimage: CPimage, PUIDbooks: CPbooks, PUIDtexts: CPtexts, PUIDmap: CPmap, }
CatKeyPath is predefined read-only maps with PUIDs keys and categories values.
var CatNames = map[string]string{ CPhome: "Home", CPlocal: "Local disks", CPremote: "Network disks", CPshares: "Shared resources", CPmedia: "Multimedia files", CPvideo: "Movie and video files", CPaudio: "Music and audio files", CPimage: "Photos and images", CPbooks: "Books", CPtexts: "Text files", CPmap: "Map", }
var CatPathKey = map[string]Puid_t{ CPhome: PUIDhome, CPlocal: PUIDlocal, CPremote: PUIDremote, CPshares: PUIDshares, CPmedia: PUIDmedia, CPvideo: PUIDvideo, CPaudio: PUIDaudio, CPimage: PUIDimage, CPbooks: PUIDbooks, CPtexts: PUIDtexts, CPmap: PUIDmap, }
CatPathKey is predefined read-only map with categories keys and PUIDs values.
var (
ErrBadType = errors.New("type does not supported to insert into database")
)
var (
ErrM3USign = errors.New("file does not starts with M3U signature")
)
var Hidden = FileMask{ Exts: []string{ ".sys", ".tmp", ".bak", }, Names: []string{ "thumbs.db", ".*", }, Paths: []string{ "?:/system volume information", "?:/windows", "?:/windowsapps", "?:/winreagent", "?:/$windows.~ws", "?:/$recycle.bin", "?:/program files", "?:/program files (x86)", "?:/programdata", "?:/recovery", "?:/config.msi", }, }
var ImgScanner scanner
ImgScanner is singleton for thumbnails producing with single queue to prevent overload.
var JP = jnt.NewJointPool()
var MimeExt = map[string]Mime_t{ "gif": MimeGif, "png": MimePng, "jpg": MimeJpeg, "jpeg": MimeJpeg, "webp": MimeWebp, }
var MimeStr = map[Mime_t]string{ MimeNil: "", MimeUnk: "image/*", MimeGif: "image/gif", MimePng: "image/png", MimeJpeg: "image/jpeg", MimeWebp: "image/webp", }
var MimeVal = map[string]Mime_t{ "image/*": MimeUnk, "image/gif": MimeGif, "image/png": MimePng, "image/jpg": MimeJpeg, "image/jpeg": MimeJpeg, "image/webp": MimeWebp, }
var Offered = []string{ binding.MIMEJSON, binding.MIMEXML, binding.MIMEYAML, binding.MIMETOML, }
var Passlist []net.IPNet
var ResFS wpk.Union // resources packages root dir.
var XormStorage *xorm.Engine
var XormUserlog *xorm.Engine
Functions ¶
func AddOrientFilter ¶
AddOrientFilter appends filters to bring image to normal orientation.
func Auth ¶
func Auth(required bool) gin.HandlerFunc
Auth is authorization middleware, sets User object associated with authorization to gin context. `required` parameter tells to continue if authorization is absent.
func CacheSize ¶
func CacheSize[K comparable, T Sizer](cache *Cache[K, T]) (size int64)
CacheSize returns size of given cache.
func CfgReadYaml ¶
CfgReadYaml reads content of Config structure from YAML-file with given file name.
func CfgWriteYaml ¶
CfgWriteYaml writes content of Config object in YAML format with header comment to file with given file name.
func DirStoreSet ¶
DirStoreSet puts value to directories cache.
func ExifStoreSet ¶
ExifStoreSet puts value to EXIF database.
func ExtStoreSet ¶
ExtStoreSet puts value to embedded info database.
func FromHHMMSS ¶
func GetFileExt ¶
GetFileExt returns file extension converted to lowercase.
func GetScanThreadsNum ¶
func GetScanThreadsNum() int
GetScanThreadsNum returns number of scanning threads depended of settings and developer mode.
func GpsCachePut ¶
func HasRangeBegin ¶
HasRangeBegin returns true if request headers have "Range" header with range thats starts from beginning of the file.
func Id3StoreSet ¶
Id3StoreSet puts value to tags database.
func ImgCacheTrim ¶
func ImgCacheTrim()
func InPasslist ¶
InPasslist checks that IP is loopback or in passlist.
func IsStatic ¶
IsStatic returns whether file info refers to content that can not be modified or moved.
func IsTypeDecoded ¶
IsTypeDecoded checks that file extension belongs to images that can be decoded.
func IsTypeEXIF ¶
IsTypeEXIF checks that file extension belongs to images with EXIF tags.
func IsTypeImage ¶
IsTypeImage checks that file is some image format.
func IsTypeJPEG ¶
IsTypeJPEG checks that file extension is in JPEG group.
func IsTypeNativeImg ¶
IsTypeNativeImg checks that image file is supported by any browser without format conversion.
func IsTypePlaylist ¶
IsTypePlaylist checks that file extension belongs playlist file.
func IsTypeTileImg ¶
IsTypeTileImg checks that image file can be used to build tiles sheet.
func LoadTemplates ¶
func LoadTemplates() (err error)
LoadTemplates is hot templates reload, during server running.
func LoadUaMap ¶
func LoadUaMap() (err error)
LoadUaMap forms content of UaMap from database on server start.
func Mp3Scan ¶
Mp3Scan scans file to calculate length of play and average bitrate. Bitrate is rounded up to kilobits.
func PathStarts ¶
PathStarts check up that given file path has given parental path.
func PathStorePath ¶
PathStorePath returns cached system path of specified PUID (path unique identifier).
func PrfReadYaml ¶
PrfReadYaml reads content of Profiles structure from YAML-file with given file name.
func PrfWriteYaml ¶
PrfWriteYaml writes content of Profiles object in YAML format with header comment to file with given file name.
func RatFloat32 ¶
func RatFloat64 ¶
func ReadWhiteList ¶
ReadWhiteList reads content of white list from YAML-file with given file name.
func RequestUAID ¶
RequestUAID calculate user agent ID from given request.
func ScanCat ¶
func ScanCat(prf *Profile, session *Session, puid Puid_t, cat string, percent float64, scanembed bool) (ret []any, err error)
ScanCat returns file properties list where number of files of given category is more then given percent.
func ScanDir ¶
func ScanDir(prf *Profile, session *Session, dir string, isadmin bool, scanembed bool) (ret []any, skipped int, err error)
ScanDir returns file properties list for given file system directory, or directory in iso-disk.
func SpiCloudDel ¶
Remove cloud entry from profile with given identifier.
func SpiDriveDel ¶
Remove drive from profile with given identifier.
func SpiRefresh ¶
func SpiTagsCheck ¶
Check whether thumbnails of pointed images prepared.
func SpiTagsStart ¶
Start to preparing thumbnails of pointed images.
func SpiTileCheck ¶
Check whether tiles of pointed images prepared.
func SqlSession ¶
SqlSession execute sql wrapped in a single session.
func ThumbCacheTrim ¶
func ThumbCacheTrim()
func UpsertBuffer ¶
Types ¶
type AgentStore ¶
type AgentStore struct { UAID uint64 `xorm:"unique"` // user agent ID CID uint64 // client ID Addr string // remote address UA string // user agent Lang string // accept language Time time.Time `xorm:"created"` }
AgentStore is storage record with user agent string and user host address.
type AsxEntry ¶
type AsxEntry struct { Text string `xml:",chardata"` Title string `xml:"title,omitempty"` Ref struct { Href string `xml:"href,attr"` } `xml:"ref"` Duration struct { Value string `xml:"value,attr"` } `xml:"duration"` Param []AsxParam `xml:"param"` Author string `xml:"author,omitempty"` Copyright string `xml:"copyright,omitempty"` }
type AuthResp ¶
type AuthResp struct { XMLName xml.Name `json:"-" yaml:"-" xml:"ret"` UID uint64 `json:"uid" yaml:"uid" xml:"uid"` Access string `json:"access" yaml:"access" xml:"access"` Refrsh string `json:"refrsh" yaml:"refrsh" xml:"refrsh"` Expire string `json:"expire" yaml:"expire" xml:"expire"` Living string `json:"living" yaml:"living" xml:"living"` }
type Bimap ¶
type Bimap[K comparable, T comparable] struct { // contains filtered or unexported fields }
Bimap is bidirectional threads safe map.
func NewBimap ¶
func NewBimap[K comparable, T comparable]() *Bimap[K, T]
NewBimap returns pointer to new Bimap object.
func (*Bimap[K, T]) DeleteDir ¶
DeleteDir deletes key-value pair pointed by key, and returns deleted value.
func (*Bimap[K, T]) DeleteRev ¶
DeleteRev deletes key-value pair pointed by value, and returns deleted key.
type Cache ¶
type Cache[K comparable, T any] struct { // contains filtered or unexported fields }
Cache is LRU & FIFO threads safe cache.
func NewCache ¶
func NewCache[K comparable, T any]() *Cache[K, T]
NewCache returns pointer to new Cache object.
func (*Cache[K, T]) Get ¶
Get returns value pointed by given key, and brings the pair to top of cache.
func (*Cache[K, T]) OnRemove ¶
func (c *Cache[K, T]) OnRemove(efn func(K, T))
OnRemove changes callback function that is called when removing a pair.
func (*Cache[K, T]) Range ¶
Range makes copy of the state and then call given function for each pair until `false` returned.
type Cacher ¶
type Cacher interface {
Cache()
}
Cacher provides function to perform image converting.
type CatGrp ¶
CatGrp indicates access to each file group.
type Claims ¶
type Claims struct { jwt.RegisteredClaims UID uint64 `json:"uid,omitempty"` }
Claims of JWT-tokens. Contains additional profile identifier.
type DirKit ¶
type DirKit struct { PuidProp `xorm:"extends" yaml:",inline"` FileProp `xorm:"extends" yaml:",inline"` DirProp `xorm:"extends" yaml:",inline"` }
DirKit is directory properties kit.
type DirProp ¶
type DirProp struct { Scan time.Time `json:"scan,omitempty" yaml:"scan,omitempty" xml:"scan,omitempty"` // directory scanning time in UNIX format, milliseconds. FGrp FileGroup `xorm:"extends" json:"fgrp,omitempty" yaml:"fgrp,flow,omitempty" xml:"fgrp,omitempty"` // directory file groups counters. Latency int `xorm:"default 0" json:"latency,omitempty" yaml:"latency,omitempty" xml:"latency,omitempty"` // drive connection latency in ms, or -1 on error }
DirProp is directory properties chunk.
func ScanFileInfoList ¶
func ScanFileInfoList(prf *Profile, session *Session, vfiles []fs.FileInfo, vpaths []DiskPath, scanembed bool) (ret []any, lstp DirProp, err error)
ScanFileInfoList returns file properties list for given list of []fs.FileInfo and associated list of full file system paths. Elements of []fs.FileInfo list can be nil in case if file is unavailable, or if it categoty item.
type DiskPath ¶
type DiskPath struct { Path string `xorm:"'path'" json:"path" yaml:"path" xml:"path"` Name string `xorm:"'name'" json:"name" yaml:"name" xml:"name"` }
DiskPath contains disk full path and icon label.
func MakeFilePath ¶
MakeFilePath creates DiskPath for file system path.
type ExifKit ¶
type ExifKit struct { ExtProp `xorm:"extends" yaml:",inline"` ExifProp `xorm:"extends" yaml:",inline"` }
ExifKit is file with EXIF tags.
type ExifProp ¶
type ExifProp struct { ImgWdh int `json:"imgwdh,omitempty" yaml:"imgwdh,omitempty" xml:"imgwdh,omitempty"` ImgHgt int `json:"imghgt,omitempty" yaml:"imghgt,omitempty" xml:"imghgt,omitempty"` // Photo Model string `xorm:"'model'" json:"model,omitempty" yaml:"model,omitempty" xml:"model,omitempty"` Make string `xorm:"'make'" json:"make,omitempty" yaml:"make,omitempty" xml:"make,omitempty"` Software string `xorm:"'software'" json:"software,omitempty" yaml:"software,omitempty" xml:"software,omitempty"` DateTime time.Time `xorm:"'datetime'" json:"datetime,omitempty" yaml:"datetime,omitempty" xml:"datetime,omitempty"` Orientation int `xorm:"'orientation'" json:"orientation,omitempty" yaml:"orientation,omitempty" xml:"orientation,omitempty"` ExposureTime string `xorm:"'exposure_time'" json:"exposuretime,omitempty" yaml:"exposuretime,omitempty" xml:"exposuretime,omitempty"` ExposureProg int `xorm:"'exposure_prog'" json:"exposureprog,omitempty" yaml:"exposureprog,omitempty" xml:"exposureprog,omitempty"` FNumber float32 `xorm:"'fnumber'" json:"fnumber,omitempty" yaml:"fnumber,omitempty" xml:"fnumber,omitempty"` ISOSpeed int `xorm:"'iso_speed'" json:"isospeed,omitempty" yaml:"isospeed,omitempty" xml:"isospeed,omitempty"` ShutterSpeed float32 `xorm:"'shutter_speed'" json:"shutterspeed,omitempty" yaml:"shutterspeed,omitempty" xml:"shutterspeed,omitempty"` Aperture float32 `xorm:"'aperture'" json:"aperture,omitempty" yaml:"aperture,omitempty" xml:"aperture,omitempty"` ExposureBias float32 `xorm:"'exposure_bias'" json:"exposurebias,omitempty" yaml:"exposurebias,omitempty" xml:"exposurebias,omitempty"` LightSource int `xorm:"'light_source'" json:"lightsource,omitempty" yaml:"lightsource,omitempty" xml:"lightsource,omitempty"` Focal float32 `xorm:"'focal'" json:"focal,omitempty" yaml:"focal,omitempty" xml:"focal,omitempty"` Focal35mm int `xorm:"'focal35mm'" json:"focal35mm,omitempty" yaml:"focal35mm,omitempty" xml:"focal35mm,omitempty"` DigitalZoom float32 `xorm:"'digital_zoom'" json:"digitalzoom,omitempty" yaml:"digitalzoom,omitempty" xml:"digitalzoom,omitempty"` Flash int `xorm:"'flash'" json:"flash,omitempty" yaml:"flash,omitempty" xml:"flash,omitempty"` UniqueID string `xorm:"'unique_id'" json:"uniqueid,omitempty" yaml:"uniqueid,omitempty" xml:"uniqueid,omitempty"` ThumbJpegLen int `xorm:"'thumb_jpeg_len'" json:"thumbjpeglen,omitempty" yaml:"thumbjpeglen,omitempty" xml:"thumbjpeglen,omitempty"` // GPS Latitude float64 `xorm:"'latitude'" json:"latitude,omitempty" yaml:"latitude,omitempty" xml:"latitude,omitempty"` Longitude float64 `xorm:"'longitude'" json:"longitude,omitempty" yaml:"longitude,omitempty" xml:"longitude,omitempty"` Altitude float32 `xorm:"'altitude'" json:"altitude,omitempty" yaml:"altitude,omitempty" xml:"altitude,omitempty"` Satellites string `xorm:"'satellites'" json:"satellites,omitempty" yaml:"satellites,omitempty" xml:"satellites,omitempty"` }
ExifProp is EXIF tags properties chunk.
func ExifExtract ¶
ExifExtract trys to extract EXIF metadata from file.
func ExifStoreGet ¶
ExifStoreGet returns value from EXIF database.
type ExtProp ¶
type ExtProp struct { Tags ExtTag `xorm:"tags" json:"tags" yaml:"tags" xml:"tags"` ETmb Mime_t `xorm:"etmb" json:"etmb" yaml:"etmb" xml:"etmb"` // embedded thumbnail Width int `xorm:"width" json:"width,omitempty" yaml:"width,omitempty" xml:"width,omitempty"` // image width in pixels Height int `xorm:"height" json:"height,omitempty" yaml:"height,omitempty" xml:"height,omitempty"` // image height in pixels PBLen time.Duration `xorm:"pblen" json:"pblen,omitempty" yaml:"pblen,omitempty" xml:"pblen,omitempty"` // playback length BitRate int `xorm:"bitrate" json:"bitrate,omitempty" yaml:"bitrate,omitempty" xml:"bitrate,omitempty"` }
func ExtStoreGet ¶
ExtStoreGet returns value from embedded info database.
type FG_t ¶
type FG_t int
FG_t is enum type for file groups.
const ( FGother FG_t = 0 FGvideo FG_t = 1 FGaudio FG_t = 2 FGimage FG_t = 3 FGbooks FG_t = 4 FGtexts FG_t = 5 FGpacks FG_t = 6 FGgroup FG_t = 7 )
File groups.
func GetFileGroup ¶
GetFileGroup returns file group integer value for given file name by it's extension.
type FileCache ¶
FileCache describes package with cache functionality. Package splitted in two files - tags table file and data file with cached nested files.
var ( // cache with images thumbnails which are placed in box 256x256. ThumbPkg *FileCache // cache with images tiles, size of each tile is placed as sufix // of path in format "full/path/to/file.ext?144x108". TilesPkg *FileCache )
package caches
func InitCacheWriter ¶
InitCacheWriter opens existing cache with given file path placed in cache directory, or creates new cache file if no one found.
type FileGroup ¶
type FileGroup struct { FGother uint `xorm:"'other' default 0" json:"other,omitempty" yaml:"other,omitempty" xml,omitempty,attr:"other"` FGvideo uint `xorm:"'video' default 0" json:"video,omitempty" yaml:"video,omitempty" xml,omitempty,attr:"video"` FGaudio uint `xorm:"'audio' default 0" json:"audio,omitempty" yaml:"audio,omitempty" xml,omitempty,attr:"audio"` FGimage uint `xorm:"'image' default 0" json:"image,omitempty" yaml:"image,omitempty" xml,omitempty,attr:"image"` FGbooks uint `xorm:"'books' default 0" json:"books,omitempty" yaml:"books,omitempty" xml,omitempty,attr:"books"` FGtexts uint `xorm:"'texts' default 0" json:"texts,omitempty" yaml:"texts,omitempty" xml,omitempty,attr:"texts"` FGpacks uint `xorm:"'packs' default 0" json:"packs,omitempty" yaml:"packs,omitempty" xml,omitempty,attr:"packs"` FGgroup uint `xorm:"'group' default 0" json:"group,omitempty" yaml:"group,omitempty" xml,omitempty,attr:"group"` }
type FileKit ¶
type FileKit struct { PuidProp `xorm:"extends" yaml:",inline"` FileProp `xorm:"extends" yaml:",inline"` TileProp `xorm:"extends" yaml:",inline"` ExtProp `xorm:"extends" yaml:",inline"` }
FileKit is common files properties kit.
type FileMask ¶
type FileProp ¶
type FileProp struct { Name string `xorm:"'name'" json:"name" yaml:"name" xml:"name"` Type FT_t `xorm:"'type'" json:"type" yaml:"type" xml:"type"` // do not omit empty Size int64 `xorm:"'size' default 0" json:"size,omitempty" yaml:"size,omitempty" xml:"size,omitempty"` Time time.Time `xorm:"'time' DateTime default 0" json:"time,omitempty" yaml:"time,omitempty" xml:"time,omitempty"` }
FileProp is common file properties chunk.
type GpsInfo ¶
type GpsInfo struct { DateTime time.Time `xorm:"DateTime" json:"time" yaml:"time" xml:"time,attr"` // photo creation date/time in Unix milliseconds Latitude float64 `json:"lat" yaml:"lat" xml:"lat,attr"` Longitude float64 `json:"lon" yaml:"lon" xml:"lon,attr"` Altitude float32 `json:"alt,omitempty" yaml:"alt,omitempty" xml:"alt,omitempty,attr"` }
GpsInfo describes GPS-data from the photos: latitude, longitude, altitude and creation time.
type HdrRange ¶
HdrRange describes one range chunk of the file to download.
func GetHdrRange ¶
GetHdrRange returns array of ranges of file to download from request header.
type Id3Kit ¶
type Id3Kit struct { ExtProp `xorm:"extends" yaml:",inline"` Id3Prop `xorm:"extends" yaml:",inline"` }
Id3Kit is music file tags properties kit.
type Id3Prop ¶
type Id3Prop struct { Title string `json:"title,omitempty" yaml:"title,omitempty" xml:"title,omitempty"` Album string `json:"album,omitempty" yaml:"album,omitempty" xml:"album,omitempty"` Artist string `json:"artist,omitempty" yaml:"artist,omitempty" xml:"artist,omitempty"` Composer string `json:"composer,omitempty" yaml:"composer,omitempty" xml:"composer,omitempty"` Genre string `json:"genre,omitempty" yaml:"genre,omitempty" xml:"genre,omitempty"` Year int `json:"year,omitempty" yaml:"year,omitempty" xml:"year,omitempty"` TrackNum int `xorm:"'tracknum'" json:"tracknum,omitempty" yaml:"tracknum,flow,omitempty" xml:"tracknum,omitempty,attr"` TrackSum int `xorm:"'tracksum'" json:"tracksum,omitempty" yaml:"tracksum,flow,omitempty" xml:"tracksum,omitempty,attr"` DiscNum int `xorm:"'discnum'" json:"discnum,omitempty" yaml:"discnum,flow,omitempty" xml:"discnum,omitempty,attr"` DiscSum int `xorm:"'discsum'" json:"discsum,omitempty" yaml:"discsum,flow,omitempty" xml:"discsum,omitempty,attr"` Lyrics string `json:"lyrics,omitempty" yaml:"lyrics,omitempty" xml:"lyrics,omitempty"` Comment string `json:"comment,omitempty" yaml:"comment,omitempty" xml:"comment,omitempty"` ThumbLen int `xorm:"'thumblen'" json:"thumblen,omitempty" yaml:"thumblen,omitempty" xml:"thumblen,omitempty"` TmbMime Mime_t `xorm:"'tmbmime'" json:"tmbmime,omitempty" yaml:"tmbmime,omitempty" xml:"tmbmime,omitempty"` }
Id3Prop is Music file tags properties chunk.
func Id3Extract ¶
Id3Extract trys to extract ID3 metadata from file.
func Id3StoreGet ¶
Id3StoreGet returns value from tags database.
type MapPath ¶
type MapPath struct { Shape Shape `json:"shape" yaml:"shape" xml:"shape"` Eject bool `json:"eject" yaml:"eject" xml:"eject"` Radius float64 `json:"radius,omitempty" yaml:"radius,omitempty" xml:"radius,omitempty"` Coord []Point `json:"coord" yaml:"coord,flow" xml:"coord>point"` }
MapPath describes any map path that can contains a points.
type MediaData ¶
MediaData is thumbnails cache element.
func CacheThumb ¶
CacheThumb tries to extract existing thumbnail from cache, otherwise makes new one and put it to cache.
func CacheTile ¶
CacheTile tries to extract existing tile from cache, otherwise makes new one and put it to cache.
func ExtractThmub ¶
ExtractThmub extract thumbnail from embedded file tags.
func ExtractThumbEXIF ¶
func HdCacheGet ¶
HdCacheGet returns image with given PUID converted to HD resolution from memory cache.
func Id3ExtractThumb ¶
Id3ExtractThumb trys to extract thumbnail from file ID3 metadata.
func MediaCacheGet ¶
MediaCacheGet returns media file with given PUID converted to acceptable for browser format from memory cache.
type Mime_t ¶
type Mime_t int16
func CachedThumbMime ¶
CachedThumbMime returns MIME type of rendered thumbnail in package, or MimeNil if it not present.
func CachedTileMime ¶
CachedTileMime returns MIME type of rendered tile in package with given tile multiplier, or MimeNil if it not present.
func GetMimeVal ¶
type OpenStore ¶
type OpenStore struct { UAID uint64 // client ID AID uint64 `xorm:"default 0"` // access profile ID UID uint64 `xorm:"default 0"` // user profile ID Path string // system path Latency int // event latency, in milliseconds, or -1 if it file Time time.Time `xorm:"created"` // time of event rise }
OpenStore is storage record with some opened file or opened folder.
type PathStore ¶
type PathStore struct { Puid Puid_t `xorm:"pk autoincr"` Path string `xorm:"notnull unique index"` }
PathStore sqlite3 item of unlimited cache with puid/syspath values.
type Playlist ¶
type Profile ¶
type Profile struct { ID uint64 `json:"id" yaml:"id" xml:"id,attr"` Login string `json:"login" yaml:"login" xml:"login"` Password string `json:"password" yaml:"password" xml:"password"` Local []DiskPath `json:"local" yaml:"local" xml:"local>item"` // root directories list Remote []DiskPath `json:"remote" yaml:"remote" xml:"remote>item"` // contains filtered or unexported fields }
Profile contains access configuration to resources.
func NewProfile ¶
NewProfile make new profile and insert it to the list.
func (*Profile) FindLocal ¶
func (prf *Profile) FindLocal()
FindLocal scans all available drives installed on local machine.
func (*Profile) GetPathGroup ¶
func (*Profile) GetRootPath ¶
GetRootPath returns path to nearest root path that contains given syspath, and its name.
func (*Profile) GetSharePath ¶
GetSharePath returns path in nearest shared folder that contains given syspath, and its name.
func (*Profile) PathAccess ¶
PathAccess returns file group access state for given file path.
func (*Profile) PathAdmin ¶
PathAdmin returns whether profile has admin access to file path or category path.
func (*Profile) ScanRemote ¶
ScanRemote scans paths at network destination.
type PuidProp ¶
type PuidProp struct { PUID Puid_t `xorm:"'puid'" json:"puid" yaml:"puid" xml:"puid,attr"` Free bool `xorm:"'free'" json:"free" yaml:"free" xml:"free,attr"` Static bool `xorm:"'static'" json:"static" yaml:"static" xml:"static,attr"` }
PuidProp encapsulated path unique ID value for some properties kit.
type Puid_t ¶
type Puid_t uint64
Puid_t represents integer form of path unique ID.
const ( PUIDhome Puid_t = 1 PUIDlocal Puid_t = 2 PUIDremote Puid_t = 3 PUIDmedia Puid_t = 5 PUIDvideo Puid_t = 6 PUIDaudio Puid_t = 7 PUIDimage Puid_t = 8 PUIDbooks Puid_t = 9 PUIDtexts Puid_t = 10 PUIDmap Puid_t = 11 PUIDcache = 32 // first PUID of file system paths )
Predefined PUIDs.
func PathStoreCache ¶
PathStoreCache returns cached PUID for specified system path, or make it and put into cache.
func PathStorePUID ¶
PathStorePUID returns cached PUID for specified system path.
func UnfoldPath ¶
UnfoldPath brings any share path to system file path.
func (Puid_t) MarshalJSON ¶
MarshalJSON is JSON marshaler interface implementation.
func (Puid_t) MarshalXML ¶
MarshalXML is XML marshaler interface implementation.
func (Puid_t) MarshalYAML ¶
MarshalYAML is YAML marshaler interface implementation.
func (*Puid_t) Rand ¶
Rand generates random identifier of given length in bits, maximum 64 bits. Multiply x5 to convert length in base32 symbols to bits.
func (*Puid_t) UnmarshalJSON ¶
UnmarshalJSON is JSON unmarshaler interface implementation.
func (*Puid_t) UnmarshalXML ¶
UnmarshalXML is XML unmarshaler interface implementation.
func (*Puid_t) UnmarshalYAML ¶
UnmarshalYAML is YAML unmarshaler interface implementation.
type RWList ¶
type RWList[T comparable] struct { // contains filtered or unexported fields }
type RWMap ¶
type RWMap[K comparable, T any] struct { // contains filtered or unexported fields }
RWMap is threads safe map.
func (*RWMap[K, T]) GetAndDelete ¶
GetAndDelete removes pair from map and returns the value if it was.
type Sizer ¶
type Sizer interface {
Size() int64
}
Sizer is interface that determine structure size itself.
type Store ¶
type Store[T any] struct { Puid Puid_t `xorm:"pk" json:"puid" yaml:"puid" xml:"puid,attr"` Prop T `xorm:"extends" json:"prop" yaml:"prop" xml:"prop"` }
Store is struct of sqlite3 item for cache with puid/T values.
type TileProp ¶
type TileProp struct { MTmbVal Mime_t `json:"mtmb" yaml:"mtmb" xml:"mtmb"` MT02Val Mime_t `json:"mt02,omitempty" yaml:"mt02,omitempty" xml:"mt02,omitempty"` MT03Val Mime_t `json:"mt03,omitempty" yaml:"mt03,omitempty" xml:"mt03,omitempty"` MT04Val Mime_t `json:"mt04,omitempty" yaml:"mt04,omitempty" xml:"mt04,omitempty"` MT06Val Mime_t `json:"mt06,omitempty" yaml:"mt06,omitempty" xml:"mt06,omitempty"` MT08Val Mime_t `json:"mt08,omitempty" yaml:"mt08,omitempty" xml:"mt08,omitempty"` MT09Val Mime_t `json:"mt09,omitempty" yaml:"mt09,omitempty" xml:"mt09,omitempty"` MT10Val Mime_t `json:"mt10,omitempty" yaml:"mt10,omitempty" xml:"mt10,omitempty"` MT12Val Mime_t `json:"mt12,omitempty" yaml:"mt12,omitempty" xml:"mt12,omitempty"` MT15Val Mime_t `json:"mt15,omitempty" yaml:"mt15,omitempty" xml:"mt15,omitempty"` MT16Val Mime_t `json:"mt16,omitempty" yaml:"mt16,omitempty" xml:"mt16,omitempty"` MT18Val Mime_t `json:"mt18,omitempty" yaml:"mt18,omitempty" xml:"mt18,omitempty"` MT20Val Mime_t `json:"mt20,omitempty" yaml:"mt20,omitempty" xml:"mt20,omitempty"` MT24Val Mime_t `json:"mt24,omitempty" yaml:"mt24,omitempty" xml:"mt24,omitempty"` MT30Val Mime_t `json:"mt30,omitempty" yaml:"mt30,omitempty" xml:"mt30,omitempty"` MT36Val Mime_t `json:"mt36,omitempty" yaml:"mt36,omitempty" xml:"mt36,omitempty"` }
TileProp is thumbnails properties.
type Unix_t ¶
type Unix_t uint64
Unix_t is UNIX time in milliseconds.
func UnixJS ¶
UnixJS converts time to UNIX-time in milliseconds, compatible with javascript time format.
func (Unix_t) MarshalJSON ¶
MarshalJSON is JSON marshaler interface implementation.
func (Unix_t) MarshalXML ¶
MarshalXML is XML marshaler interface implementation.
func (Unix_t) MarshalYAML ¶
MarshalYAML is YAML marshaler interface implementation.
func (*Unix_t) UnmarshalJSON ¶
UnmarshalJSON is JSON unmarshaler interface implementation.
func (*Unix_t) UnmarshalXML ¶
UnmarshalXML is XML unmarshaler interface implementation.
func (*Unix_t) UnmarshalYAML ¶
UnmarshalYAML is YAML unmarshaler interface implementation.
type Wpl ¶
type Wpl struct { XMLName xml.Name `xml:"smil"` Text string `xml:",chardata"` Head struct { Text string `xml:",chardata"` Meta []WplMeta `xml:"meta"` Title string `xml:"title"` } `xml:"head"` Body struct { Text string `xml:",chardata"` Seq struct { Text string `xml:",chardata"` Media []WplMedia `xml:"media"` } `xml:"seq"` } `xml:"body"` }
type Xspf ¶
Source Files ¶
- api-content.go
- api-cutpaste.go
- api-folder.go
- api-gps.go
- api-profile.go
- api-sys.go
- api-tile.go
- auth.go
- caches.go
- errcodes.go
- exifprop.go
- extprop.go
- fileprop.go
- filetype.go
- id3prop.go
- imgscan.go
- io.go
- loader.go
- maketmb.go
- playlist.go
- profile.go
- puid.go
- routes-gin.go
- safemap.go
- scandir.go
- storebuf.go
- tileprop.go
- users.go