encoder

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Base64EncoderNormalMode = 1
	Base64EncoderFlatMode   = 2
)

Variables

View Source
var DefaultBase64Encoder = Base64Encoder{/* contains filtered or unexported fields */}
View Source
var DefaultBase64FlatEncoder = Base64Encoder{/* contains filtered or unexported fields */}
View Source
var DefaultGRPCEncoder = GRPCEncoder{/* contains filtered or unexported fields */}
View Source
var DefaultJSUnicodeEncoder = JSUnicodeEncoder{/* contains filtered or unexported fields */}
View Source
var DefaultPlainEncoder = PlainEncoder{/* contains filtered or unexported fields */}
View Source
var DefaultURLEncoder = URLEncoder{/* contains filtered or unexported fields */}
View Source
var DefaultXMLEntityEncoder = XMLEntityEncoder{/* contains filtered or unexported fields */}
View Source
var Encoders map[string]Encoder

Functions

func Apply

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

func InitEncoders

func InitEncoders()

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)
}

Better to use byte types, they're faster, but here I'll use strings

type GRPCEncoder

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

func (GRPCEncoder) Encode

func (enc GRPCEncoder) Encode(data string) (string, error)

func (GRPCEncoder) GetName

func (enc GRPCEncoder) GetName() *string

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 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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