report

package
v2.0.0-...-0b83eb9 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StaticFS embed.FS
View Source
var TemplateFS embed.FS

Functions

func FormatInt

func FormatInt(n int64, groupSize int, grouping byte) string

FormatInt formats an integer with grouping decimals, in decimal radix. Grouping signs are inserted after every groupSize digits, starting from the right. A groupingSize less than 1 will default to 3. Only ASCII grouping decimal signs are supported which may be provided with grouping.

For details, see https://github.com/icza/gox For details, see https://stackoverflow.com/a/31046325/1705598

func StructToMap

func StructToMap(value interface{}) map[string][]interface{}

Types

type BagitOverview

type BagitOverview struct {
	BagitID            int64
	Name               string
	Size               int64
	Creator            string
	SHA512, SHA512_AES string
	CreationDate       time.Time
	HealthOK           bool
	Quality            float64
	BagInfo            string
	Checks             []*BagitOverviewCheck
	Files              []*BagitOverviewFile
	Ingest             []*BagitOverviewIngest
	Mimetypes          []*BagitOverviewMime
	Content            []*Content
	Costs              float64
}

type BagitOverviewCheck

type BagitOverviewCheck struct {
	Name       string
	Test       string
	Location   string
	LocationID int64
	Start      time.Time
	Duration   time.Duration
	Status     string
	Message    string
}

type BagitOverviewFile

type BagitOverviewFile struct {
	Name                  string
	Size                  int64
	Mimetype              string
	Width, Height, Length int64
}

type BagitOverviewIngest

type BagitOverviewIngest struct {
	LocationID       int64
	Location         string
	TransferStart    time.Time
	TransferDuration time.Duration
	Status           string
	Message          string
	Encrypted        bool
	Quality          float64
	Costs            float64
}

type BagitOverviewMime

type BagitOverviewMime struct {
	Mimetype string
	Count    int64
	Size     int64
}

type Content

type Content struct {
	ContentID               int64
	ZipPath, DiskPath       string
	Filesize                int64
	Mimetype                string
	Checksums               map[string]string
	Width, Height, Duration int64
	Indexer                 Indexer
}

type Indexer

type Indexer struct {
	Duration  int64                             `json:"duration,omitempty"`
	Width     int64                             `json:"width,omitempty"`
	Height    int64                             `json:"height,omitempty"`
	Errors    map[string]string                 `json:"errors,omitempty"`
	Mimetype  string                            `json:"mimetype,omitempty"`
	NSRL      []indexer.ActionNSRLMeta          `json:"nsrl,omitempty"`
	Identify  map[string]interface{}            `json:"identify,omitempty"`
	FFProbe   ffmpeg_models.Metadata            `json:"ffprobe,omitempty"`
	Siegfried []siegfried_pronom.Identification `json:"siegfried,omitempty"`
	Tika      []map[string]interface{}          `json:"tika,omitempty"`
	Exif      map[string]interface{}            `json:"exif,omitempty"`
	Clamav    map[string]string                 `json:"clamav,omitempty"`
}

type Overview

type Overview struct {
	Size                   int64
	Files                  int64
	Status                 string
	Bagits                 []*OverviewBagit
	HealthOK, HealthFailed int64
}

type OverviewBagit

type OverviewBagit struct {
	BagitID            int64
	Size               int64
	Files              int64
	Name               string
	HealthOK           bool
	Quality            float64
	SHA512, SHA512_AES string
}

type Server

type Server struct {
	AddrExt string
	// contains filtered or unexported fields
}

func NewServer

func NewServer(service, addr, addrExt, name, password string,
	log *logging.Logger, accessLog io.Writer,
	stats *Statistics,
	staticFS, templateFS fs.FS,
	logo, institution string,
	dev bool) (*Server, error)

func (*Server) InitTemplates

func (s *Server) InitTemplates() error

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(cert, key string) (err error)

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

type Statistics

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

func NewStatistics

func NewStatistics(db *sql.DB, schema string, log *logging.Logger) (*Statistics, error)

func (*Statistics) BagitOverview

func (stat *Statistics) BagitOverview(id int64) (*BagitOverview, error)

func (*Statistics) Overview

func (stat *Statistics) Overview() (*Overview, error)

Jump to

Keyboard shortcuts

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