encoder

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Base64EncoderNormalMode = iota
	Base64EncoderFlatMode
)

Variables

View Source
var DefaultBase64Encoder = &Base64Encoder{name: "Base64", mode: Base64EncoderNormalMode}
View Source
var DefaultBase64FlatEncoder = &Base64Encoder{name: "Base64Flat", mode: Base64EncoderFlatMode}
View Source
var DefaultJSUnicodeEncoder = &JSUnicodeEncoder{name: "JSUnicode"}
View Source
var DefaultPlainEncoder = &PlainEncoder{name: "Plain"}
View Source
var DefaultURLEncoder = &URLEncoder{name: "URL"}
View Source
var DefaultXMLEntityEncoder = &XMLEntityEncoder{name: "XMLEntity"}
View Source
var Encoders map[string]Encoder

Functions

func Apply

func Apply(encoderName, data string) (string, error)

Types

type Base64Encoder

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

func (*Base64Encoder) Encode

func (enc *Base64Encoder) Encode(data string) (string, error)

func (*Base64Encoder) GetName

func (enc *Base64Encoder) GetName() string

type Encoder

type Encoder interface {
	GetName() string
	Encode(data string) (string, error)
}

type JSUnicodeEncoder

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

func (*JSUnicodeEncoder) Encode

func (enc *JSUnicodeEncoder) Encode(data string) (string, error)

func (*JSUnicodeEncoder) GetName

func (enc *JSUnicodeEncoder) GetName() string

type PlainEncoder

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

func (*PlainEncoder) Encode

func (enc *PlainEncoder) Encode(data string) (string, error)

func (*PlainEncoder) GetName

func (enc *PlainEncoder) GetName() string

type URLEncoder

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

func (*URLEncoder) Encode

func (enc *URLEncoder) Encode(data string) (string, error)

func (*URLEncoder) GetName

func (enc *URLEncoder) GetName() string

type UnknownEncoderError added in v0.5.0

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

func (*UnknownEncoderError) Error added in v0.5.0

func (e *UnknownEncoderError) Error() string

type XMLEntityEncoder

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

func (*XMLEntityEncoder) Encode

func (enc *XMLEntityEncoder) Encode(data string) (string, error)

func (*XMLEntityEncoder) GetName

func (enc *XMLEntityEncoder) GetName() string

Jump to

Keyboard shortcuts

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