cli

package
v0.0.0-...-089d0a2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package cli provides functionalities to convert images from some format to another.

Index

Constants

View Source
const (
	ExitCodeOK             = 0
	ExitCodeParseFlagError = 1
	ExitCodeConvertError   = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	OutStream, ErrStream io.Writer
}

App consists of output/error streams.

func (*App) Run

func (a *App) Run(args []string) int

Run is the entry point to the cli. Parses the arguments slice and routes to the proper flag/args combination

type Decoder

type Decoder interface {
	Decode(r io.Reader) (image.Image, error)
}

A Decoder reads content from r and decodes it to image.

type DecoderFunc

type DecoderFunc func(r io.Reader) (image.Image, error)

The DecoderFunc type is an adapter to allow the use of ordinary functions as Image decoders. If f is a function with the appropriate signature, DecoderFunc(f) is a Decoder that calls f.

func (DecoderFunc) Decode

func (f DecoderFunc) Decode(r io.Reader) (image.Image, error)

type Encoder

type Encoder interface {
	Encode(w io.Writer, m image.Image) error
}

A Encoder writes image to w.

type EncoderFunc

type EncoderFunc func(w io.Writer, m image.Image) error

The EncoderFunc type is an adapter to allow the use of ordinary functions as Image encoders. If f is a function with the appropriate signature, EncoderFunc(f) is a Encoder that calls f.

func (EncoderFunc) Encode

func (e EncoderFunc) Encode(w io.Writer, m image.Image) error

Jump to

Keyboard shortcuts

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