Versions in this module Expand all Collapse all v2 v2.0.11 May 26, 2024 v2.0.10 Apr 5, 2024 Changes in this version type ConfigXMLFormat + Regexp bool v2.0.9 Apr 4, 2024 Changes in this version type Action + func NewActionXML(name string, format map[string]ConfigXMLFormat, server *Server, ...) Action + type ActionXML struct + func (as *ActionXML) CanHandle(contentType string, filename string) bool + func (as *ActionXML) Do(uri *url.URL, contentType string, width *uint, height *uint, ...) (interface{}, []string, []string, error) + func (as *ActionXML) DoV2(filename string) (*ResultV2, error) + func (as *ActionXML) GetCaps() ActionCapability + func (as *ActionXML) GetName() string + func (as *ActionXML) GetWeight() uint + func (as *ActionXML) Stream(contentType string, reader io.Reader, filename string) (*ResultV2, error) + type ConfigXML struct + Enabled bool + Format map[string]ConfigXMLFormat + type ConfigXMLFormat struct + Attributes map[string]string + Mime string + Pronom string + Subtype string + Type string type IndexerConfig + XML ConfigXML v2.0.8 Mar 27, 2024 v2.0.7 Mar 15, 2024 v2.0.6 Mar 15, 2024 v2.0.5 Nov 2, 2023 v2.0.4 Nov 1, 2023 v2.0.3 Oct 26, 2023 v2.0.2 Oct 13, 2023 v2.0.1 Sep 8, 2023 Changes in this version + const ACTALL + const ACTALLPROTO + const ACTFILE + const ACTFILEFULL + const ACTFILEHEAD + const ACTHEAD + const ACTHTTP + const ACTHTTPS + const ACTSTREAM + const ACTWEB + const NSRL_File + const NSRL_MFG + const NSRL_OS + const NSRL_PROD + var ACTAction map[string]ActionCapability = map[string]ActionCapability + var ACTString map[ActionCapability]string = map[ActionCapability]string + var EACTAction map[string]ExternalActionCalltype = map[string]ExternalActionCalltype + var EACTString map[ExternalActionCalltype]string = map[ExternalActionCalltype]string + var ErrMimeNotApplicable = errors.New("mime type not applicable for actions") + func ClearMime(mimetype string) string + func CreateLogger(module string, logfile string, loglevel string) (log *logging.Logger, lf *os.File) + func FileExists(filename string) bool + func Max(a, b int64) int64 + type Action interface + CanHandle func(contentType string, filename string) bool + Do func(uri *url.URL, contentType string, width *uint, height *uint, ...) (interface{}, []string, []string, error) + DoV2 func(filename string) (*ResultV2, error) + GetCaps func() ActionCapability + GetName func() string + GetWeight func() uint + Stream func(contentType string, reader io.Reader, filename string) (*ResultV2, error) + func NewActionChecksum(name string, digests []checksum.DigestAlgorithm, server *Server, ...) Action + func NewActionClamAV(clamav string, wsl bool, timeout time.Duration, server *Server, ...) Action + func NewActionExternal(name, address string, capability ActionCapability, ...) Action + func NewActionFFProbe(name string, ffprobe string, wsl bool, timeout time.Duration, online bool, ...) Action + func NewActionIdentify(name, identify, convert string, wsl bool, timeout time.Duration, online bool, ...) Action + func NewActionIdentifyV2(name, identify, convert string, wsl bool, timeout time.Duration, online bool, ...) Action + func NewActionNSRL(name string, nsrldb *badger.DB, server *Server, ad *ActionDispatcher) Action + func NewActionSiegfried(name string, signatureData []byte, mimeMap map[string]string, server *Server, ...) Action + func NewActionTika(name, uri string, timeout time.Duration, ...) Action + type ActionCapability uint + func (a *ActionCapability) UnmarshalText(text []byte) error + type ActionChecksum struct + func (as *ActionChecksum) CanHandle(contentType string, filename string) bool + func (as *ActionChecksum) Do(uri *url.URL, contentType string, width *uint, height *uint, ...) (interface{}, []string, []string, error) + func (as *ActionChecksum) DoV2(filename string) (*ResultV2, error) + func (as *ActionChecksum) GetCaps() ActionCapability + func (as *ActionChecksum) GetName() string + func (as *ActionChecksum) GetWeight() uint + func (as *ActionChecksum) Stream(contentType string, reader io.Reader, filename string) (*ResultV2, error) + type ActionClamAV struct + func (ac *ActionClamAV) CanHandle(contentType string, filename string) bool + func (ac *ActionClamAV) Do(uri *url.URL, contentType string, width *uint, height *uint, ...) (interface{}, []string, []string, error) + func (ac *ActionClamAV) DoV2(filename string) (*ResultV2, error) + func (ac *ActionClamAV) GetCaps() ActionCapability + func (ac *ActionClamAV) GetName() string + func (ac *ActionClamAV) GetWeight() uint + func (ac *ActionClamAV) Stream(contentType string, reader io.Reader, filename string) (*ResultV2, error) + type ActionDispatcher struct + func InitActionDispatcher(fss map[string]fs.FS, conf IndexerConfig, logger *logging.Logger) (*ActionDispatcher, error) + func NewActionDispatcher(mimeRelevance map[int]MimeWeightString) *ActionDispatcher + func (ad *ActionDispatcher) DoV2(filename string, stateFiles []string, actions []string) (*ResultV2, error) + func (ad *ActionDispatcher) GetAction(name string) (Action, bool) + func (ad *ActionDispatcher) GetActionNames() []string + func (ad *ActionDispatcher) GetActionNamesByCaps(caps ActionCapability) []string + func (ad *ActionDispatcher) GetActions() map[string]Action + func (ad *ActionDispatcher) RegisterAction(action Action) + func (ad *ActionDispatcher) Sort(actions []string) + func (ad *ActionDispatcher) Stream(sourceReader io.Reader, stateFiles []string, actions []string) (*ResultV2, error) + type ActionExternal struct + func (as *ActionExternal) CanHandle(contentType string, filename string) bool + func (as *ActionExternal) Do(uri *url.URL, contentType string, width *uint, height *uint, ...) (interface{}, []string, []string, error) + func (as *ActionExternal) DoV2(filename string) (*ResultV2, error) + func (as *ActionExternal) GetCaps() ActionCapability + func (as *ActionExternal) GetName() string + func (as *ActionExternal) GetWeight() uint + func (as *ActionExternal) Stream(contentType string, reader io.Reader, filename string) (*ResultV2, error) + type ActionFFProbe struct + func (as *ActionFFProbe) CanHandle(contentType string, filename string) bool + func (as *ActionFFProbe) Do(uri *url.URL, contentType string, width *uint, height *uint, ...) (interface{}, []string, []string, error) + func (as *ActionFFProbe) DoV2(filename string) (*ResultV2, error) + func (as *ActionFFProbe) GetCaps() ActionCapability + func (as *ActionFFProbe) GetName() string + func (as *ActionFFProbe) GetWeight() uint + func (as *ActionFFProbe) Stream(contentType string, reader io.Reader, filename string) (*ResultV2, error) + type ActionIdentify struct + func (ai *ActionIdentify) CanHandle(contentType string, filename string) bool + func (ai *ActionIdentify) Do(uri *url.URL, contentType string, width *uint, height *uint, ...) (interface{}, []string, []string, error) + func (ai *ActionIdentify) DoV2(filename string) (*ResultV2, error) + func (ai *ActionIdentify) GetCaps() ActionCapability + func (ai *ActionIdentify) GetName() string + func (ai *ActionIdentify) GetWeight() uint + func (ai *ActionIdentify) Stream(contentType string, reader io.Reader, filename string) (*ResultV2, error) + type ActionIdentifyV2 struct + func (ai *ActionIdentifyV2) CanHandle(contentType string, filename string) bool + func (ai *ActionIdentifyV2) Do(uri *url.URL, contentType string, width *uint, height *uint, ...) (interface{}, []string, []string, error) + func (ai *ActionIdentifyV2) DoV2(filename string) (*ResultV2, error) + func (ai *ActionIdentifyV2) GetCaps() ActionCapability + func (ai *ActionIdentifyV2) GetName() string + func (ai *ActionIdentifyV2) GetWeight() uint + func (ai *ActionIdentifyV2) Stream(contentType string, reader io.Reader, filename string) (*ResultV2, error) + type ActionNSRL struct + func (aNSRL *ActionNSRL) CanHandle(contentType string, filename string) bool + func (aNSRL *ActionNSRL) Do(uri *url.URL, contentType string, width *uint, height *uint, ...) (interface{}, []string, []string, error) + func (aNSRL *ActionNSRL) DoV2(filename string) (*ResultV2, error) + func (aNSRL *ActionNSRL) GetCaps() ActionCapability + func (aNSRL *ActionNSRL) GetName() string + func (aNSRL *ActionNSRL) GetWeight() uint + func (aNSRL *ActionNSRL) Stream(contentType string, reader io.Reader, filename string) (*ResultV2, error) + type ActionNSRLMeta struct + File map[string]string + FileMfG map[string]string + OS map[string]string + OSMfg map[string]string + Prod map[string]string + ProdMfg map[string]string + type ActionParam struct + Actions []string + Checksums map[string]string + ForceDownload string + HeaderSize int64 + Url string + type ActionSiegfried struct + func (as *ActionSiegfried) CanHandle(contentType string, filename string) bool + func (as *ActionSiegfried) Do(uri *url.URL, contentType string, width *uint, height *uint, ...) (interface{}, []string, []string, error) + func (as *ActionSiegfried) DoV2(filename string) (*ResultV2, error) + func (as *ActionSiegfried) GetCaps() ActionCapability + func (as *ActionSiegfried) GetName() string + func (as *ActionSiegfried) GetWeight() uint + func (as *ActionSiegfried) Stream(contentType string, reader io.Reader, filename string) (*ResultV2, error) + type ActionTika struct + func (at *ActionTika) CanHandle(contentType string, filename string) bool + func (at *ActionTika) Do(uri *url.URL, contentType string, width *uint, height *uint, ...) (interface{}, []string, []string, error) + func (at *ActionTika) DoV2(filename string) (*ResultV2, error) + func (at *ActionTika) GetCaps() ActionCapability + func (at *ActionTika) GetName() string + func (at *ActionTika) GetWeight() uint + func (at *ActionTika) Stream(contentType string, reader io.Reader, filename string) (*ResultV2, error) + type Chromaticity struct + X float64 + Y float64 + type ConfigChecksum struct + Digest []checksum.DigestAlgorithm + Enabled bool + Name string + type ConfigClamAV struct + ClamScan string + Enabled bool + Timeout duration + Wsl bool + type ConfigExternalAction struct + ActionCapabilities []ActionCapability + Address string + CallType ExternalActionCalltype + Mimetype string + Name string + type ConfigFFMPEG struct + Enabled bool + FFProbe string + Mime []FFMPEGMime + Online bool + Timeout duration + Wsl bool + type ConfigFileMap struct + Alias string + Folder string + type ConfigImageMagick struct + Convert string + Enabled bool + Identify string + Online bool + Timeout duration + Wsl bool + type ConfigMimeWeight struct + Regexp string + Weight int + type ConfigNSRL struct + Badger string + Enabled bool + type ConfigSFTP struct + Knownhosts string + Password string + PrivateKey []string + type ConfigSiegfried struct + Enabled bool + MimeMap map[string]string + SignatureFile string + type ConfigTika struct + AddressFulltext string + AddressMeta string + Enabled bool + Online bool + RegexpMimeFulltext string + RegexpMimeFulltextNot string + RegexpMimeMeta string + RegexpMimeMetaNot string + Timeout duration + type DataType string + const Byte + const Long + const Short + const String + type Endian string + const LSB + const MSB + type ExternalActionCalltype uint + const EACTJSONPOST + const EACTURL + func (a *ExternalActionCalltype) UnmarshalText(text []byte) error + type FFMPEGMime struct + Audio bool + Format string + Mime string + Video bool + type FileMapper struct + func NewFileMapper(mapping map[string]string) *FileMapper + func (fm *FileMapper) Get(uri *url.URL) (string, error) + type FullMagickResult struct + Frames []*Geometry + Magick *MagickResult + type Geometry struct + Height float64 + Width float64 + X float64 + Y float64 + type IndexerConfig struct + Checksum ConfigChecksum + Clamav ConfigClamAV + DownloadMime string + Enabled bool + External []ConfigExternalAction + FFMPEG ConfigFFMPEG + FileMap []ConfigFileMap + HeaderSize int64 + HeaderTimeout duration + ImageMagick ConfigImageMagick + LocalCache bool + MaxDownloadSize int64 + MimeRelevance map[string]ConfigMimeWeight + NSRL ConfigNSRL + Siegfried ConfigSiegfried + TempDir string + Tika ConfigTika + URLRegexp []string + func GetDefaultConfig() *IndexerConfig + type MIME struct + Acronym *string + DataType *DataType + Description *string + Endian *Endian + Magic *string + Mask *string + Offset *string + Pattern *string + Priority *string + Type string + func GetMagickMime() ([]MIME, error) + type MagickImage struct + BackgroundColor string + BaseDepth int + BaseName string + BaseType string + BorderColor string + ChannelDepth map[string]int + ChannelStatistics map[string]*Statistics + Chromaticity map[string]*Chromaticity + Class string + Colorspace string + Compose string + Compression string + Depth int + Dispose string + ElapsedTime string + Endianness string + Filesize string + Format string + FormatDescription string + Gamma float64 + Geometry *Geometry + ImageStatistics map[string]*Statistics + Intensity string + Interlace string + Iterations int + MatteColor string + MimeType string + Name string + NumberPixels string + Orientation string + PageGeometry *Geometry + Permissions int + Pixels int + PixelsPerSecond string + PrintSize *Size + Profiles map[string]any + Properties map[string]any + Quality float64 + RenderingIntent string + Resolution *Size + Tainted bool + TransparentColor string + Type string + Units string + UserTime string + Version string + type MagickResult struct + Image *MagickImage + Version string + type MimeBase struct + Mimemap Mimemap + type MimeWeight struct + type MimeWeightString struct + Regexp string + Weight int + type Mimemap struct + MIME []MIME + type ResultV2 struct + Checksum map[string]string + Duration uint + Errors map[string]string + Height uint + Metadata map[string]any + Mimetype string + Mimetypes []string + Pronom string + Pronoms []string + Size uint64 + Subtype string + Type string + Width uint + func NewResultV2() *ResultV2 + func (v *ResultV2) Merge(r *ResultV2) + type SFTP struct + func NewSFTP(PrivateKey []string, Password, KnownHosts string, log *logging.Logger) (*SFTP, error) + func (s *SFTP) Get(uri url.URL, w io.Writer) (int64, error) + func (s *SFTP) GetConnection(address, user string) (*SSHConnection, error) + func (s *SFTP) GetFile(uri url.URL, user string, target string) (int64, error) + func (s *SFTP) Put(uri url.URL, user string, r io.Reader) (int64, error) + func (s *SFTP) PutFile(uri url.URL, user string, source string) (int64, error) + type SSHConnection struct + func NewSSHConnection(address, user string, config *ssh.ClientConfig, log *logging.Logger) (*SSHConnection, error) + func (sc *SSHConnection) Close() + func (sc *SSHConnection) Connect() error + func (sc *SSHConnection) GetSFTPClient() (*sftp.Client, error) + func (sc *SSHConnection) ReadFile(path string, w io.Writer) (int64, error) + func (sc *SSHConnection) WriteFile(path string, r io.Reader) (int64, error) + type SSHConnectionPool struct + func NewSSHConnectionPool(log *logging.Logger) *SSHConnectionPool + func (cp *SSHConnectionPool) GetConnection(address, user string, config *ssh.ClientConfig) (*SSHConnection, error) + type Server struct + func NewServer(headerTimeout time.Duration, headerSize int64, downloadMime string, ...) (*Server, error) + func (s *Server) AddActions(as ...Action) + func (s *Server) DoPanic(writer http.ResponseWriter, status int, message string) (err error) + func (s *Server) DoPanicf(writer http.ResponseWriter, status int, message string, a ...interface{}) (err error) + func (s *Server) HandleDefault(w http.ResponseWriter, r *http.Request) + func (s *Server) HandleVersion(w http.ResponseWriter, r *http.Request) + func (s *Server) ListenAndServe(addr, cert, key string) error + func (s *Server) MimeRelevance(mimetype string) (relevance int) + func (s *Server) Shutdown(ctx context.Context) error + type Size struct + X float64 + Y float64 + type Statistics struct + Entropy float64 + Kurtosis float64 + Max float64 + Mean float64 + Median float64 + Min float64 + Skewness float64 + StandardDeviation float64 v2.0.0-beta.6 Oct 13, 2023 v2.0.0-beta.5 Oct 13, 2023