io

package
v0.0.0-...-dab53f2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

enhanced https://github.com/t-tomalak/logrus-easy-formatter with fields tag added

Index

Constants

View Source
const (
	BYTE_TO_U16     = math.MaxUint16 / 0xff // x [0; 255] * BYTE_TO_U16 = x [0; 1 << 16 - 1]
	BYTE_TO_U32     = math.MaxUint32 / 0xff // x [0; 255] * BYTE_TO_U32 = x [0; 1 << 32 - 1]
	APC_BYTE_TO_U16 = BYTE_TO_U16 / 0xff    // x [0; 255] * alpha * APC_BYTE_TO_U16 = alpha-premultiplied x [0; 1 << 16 - 1]
	APC_BYTE_TO_U32 = BYTE_TO_U32 / 0xff    // x [0; 255] * alpha * APC_BYTE_TO_U32 = alpha-premultiplied x [0; 1 << 32 - 1]
	APC_U16_TO_BYTE = 1 / APC_BYTE_TO_U16   // APC_BYTE_TO_U16 inverse
	APC_U32_TO_BYTE = 1 / APC_BYTE_TO_U32   // APC_BYTE_TO_U32 inverse
)
View Source
const (
	InDir = "./in/"
)

Variables

View Source
var (
	OutDir = "./out/"
)

Functions

func FormatImageName

func FormatImageName(path *string, filter_name *string, args *[]string) (new_name, new_path string)

func FormatImageTempName

func FormatImageTempName(temp_path, input_file_path *string, filter_name string) (new_name, new_path string)

func LoadImage

func LoadImage(filename *string) (*im.Image, string)

func RemoveFile

func RemoveFile(filename *string) error

func RenameFiles

func RenameFiles(pack *requests.Pack, input_file_path *string, filterList string)

func SaveImage

func SaveImage(image *im.RGBA, path *string, filter_name *string, args *[]string) *string

Types

type Formatter

type Formatter struct {
	// Timestamp format
	TimestampFormat string
	// Available standard keys: time, msg, lvl
	// Also can include custom fields but limited to strings.
	// All of fields need to be wrapped inside %% i.e %time% %msg%
	LogFormat string
}

Formatter implements logrus.Formatter interface.

func (*Formatter) Format

func (f *Formatter) Format(entry *logrus.Entry) ([]byte, error)

Format building log message.

type OptionalRGBA64

type OptionalRGBA64 struct {
	Color *color.RGBA64
	Empty bool
}

func ParseColor

func ParseColor(str string) *OptionalRGBA64

Jump to

Keyboard shortcuts

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