omnitrail

package module
v0.0.0-...-37d34c2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

README

omnitrail-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatADGString

func FormatADGString(mapping Factory) string

Types

type DirectoryPlugin

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

func (*DirectoryPlugin) Add

func (plug *DirectoryPlugin) Add(path string) error

func (*DirectoryPlugin) Sha1ADG

func (plug *DirectoryPlugin) Sha1ADG(m map[string]string)

func (*DirectoryPlugin) Sha256ADG

func (plug *DirectoryPlugin) Sha256ADG(m map[string]string)

func (*DirectoryPlugin) Store

func (plug *DirectoryPlugin) Store(envelope *Envelope) error

type Element

type Element struct {
	Type         string `json:"type"`
	Sha1         string `json:"sha1,omitempty"`
	Sha256       string `json:"sha256,omitempty"`
	Sha1Gitoid   string `json:"gitoid:sha1,omitempty"`
	Sha256Gitoid string `json:"gitoid:sha256,omitempty"`
	Posix        *Posix `json:"posix,omitempty"`
}

type Envelope

type Envelope struct {
	Header  Header              `json:"header"`
	Mapping map[string]*Element `json:"mapping"`
}

type Factory

type Factory interface {
	Add(originalPath string) error
	Sha1ADGs() map[string]string
	Sha256ADGs() map[string]string
	Envelope() *Envelope
}

func NewTrail

func NewTrail(option ...Option) Factory

type Feature

type Feature struct {
	Algorithms []string `json:"algorithms,omitempty"`
}

type FilePlugin

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

func (*FilePlugin) Add

func (plug *FilePlugin) Add(filePath string) error

func (*FilePlugin) Sha1ADG

func (plug *FilePlugin) Sha1ADG(m map[string]string)

func (*FilePlugin) Sha256ADG

func (plug *FilePlugin) Sha256ADG(m map[string]string)

func (*FilePlugin) Store

func (plug *FilePlugin) Store(envelope *Envelope) error
type Header struct {
	Features map[string]Feature `json:"features"`
}

type Option

type Option func(o *Options)

type Options

type Options struct {
	Sha1Enabled   bool
	Sha256Enabled bool
}

type Plugin

type Plugin interface {
	Add(path string) error
	Store(envelope *Envelope) error
	Sha1ADG(map[string]string)
	Sha256ADG(map[string]string)
}

func NewDirectoryPlugin

func NewDirectoryPlugin() Plugin

func NewFilePlugin

func NewFilePlugin() Plugin

func NewPosixPlugin

func NewPosixPlugin() Plugin

type Posix

type Posix struct {
	ATime              string `json:"atime,omitempty"`
	CTime              string `json:"ctime,omitempty"`
	CreationTime       string `json:"creation_time,omitempty"`
	ExtendedAttributes string `json:"extended_attributes,omitempty"`
	FileDeviceID       string `json:"file_device_id,omitempty"`
	FileFlags          string `json:"file_flags,omitempty"`
	FileInode          string `json:"file_inode,omitempty"`
	FileSystemID       string `json:"file_system_id,omitempty"`
	FileType           string `json:"file_type,omitempty"`
	HardLinkCount      string `json:"hard_link_count,omitempty"`
	MTime              string `json:"mtime,omitempty"`
	MetadataCTime      string `json:"metadata_ctime,omitempty"`
	OwnerGID           string `json:"owner_gid,omitempty"`
	OwnerUID           string `json:"owner_uid,omitempty"`
	Permissions        string `json:"permissions,omitempty"`
	Size               string `json:"size,omitempty"`
}

type PosixPlugin

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

func (*PosixPlugin) Add

func (p *PosixPlugin) Add(path string) error

func (*PosixPlugin) Sha1ADG

func (p *PosixPlugin) Sha1ADG(_ map[string]string)

func (*PosixPlugin) Sha256ADG

func (p *PosixPlugin) Sha256ADG(_ map[string]string)

func (*PosixPlugin) Store

func (p *PosixPlugin) Store(envelope *Envelope) error

Jump to

Keyboard shortcuts

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