image

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWrongType = errors.New("wrong image type")

ErrWrongType is returned from [Opener].

Functions

This section is empty.

Types

type Image

type Image interface {
	io.ReaderAt
	io.Closer
	Type() Type
	Size() int64 // -1 if unknown
	Readable() error
}

Image implements io.ReaderAt and io.Closer.

type ImageInfo

type ImageInfo struct {
	Type  Type  `json:"type"`
	Size  int64 `json:"size"`
	Image `json:"image"`
}

ImageInfo wraps Image for [json.Marshal].

func NewImageInfo

func NewImageInfo(img Image) *ImageInfo

NewImageInfo returns image info.

type OpenWithType

type OpenWithType func(io.ReaderAt, Type) (Image, error)

OpenWithType opens Image with the specified Type. Opener must return ErrWrongType when the image is not parsable with the specified Type.

type Type

type Type string

Type must be a "Backing file format name string" that appears in QCOW2.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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