blob

package
v0.0.0-...-5564d8a Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const IndexVersion = 0x01

Variables

This section is empty.

Functions

This section is empty.

Types

type Blob

type Blob struct {
	Cid      cid.Cid                `json:"-"`
	Size     int                    `json:"size"`
	Mime     string                 `json:"mime"`
	Image    *image.ImageProperties `json:"image"`
	Data     []byte                 `json:"-"`
	Source   BlobSource             `json:"source"`
	Variants []BlobVariant          `json:"variants"`
	Time     string                 `json:"time"`
	Version  uint8                  `json:"version"`
}

func Get

func Get(dir string, did string, cidStr string) (Blob, error)

func (Blob) FilePath

func (b Blob) FilePath(dir string) string

func (*Blob) Output

func (b *Blob) Output(dir string, of *string, ofc *OutputFormatOptions) (BlobOutput, error)

type BlobOutput

type BlobOutput struct {
	Data        []byte
	ContentType string
}

func (*BlobOutput) Body

func (bo *BlobOutput) Body() []byte

type BlobSource

type BlobSource struct {
	Pds  string `json:"pds"`
	Did  string `json:"did"`
	Url  string `json:"url"`
	Mime string `json:"mime"`
}

type BlobVariant

type BlobVariant struct {
	Size  int                    `json:"size"`
	Mime  string                 `json:"mime"`
	Image *image.ImageProperties `json:"image"`
	Time  string                 `json:"time"`
}

type OutputFormatOptions

type OutputFormatOptions struct {
	Width  int
	Height int
}

Jump to

Keyboard shortcuts

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