Documentation ¶
Overview ¶
Copyright 2020 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.
Copyright 2020 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.
Copyright 2020 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.
Package indexer Copyright 2020 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.
Package indexer Copyright 2020 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.
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.
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.
Copyright 2020 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.
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.
Copyright 2020 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.
Package indexer Copyright 2020 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.
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.
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.
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
- Variables
- 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
- 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, signatureFile string, mimeMap map[string]string, server *Server, ...) Action
- func NewActionTika(name, uri string, timeout time.Duration, ...) Action
- type ActionCapability
- type ActionClamAV
- 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) 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
- 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(reader io.Reader, filename string) (*ResultV2, error)
- type ActionExternal
- 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) 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
- 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) 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
- 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) 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
- 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) 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
- 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) 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
- type ActionParam
- type ActionSiegfried
- 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) 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
- 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) 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
- type DataType
- type Endian
- type ExternalActionCalltype
- type FFMPEGMime
- type FileMapper
- type FullMagickResult
- type Geometry
- type MIME
- type MagickImage
- type MagickResult
- type MimeBase
- type MimeWeight
- type MimeWeightString
- type Mimemap
- type ResultV2
- type SFTP
- 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
- type SSHConnectionPool
- type Server
- 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
- type Statistics
Constants ¶
const ( ACTFILE ActionCapability = 1 << iota // needs local file ACTHTTP // capable of HTTP ACTHTTPS // capable of HTTPS ACTHEAD // can deal with file head ACTSTREAM // can deal with stream ACTWEB = ACTHTTPS | ACTHTTP ACTALLPROTO = ACTFILE | ACTHTTP | ACTHTTPS ACTALL = ACTALLPROTO | ACTHEAD ACTFILEHEAD = ACTFILE | ACTHEAD ACTFILEFULL = ACTFILE & ^ACTHEAD )
const NSRL_File = "SHA-1-"
const NSRL_MFG = "MFgCode-"
const NSRL_OS = "OpSystemCode-"
const NSRL_PROD = "ProductCode-"
Variables ¶
var ACTAction map[string]ActionCapability = map[string]ActionCapability{ "ACTFILE": ACTFILE, "ACTHTTP": ACTHTTP, "ACTHTTPS": ACTHTTPS, "ACTHEAD": ACTHEAD, "ACTSTREAM": ACTSTREAM, }
var ACTString map[ActionCapability]string = map[ActionCapability]string{ ACTFILE: "ACTFILE", ACTHTTP: "ACTHTTP", ACTHTTPS: "ACTHTTPS", ACTHEAD: "ACTHEAD", ACTSTREAM: "ACTSTREAM", }
var EACTAction map[string]ExternalActionCalltype = map[string]ExternalActionCalltype{ "EACTURL": EACTURL, "EACTJSONPOST": EACTJSONPOST, }
var EACTString map[ExternalActionCalltype]string = map[ExternalActionCalltype]string{ EACTURL: "EACTURL", EACTJSONPOST: "EACTJSONPOST", }
var ErrMimeNotApplicable = errors.New("mime type not applicable for actions")
Functions ¶
func CreateLogger ¶
func FileExists ¶
Types ¶
type Action ¶
type Action interface { Stream(contentType string, reader io.Reader, filename string) (*ResultV2, error) CanHandle(contentType string, filename string) bool Do(uri *url.URL, contentType string, width *uint, height *uint, duration *time.Duration, checksums map[string]string) (interface{}, []string, []string, error) GetName() string GetCaps() ActionCapability GetWeight() uint }
func NewActionClamAV ¶
func NewActionExternal ¶
func NewActionExternal(name, address string, capability ActionCapability, callType ExternalActionCalltype, mimetype string, server *Server, ad *ActionDispatcher) Action
func NewActionFFProbe ¶
func NewActionFFProbe(name string, ffprobe string, wsl bool, timeout time.Duration, online bool, mime []FFMPEGMime, server *Server, ad *ActionDispatcher) Action
func NewActionIdentify ¶
func NewActionIdentifyV2 ¶
func NewActionNSRL ¶
func NewActionSiegfried ¶
func NewActionTika ¶
type ActionCapability ¶
type ActionCapability uint
func (*ActionCapability) UnmarshalText ¶
func (a *ActionCapability) UnmarshalText(text []byte) error
for toml decoding
type ActionClamAV ¶
type ActionClamAV struct {
// contains filtered or unexported fields
}
func (*ActionClamAV) CanHandle ¶
func (ac *ActionClamAV) CanHandle(contentType string, filename string) bool
func (*ActionClamAV) GetCaps ¶
func (ac *ActionClamAV) GetCaps() ActionCapability
func (*ActionClamAV) GetName ¶
func (ac *ActionClamAV) GetName() string
func (*ActionClamAV) GetWeight ¶
func (ac *ActionClamAV) GetWeight() uint
type ActionDispatcher ¶
type ActionDispatcher struct {
// contains filtered or unexported fields
}
func NewActionDispatcher ¶
func NewActionDispatcher(mimeRelevance map[int]MimeWeightString) *ActionDispatcher
func (*ActionDispatcher) GetAction ¶
func (ad *ActionDispatcher) GetAction(name string) (Action, bool)
func (*ActionDispatcher) GetActionNames ¶
func (ad *ActionDispatcher) GetActionNames() []string
func (*ActionDispatcher) GetActionNamesByCaps ¶
func (ad *ActionDispatcher) GetActionNamesByCaps(caps ActionCapability) []string
func (*ActionDispatcher) GetActions ¶
func (ad *ActionDispatcher) GetActions() map[string]Action
func (*ActionDispatcher) RegisterAction ¶
func (ad *ActionDispatcher) RegisterAction(action Action)
func (*ActionDispatcher) Sort ¶
func (ad *ActionDispatcher) Sort(actions []string)
type ActionExternal ¶
type ActionExternal struct {
// contains filtered or unexported fields
}
func (*ActionExternal) CanHandle ¶
func (as *ActionExternal) CanHandle(contentType string, filename string) bool
func (*ActionExternal) GetCaps ¶
func (as *ActionExternal) GetCaps() ActionCapability
func (*ActionExternal) GetName ¶
func (as *ActionExternal) GetName() string
func (*ActionExternal) GetWeight ¶
func (as *ActionExternal) GetWeight() uint
type ActionFFProbe ¶
type ActionFFProbe struct {
// contains filtered or unexported fields
}
func (*ActionFFProbe) CanHandle ¶
func (as *ActionFFProbe) CanHandle(contentType string, filename string) bool
func (*ActionFFProbe) GetCaps ¶
func (as *ActionFFProbe) GetCaps() ActionCapability
func (*ActionFFProbe) GetName ¶
func (as *ActionFFProbe) GetName() string
func (*ActionFFProbe) GetWeight ¶
func (as *ActionFFProbe) GetWeight() uint
type ActionIdentify ¶
type ActionIdentify struct {
// contains filtered or unexported fields
}
func (*ActionIdentify) CanHandle ¶
func (ai *ActionIdentify) CanHandle(contentType string, filename string) bool
func (*ActionIdentify) GetCaps ¶
func (ai *ActionIdentify) GetCaps() ActionCapability
func (*ActionIdentify) GetName ¶
func (ai *ActionIdentify) GetName() string
func (*ActionIdentify) GetWeight ¶
func (ai *ActionIdentify) GetWeight() uint
type ActionIdentifyV2 ¶
type ActionIdentifyV2 struct {
// contains filtered or unexported fields
}
func (*ActionIdentifyV2) CanHandle ¶
func (ai *ActionIdentifyV2) CanHandle(contentType string, filename string) bool
func (*ActionIdentifyV2) GetCaps ¶
func (ai *ActionIdentifyV2) GetCaps() ActionCapability
func (*ActionIdentifyV2) GetName ¶
func (ai *ActionIdentifyV2) GetName() string
func (*ActionIdentifyV2) GetWeight ¶
func (ai *ActionIdentifyV2) GetWeight() uint
type ActionNSRL ¶
type ActionNSRL struct {
// contains filtered or unexported fields
}
func (*ActionNSRL) CanHandle ¶
func (aNSRL *ActionNSRL) CanHandle(contentType string, filename string) bool
func (*ActionNSRL) GetCaps ¶
func (aNSRL *ActionNSRL) GetCaps() ActionCapability
func (*ActionNSRL) GetName ¶
func (aNSRL *ActionNSRL) GetName() string
func (*ActionNSRL) GetWeight ¶
func (aNSRL *ActionNSRL) GetWeight() uint
type ActionNSRLMeta ¶
type ActionParam ¶
type ActionSiegfried ¶
type ActionSiegfried struct {
// contains filtered or unexported fields
}
func (*ActionSiegfried) CanHandle ¶
func (as *ActionSiegfried) CanHandle(contentType string, filename string) bool
func (*ActionSiegfried) GetCaps ¶
func (as *ActionSiegfried) GetCaps() ActionCapability
func (*ActionSiegfried) GetName ¶
func (as *ActionSiegfried) GetName() string
func (*ActionSiegfried) GetWeight ¶
func (as *ActionSiegfried) GetWeight() uint
type ActionTika ¶
type ActionTika struct {
// contains filtered or unexported fields
}
func (*ActionTika) CanHandle ¶
func (at *ActionTika) CanHandle(contentType string, filename string) bool
func (*ActionTika) GetCaps ¶
func (at *ActionTika) GetCaps() ActionCapability
func (*ActionTika) GetName ¶
func (at *ActionTika) GetName() string
func (*ActionTika) GetWeight ¶
func (at *ActionTika) GetWeight() uint
type Chromaticity ¶
type ExternalActionCalltype ¶
type ExternalActionCalltype uint
const ( EACTURL ExternalActionCalltype = 1 << iota // url with placehoder for full path EACTJSONPOST // send json struct via post )
func (*ExternalActionCalltype) UnmarshalText ¶
func (a *ExternalActionCalltype) UnmarshalText(text []byte) error
for toml decoding
type FileMapper ¶
type FileMapper struct {
// contains filtered or unexported fields
}
func NewFileMapper ¶
func NewFileMapper(mapping map[string]string) *FileMapper
type FullMagickResult ¶
type FullMagickResult struct { Magick *MagickResult `json:"magick"` Frames []*Geometry `json:"frames,omitempty"` }
type MIME ¶
type MIME struct { Type string `json:"_type" xml:"type,attr"` Acronym *string `json:"_acronym,omitempty" xml:"acronym,attr,omitempty"` Description *string `json:"_description,omitempty" xml:"description,attr,omitempty"` Priority *string `json:"_priority,omitempty" xml:"priority,attr,omitempty"` Pattern *string `json:"_pattern,omitempty" xml:"pattern,attr,omitempty"` DataType *DataType `json:"_data-type,omitempty" xml:"data-type,attr,omitempty"` Offset *string `json:"_offset,omitempty" xml:"offset,attr,omitempty"` Magic *string `json:"_magic,omitempty" xml:"magic,attr,omitempty"` Endian *Endian `json:"_endian,omitempty" xml:"endian,attr,omitempty"` Mask *string `json:"_mask,omitempty" xml:"mask,attr,omitempty"` }
func GetMagickMime ¶
type MagickImage ¶
type MagickImage struct { Name string `json:"name,omitempty"` BaseName string `json:"baseName,omitempty"` Permissions int `json:"permissions,omitempty"` Format string `json:"format,omitempty"` FormatDescription string `json:"formatDescription,omitempty"` MimeType string `json:"mimeType,omitempty"` Class string `json:"class,omitempty"` Geometry *Geometry `json:"geometry,omitempty"` Resolution *Size `json:"resolution,omitempty"` PrintSize *Size `json:"printSize,omitempty"` Units string `json:"units,omitempty"` Type string `json:"type,omitempty"` BaseType string `json:"baseType,omitempty"` Endianness string `json:"endianness,omitempty"` Colorspace string `json:"colorspace,omitempty"` Depth int `json:"depth,omitempty"` BaseDepth int `json:"baseDepth,omitempty"` ChannelDepth map[string]int `json:"channelDepth,omitempty"` Pixels int `json:"pixels,omitempty"` ImageStatistics map[string]*Statistics `json:"imageStatistics,omitempty"` ChannelStatistics map[string]*Statistics `json:"channelStatistics,omitempty"` RenderingIntent string `json:"renderingIntent,omitempty"` Gamma float64 `json:"gamma,omitempty"` Chromaticity map[string]*Chromaticity `json:"chromaticity,omitempty"` MatteColor string `json:"matteColor,omitempty"` BackgroundColor string `json:"backgroundColor,omitempty"` BorderColor string `json:"borderColor,omitempty"` TransparentColor string `json:"transparentColor,omitempty"` Interlace string `json:"interlace,omitempty"` Intensity string `json:"intensity,omitempty"` Compose string `json:"compose,omitempty"` PageGeometry *Geometry `json:"pageGeometry,omitempty"` Dispose string `json:"dispose,omitempty"` Iterations int `json:"iterations,omitempty"` Compression string `json:"compression,omitempty"` Quality float64 `json:"quality,omitempty"` Orientation string `json:"orientation,omitempty"` Properties map[string]any `json:"properties,omitempty"` Profiles map[string]any `json:"profiles,omitempty"` Tainted bool `json:"tainted,omitempty"` Filesize string `json:"filesize,omitempty"` NumberPixels string `json:"numberPixels,omitempty"` PixelsPerSecond string `json:"pixelsPerSecond,omitempty"` UserTime string `json:"userTime,omitempty"` ElapsedTime string `json:"elapsedTime,omitempty"` Version string `json:"version,omitempty"` }
type MagickResult ¶
type MagickResult struct { Version string `json:"version"` Image *MagickImage `json:"image"` }
type MimeWeight ¶
type MimeWeight struct {
// contains filtered or unexported fields
}
type MimeWeightString ¶
type ResultV2 ¶
type ResultV2 struct { Errors map[string]string `json:"errors,omitempty"` Mimetype string `json:"mimetype"` Mimetypes []string `json:"mimetypes"` Pronom string `json:"pronom"` Pronoms []string `json:"pronoms"` Width uint `json:"width,omitempty"` Height uint `json:"height,omitempty"` Duration uint `json:"duration,omitempty"` Size uint64 `json:"size"` Metadata map[string]any `json:"metadata"` }
func NewResultV2 ¶
func NewResultV2() *ResultV2
type SFTP ¶
type SFTP struct {
// contains filtered or unexported fields
}
func (*SFTP) GetConnection ¶
func (s *SFTP) GetConnection(address, user string) (*SSHConnection, error)
type SSHConnection ¶
type SSHConnection struct {
// contains filtered or unexported fields
}
func NewSSHConnection ¶
func NewSSHConnection(address, user string, config *ssh.ClientConfig, log *logging.Logger) (*SSHConnection, error)
func (*SSHConnection) Close ¶
func (sc *SSHConnection) Close()
func (*SSHConnection) Connect ¶
func (sc *SSHConnection) Connect() error
func (*SSHConnection) GetSFTPClient ¶
func (sc *SSHConnection) GetSFTPClient() (*sftp.Client, error)
type SSHConnectionPool ¶
type SSHConnectionPool struct {
// contains filtered or unexported fields
}
func NewSSHConnectionPool ¶
func NewSSHConnectionPool(log *logging.Logger) *SSHConnectionPool
func (*SSHConnectionPool) GetConnection ¶
func (cp *SSHConnectionPool) GetConnection(address, user string, config *ssh.ClientConfig) (*SSHConnection, error)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer( headerTimeout time.Duration, headerSize int64, downloadMime string, maxDownloadSize int64, mimeRelevance map[int]MimeWeightString, jwtSecret string, jwtAlg []string, insecureCert bool, log *logging.Logger, accesslog io.Writer, errorTemplate *template.Template, tempDir string, fm *FileMapper, sftp *SFTP, ) (*Server, error)
func (*Server) AddActions ¶
func (*Server) HandleDefault ¶
func (s *Server) HandleDefault(w http.ResponseWriter, r *http.Request)
func (*Server) HandleVersion ¶
func (s *Server) HandleVersion(w http.ResponseWriter, r *http.Request)
func (*Server) ListenAndServe ¶
func (*Server) MimeRelevance ¶
holistic function to give some mimetypes a relevance
type Statistics ¶
type Statistics struct { Min float64 `json:"min,omitempty"` Max float64 `json:"max,omitempty"` Mean float64 `json:"mean,omitempty"` Median float64 `json:"median,omitempty"` StandardDeviation float64 `json:"standardDeviation,omitempty"` Kurtosis float64 `json:"kurtosis,omitempty"` Skewness float64 `json:"skewness,omitempty"` Entropy float64 `json:"entropy,omitempty"` }