sauce

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package sauce parses SAUCE (Standard Architecture for Universal Comment Extensions) metadata. http://www.acid.org/info/sauce/sauce.htm

Index

Constants

This section is empty.

Variables

View Source
var ErrDate = errors.New("parse date to integer conversion")

Functions

func Scan

func Scan(b ...byte) (index int)

Scan returns the position of the SAUCE00 ID or -1 if no ID exists.

Types

type ANSIFlagAR added in v0.0.31

type ANSIFlagAR struct {
	Flag arBit  `json:"flag" xml:"flag"`
	Info string `json:"interpretation" xml:"interpretation,attr"`
}

ANSIFlagAR is the interpretation of the SAUCE Flags aspect ratio binary bits.

type ANSIFlagB added in v0.0.31

type ANSIFlagB struct {
	Flag bBit   `json:"flag" xml:"flag"`
	Info string `json:"interpretation" xml:"interpretation,attr"`
}

ANSIFlagB is the interpretation of the SAUCE Flags non-blink mode binary bit.

type ANSIFlagLS added in v0.0.31

type ANSIFlagLS struct {
	Flag lsBit  `json:"flag" xml:"flag"`
	Info string `json:"interpretation" xml:"interpretation,attr"`
}

ANSIFlagLS is the interpretation of the SAUCE Flags letter spacing binary bits.

type ANSIFlags added in v0.0.31

type ANSIFlags struct {
	Decimal         Flags      `json:"decimal" xml:"decimal,attr"`
	Binary          string     `json:"binary" xml:"binary,attr"`
	B               ANSIFlagB  `json:"nonBlinkMode" xml:"non_blink_mode"`
	LS              ANSIFlagLS `json:"letterSpacing" xml:"letter_spacing"`
	AR              ANSIFlagAR `json:"aspectRatio" xml:"aspect_ratio"`
	Interpretations string     `json:"-" xml:"-"`
}

ANSIFlags are the interpretation of the SAUCE Flags field.

func (*ANSIFlags) String added in v0.0.31

func (a *ANSIFlags) String() string

type Archive added in v0.0.31

type Archive uint

Archive and compressed files.

func (Archive) String added in v0.0.31

func (a Archive) String() string

type Audio added in v0.0.31

type Audio uint

Audio or music files.

func (Audio) String added in v0.0.31

func (a Audio) String() string

type BinaryText added in v0.0.31

type BinaryText uint

BinaryText is a raw memory copy of a text mode screen.

func (BinaryText) String added in v0.0.31

func (b BinaryText) String() string

type Bitmap added in v0.0.31

type Bitmap uint

Bitmap graphic and animation files.

func (Bitmap) String added in v0.0.31

func (b Bitmap) String() string

type Character added in v0.0.31

type Character uint

Character based files more commonly referred as text files.

func (Character) Desc added in v0.0.31

func (c Character) Desc() string

Desc is the character description.

func (Character) String added in v0.0.31

func (c Character) String() string

type Comments added in v0.0.31

type Comments struct {
	ID      string   `json:"id" xml:"id,attr"`
	Count   int      `json:"count" xml:"count,attr"`
	Comment []string `json:"lines" xml:"line"`
}

Comments contain the optional SAUCE comment block.

type DataType added in v0.0.31

type DataType uint

DataType is the data type (SAUCE DataType).

func (DataType) String added in v0.0.31

func (d DataType) String() string

type DataTypes added in v0.0.31

type DataTypes struct {
	Type DataType `json:"type" xml:"type"`
	Name string   `json:"name" xml:"name"`
}

DataTypes both the SAUCE DataType value and name.

type Dates added in v0.0.31

type Dates struct {
	Value string    `json:"value" xml:"value"`
	Time  time.Time `json:"iso" xml:"date"`
	Epoch int64     `json:"epoch" xml:"epoch,attr"`
}

Dates in multiple output formats.

type Executable added in v0.0.31

type Executable uint

Executable program files.

func (Executable) String added in v0.0.31

func (e Executable) String() string

type FileType added in v0.0.31

type FileType uint

FileType is the type of file (SAUCE FileType).

type FileTypes added in v0.0.31

type FileTypes struct {
	Type FileType `json:"type" xml:"type"`
	Name string   `json:"name" xml:"name"`
}

FileTypes, both the SAUCE FileType value and name.

type Flags added in v0.0.31

type Flags uint8

Flags is the SAUCE Flags field.

type Record

type Record struct {
	ID       string    `json:"id" xml:"id,attr"`
	Version  string    `json:"version" xml:"version,attr"`
	Title    string    `json:"title" xml:"title"`
	Author   string    `json:"author" xml:"author"`
	Group    string    `json:"group" xml:"group"`
	Date     Dates     `json:"date" xml:"date"`
	FileSize Sizes     `json:"filesize" xml:"filesize"`
	Data     DataTypes `json:"dataType"  xml:"data_type"`
	File     FileTypes `json:"fileType" xml:"file_type"`
	Info     TypeInfos `json:"typeInfo"  xml:"type_info"`
	Desc     string    `json:"-" xml:"-"`
	Comnt    Comments  `json:"comments" xml:"comments"`
}

Record is the container for SAUCE data.

func Parse added in v0.0.31

func Parse(data ...byte) Record

Parse and extract the record data.

type Sizes added in v0.0.31

type Sizes struct {
	Bytes   uint16 `json:"bytes" xml:"bytes"`
	Decimal string `json:"decimal" xml:"decimal,attr"`
	Binary  string `json:"binary" xml:"binary,attr"`
}

Sizes of the file data in multiples.

type TypeInfo added in v0.0.31

type TypeInfo struct {
	Value uint16 `json:"value" xml:"value"`
	Info  string `json:"info" xml:"info,attr"`
}

TypeInfo includes the SAUCE TInfo value and meaning.

type TypeInfos added in v0.0.31

type TypeInfos struct {
	Info1 TypeInfo  `json:"1" xml:"1"`
	Info2 TypeInfo  `json:"2" xml:"2"`
	Info3 TypeInfo  `json:"3" xml:"3"`
	Flags ANSIFlags `json:"flags" xml:"flags"`
	Font  string    `json:"fontName" xml:"fontname"`
}

TypeInfos includes the SAUCE fields dependant on both DataType and FileType.

type Vector added in v0.0.31

type Vector uint

Vector graphic files.

func (Vector) String added in v0.0.31

func (v Vector) String() string

type XBin added in v0.0.31

type XBin uint

XBin or eXtended BinaryText files.

func (XBin) String added in v0.0.31

func (x XBin) String() string

Jump to

Keyboard shortcuts

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