internal

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ID

func ID(value any) string

ID returns md5 hash sum of the value.

func Readable

func Readable(value any) string

Readable returns either the result of String() if value implements fmt.Stringer, else first ten symbols of md5 hash sum with value type are returned. This is useful for printing values to logs, for example.

Types

type IO

type IO struct {
	// R is an io.Reader instance to be used for reading.
	R io.Reader
	// W is an io.Writer instance to be used for reading.
	W io.Writer
	// E is an error which will be returned when reading/writing.
	E error
}

IO is a generic Input / Output. It is not mandatory to fill all struct fields.

func (IO) Reader

func (io IO) Reader() (io.Reader, error)

func (IO) Writer

func (io IO) Writer() (io.Writer, error)

type Input

type Input interface {
	// Reader returns an instance of io.Reader.
	Reader() (io.Reader, error)
}

Input interface describes a resource which can be read (possibly more than once).

type Output

type Output interface {
	// Writer returns an instance of io.Writer.
	Writer() (io.Writer, error)
}

Output interface describes a resource which can be written (possibly more than once).

Jump to

Keyboard shortcuts

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