internal

package
v3.0.0-alpha.2-proton Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package internal contains internal methods and constants.

Index

Constants

This section is empty.

Variables

View Source
var ArmorHeaders = map[string]string{}

ArmorHeaders is a map of default armor headers.

View Source
var ErrIncorrectUtf8 = errors.New("openpgp: data encoding is not valid utf-8")

Functions

func Canonicalize

func Canonicalize(text string) string

func CanonicalizeBytes

func CanonicalizeBytes(text []byte) []byte

func NewNoOpWriteCloser

func NewNoOpWriteCloser(writer io.Writer) io.WriteCloser

NewNoOpWriteCloser creates a WriteCloser form a Writer that performs no operation on close.

func NewSanitizeReader

func NewSanitizeReader(r io.Reader) io.Reader

func SanitizeString

func SanitizeString(input string) string

func TrimEachLine

func TrimEachLine(text string) string

func TrimEachLineBytes

func TrimEachLineBytes(text []byte) []byte

func Unarmor

func Unarmor(input string) (*armor.Block, error)

Unarmor unarmors an armored string.

func UnarmorBytes

func UnarmorBytes(input []byte) (*armor.Block, error)

UnarmorBytes unarmors an armored byte slice.

Types

type ResetReader

type ResetReader struct {
	Reader io.Reader
	// contains filtered or unexported fields
}

ResetReader is a reader that can be reset by buffering data internally.

func NewResetReader

func NewResetReader(reader io.Reader) *ResetReader

NewResetReader creates a new ResetReader with the default state.

func (*ResetReader) DisableBuffering

func (rr *ResetReader) DisableBuffering()

DisableBuffering disables the internal buffering. After the disable, a Reset is not allowed anymore.

func (*ResetReader) Read

func (rr *ResetReader) Read(b []byte) (n int, err error)

func (*ResetReader) Reset

func (rr *ResetReader) Reset() (io.Reader, error)

Reset creates a reader that reads again from the beginning and resets the internal state.

type Utf8CheckWriteCloser

type Utf8CheckWriteCloser struct {
	// contains filtered or unexported fields
}

func NewUtf8CheckWriteCloser

func NewUtf8CheckWriteCloser(wrap io.WriteCloser) *Utf8CheckWriteCloser

func (*Utf8CheckWriteCloser) Close

func (cw *Utf8CheckWriteCloser) Close() (err error)

func (*Utf8CheckWriteCloser) Write

func (cw *Utf8CheckWriteCloser) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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