encoding

package
v0.0.0-...-2c3d6b8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllEncoders encoderNames

AllEncoders holds list of encoder names. All the encoder names in echo of the encoder packages should be appended to AllEncoders during respective init()

Functions

This section is empty.

Types

type Encoder

type Encoder interface {
	Encode([]bookmark.Bookmark) error
	Filename() string
	fmt.Stringer
}

Encoder holds the signatures to custom encoder types. This has the following methods:

  1. Encode - Encodes bookmarks to target output format and writes to already mentioned output stream.
  2. Filename - If the output stream is of a local package files's File type, this returns the filename.
  3. String (in fmt.Stringer) - Returns the encoder name.

type EncoderName

type EncoderName string

EncoderName holds encoder's name

func ToEncoder

func ToEncoder(s fmt.Stringer) EncoderName

ToEncoder converts stringer to EncoderName type

func (EncoderName) String

func (e EncoderName) String() string

String converts EncoderName to string, making EncoderName type implement fmt.Stringer

type EncodingManager

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

EncodingManager holds bookmarks and target encoders to parse bookmarks to

func NewEncoderManager

func NewEncoderManager(ctx context.Context) *EncodingManager

NewEncoderManager initiates new EncodingManager

func (*EncodingManager) Bookmarks

func (e *EncodingManager) Bookmarks(bookmarks []bookmark.Bookmark) *EncodingManager

Encoder appends bookmarks to manager. Both receiver and return value are of same type to implement builder's pattern.

func (*EncodingManager) Encoder

func (e *EncodingManager) Encoder(encoder Encoder) *EncodingManager

Encoder appends input encoder to encoder list in manager. Both receiver and return value are of same type to implement builder's pattern.

func (*EncodingManager) Write

func (e *EncodingManager) Write() error

Write encodes the bookmarks to all the encoders added to manager

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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