util

package
v2.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package util Copyright 2021 Juergen Enge, info-age GmbH, Basel. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Siegfried     *ConfigSiegfried
	FFMPEG        *ConfigFFMPEG
	ImageMagick   *ConfigImageMagick
	Tika          *ConfigTika
	External      []ExternalAction
	FileMap       []FileMap
	URLRegexp     []string
	XML           indexer.ConfigXML
	NSRL          *ConfigNSRL
	Clamav        *ConfigClamAV
	MimeRelevance map[string]MimeWeight
}

func LoadConfig

func LoadConfig(tomlBytes []byte) (*Config, error)

type ConfigClamAV

type ConfigClamAV struct {
	Enabled  bool
	Timeout  duration
	ClamScan string
	Wsl      bool
}

type ConfigFFMPEG

type ConfigFFMPEG struct {
	FFProbe string
	Wsl     bool
	Timeout duration
	Online  bool
	Enabled bool
	Mime    []indexer.FFMPEGMime
}

type ConfigImageMagick

type ConfigImageMagick struct {
	Identify string
	Convert  string
	Wsl      bool
	Timeout  duration
	Online   bool
	Enabled  bool
}

type ConfigNSRL

type ConfigNSRL struct {
	Enabled bool
	Badger  string
}

type ConfigSiegfried

type ConfigSiegfried struct {
	//Address string
	Enabled       bool
	SignatureFile string
	MimeMap       map[string]string
}

type ConfigTika

type ConfigTika struct {
	Timeout               duration
	AddressMeta           string
	RegexpMimeMeta        string
	RegexpMimeNotMeta     string
	AddressFulltext       string
	RegexpMimeFulltext    string
	RegexpMimeNotFulltext string
	Online                bool
	Enabled               bool
}

type ExternalAction

type ExternalAction struct {
	Name,
	Address,
	Mimetype string
	ActionCapabilities []indexer.ActionCapability
	CallType           indexer.ExternalActionCalltype
}

type FileMap

type FileMap struct {
	Alias  string
	Folder string
}

type Indexer

type Indexer indexer.ActionDispatcher

func InitIndexer

func InitIndexer(conf *Config, logger zLogger.ZWrapper) (ad *Indexer, err error)

InitIndexer initializes an ActionDispatcher with Siegfried, ImageMagick, FFPMEG and Tika the actions are named "siegfried", "identify", "ffprobe", "tika" and "fulltext"

func (*Indexer) Index

func (idx *Indexer) Index(fsys fs.FS, path string, realname string, actions []string, digestAlgs []checksum.DigestAlgorithm, writer io.Writer, logger zLogger.ZWrapper) (*indexer.ResultV2, map[checksum.DigestAlgorithm]string, error)

type MimeWeight

type MimeWeight struct {
	Regexp string
	Weight int
}

Jump to

Keyboard shortcuts

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