utils

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

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

Go to latest
Published: Oct 29, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUC2 = errors.New("UC-2")

ErrUC2 is a semantic name for error that is thrown after attempt to encode UC-2 message as GSM 7-bit

Functions

func HumaniseValidationErrors

func HumaniseValidationErrors(err error) map[string]string

HumaniseValidationErrors makes errors less detailed

Types

type CustomValidator

type CustomValidator interface {
	Validate(i interface{}) error
}

CustomValidator is interface for validator that matches echo.Validator

func InitValidator

func InitValidator() CustomValidator

InitValidator is the CustomValidator factory method

type Datacoding

type Datacoding string

Datacoding is a semantic interface for Datacoding enums

const (
	// Plain is plain encoding (GSM 7-bit)
	Plain Datacoding = "plain"

	// Unicode is unicode encoding for SMS (UC-2 aka UTF-16)
	Unicode = "unicode"
)

type Encoded

type Encoded struct {
	Encoding Datacoding
	Messages []string
}

Encoded is a representation of message split depending on amount of symbols and encoding

type UDHEncoder

type UDHEncoder interface {
	Encode(m string) *Encoded
	GenerateUDH(p uint8, parts uint8, mesHash uint32) string
	SplitTextMessage(m string) *Encoded
}

UDHEncoder encodes text to string representation of hex values (depends on the used character)

func InitEncoder

func InitEncoder() UDHEncoder

InitEncoder is UDHEncoder factory method

Jump to

Keyboard shortcuts

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