Documentation ¶
Overview ¶
Package format implements the age file format.
Index ¶
Constants ¶
const BytesPerLine = ColumnsPerLine / 4 * 3
const ColumnsPerLine = 64
Variables ¶
var EncodeToString = b64.EncodeToString
Functions ¶
func DecodeString ¶
Types ¶
type Header ¶
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
func (*ParseError) Error ¶
func (e *ParseError) Error() string
func (*ParseError) Unwrap ¶ added in v1.1.0
func (e *ParseError) Unwrap() error
type Stanza ¶
Stanza is assignable to age.Stanza, and if this package is made public, age.Stanza can be made a type alias of this type.
type StanzaReader ¶ added in v1.1.0
type StanzaReader struct {
// contains filtered or unexported fields
}
func NewStanzaReader ¶ added in v1.1.0
func NewStanzaReader(r *bufio.Reader) *StanzaReader
func (*StanzaReader) ReadStanza ¶ added in v1.1.0
func (r *StanzaReader) ReadStanza() (s *Stanza, err error)
type WrappedBase64Encoder ¶
type WrappedBase64Encoder struct {
// contains filtered or unexported fields
}
WrappedBase64Encoder is a standard base64 encoder that inserts an LF character every ColumnsPerLine bytes. It does not insert a newline neither at the beginning nor at the end of the stream, but it ensures the last line is shorter than ColumnsPerLine, which means it might be empty.
func NewWrappedBase64Encoder ¶
func NewWrappedBase64Encoder(enc *base64.Encoding, dst io.Writer) *WrappedBase64Encoder
NewWrappedBase64Encoder returns a WrappedBase64Encoder that writes to dst.
func (*WrappedBase64Encoder) Close ¶
func (w *WrappedBase64Encoder) Close() error
func (*WrappedBase64Encoder) LastLineIsEmpty ¶
func (w *WrappedBase64Encoder) LastLineIsEmpty() bool
LastLineIsEmpty returns whether the last output line was empty, either because no input was written, or because a multiple of BytesPerLine was.
Calling LastLineIsEmpty before Close is meaningless.