Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeEncode ¶
DecodeEncode takes an input string `buf` and decodes/encodes it (depending on the `encode` parameter) with the given `codec`. It returns the encoded/decoded string or an error if the process failed.
func MainStandalone ¶
func MainStandalone(args ...string)
MainStandalone parses its own flag and it is the funcion to be run when using `wapty decode`. This behaves as a main and expects the "decode" parameter to be removed from os.Args.
Types ¶
type Base16 ¶
type Base16 struct {
// contains filtered or unexported fields
}
Base16 takes a decoder and an input string
type Base32 ¶
type Base32 struct {
// contains filtered or unexported fields
}
Base32 takes a decoder and an input string
type Base64 ¶
type Base64 struct {
// contains filtered or unexported fields
}
Base64 takes a decoder and an input string
type Checker ¶
type Checker interface {
Check() (acceptability float64)
}
Checker returns a metric to determine how likely it is for the given string to be a valid value for the specified Checker Type. The likelihood always ranges between 0 and 1
type CodecC ¶
CodecC creates an interface of interfaces usable by other codecs
func NewB16CodecC ¶
NewB16CodecC state machine to smartly decode a string with invalid chars nolint: gocyclo
func NewB32CodecC ¶
NewB32CodecC state machine to smartly decode a string with invalid chars nolint: gocyclo
func NewB64CodecC ¶
NewB64CodecC state machine to smartly decode a string with invalid chars and different variants nolint: gocyclo
func NewGzipCodecC ¶
NewGzipCodecC state machine to decompress a gzip compressed file
func NewURLCodecC ¶
NewURLCodecC state machine to smartly decode a string with invalid chars
func SmartDecode ¶
SmartDecode loops through the available CodecCs and determine which one is the best one to use
type Decoder ¶
type Decoder interface {
Decode() (output string)
}
Decoder decodes the string and returns a decoded value that tries to skip invalid input and to decode as much as possible. Returns if the decoded string can be printed as valid unicode.