fileinfo

package
v0.0.0-...-5e8511f Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunFileInfoProvider

func RunFileInfoProvider(fileinfo types.FileInfoProvider, filename string, data []byte, tb testing.TB, expect []byte)

func RunFileInfoProviderFromFile

func RunFileInfoProviderFromFile(fileinfo types.FileInfoProvider, filename string, tb testing.TB, expect []byte)

Types

type Config

type Config struct {
	MimeProvider string   `yaml:"mime_provider"`
	Providers    []string `yaml:"providers"`
}

func (*Config) CreateProvider

func (c *Config) CreateProvider(pManager *plugin.Manager, prom *prometheus.Manager) (*Manager, error)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(pManager *plugin.Manager, prom *prometheus.Manager, mimetypeProvider string, provider ...string) (*Manager, error)

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) FileInfo

func (m *Manager) FileInfo(filename string, file storage.File, opts *Options, requestedProviders ...string) (*Output, error)

type Options

type Options struct {
	Render bool
}

type Output

type Output struct {
	Channel  <-chan types.Result `json:"-"`
	MimeType types.MimeType      `json:"mime"`
	Filename string              `json:"filename"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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