gg_sms_engine

package
v0.3.36 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: BSD-3-Clause Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BASEURL                = "https://api.skebby.it/API/v1.0/REST/"
	TESTURL                = "https://httpbin.org/post"
	MESSAGE_HIGH_QUALITY   = "GP"
	MESSAGE_MEDIUM_QUALITY = "TI"
	MESSAGE_LOW_QUALITY    = "SI"
)

Variables

This section is empty.

Functions

func CheckPrefix

func CheckPrefix(text string) string

func ClearPhone

func ClearPhone(text string) string

func Render

func Render(text string, context map[string]string) string

func ShortUrl

func ShortUrl(uri string) string

func ShortUrlsInMessage

func ShortUrlsInMessage(text string) string

Types

type DriverGeneric

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

func NewDriverGeneric

func NewDriverGeneric(shortURl bool, settings *SMSProvider) *DriverGeneric

func (*DriverGeneric) Send

func (instance *DriverGeneric) Send(message, to, from string) (string, error)

type DriverSkebby

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

func NewDriverSkebby

func NewDriverSkebby(shortURl bool, settings *SMSProvider) *DriverSkebby

func (*DriverSkebby) Send

func (instance *DriverSkebby) Send(message, to, from string) (string, error)

type IDriver

type IDriver interface {
	Send(message, to, from string) (string, error)
}

type SMSConfiguration

type SMSConfiguration struct {
	Enabled      bool                    `json:"enabled"`
	AutoShortUrl bool                    `json:"auto-short-url"`
	Providers    map[string]*SMSProvider `json:"providers"`
}

func NewSMSConfigurationFromFile

func NewSMSConfigurationFromFile(filename string) (*SMSConfiguration, error)

func NewSMSConfigurationFromMap

func NewSMSConfigurationFromMap(m map[string]interface{}) (*SMSConfiguration, error)

func NewSMSConfigurationFromString

func NewSMSConfigurationFromString(text string) (*SMSConfiguration, error)

func (*SMSConfiguration) Provider

func (instance *SMSConfiguration) Provider(name ...string) *SMSProvider

func (*SMSConfiguration) ProviderNames

func (instance *SMSConfiguration) ProviderNames() []string

func (*SMSConfiguration) String

func (instance *SMSConfiguration) String() string

type SMSProvider

type SMSProvider struct {
	Driver   string            `json:"driver"`
	Method   string            `json:"method"`
	Endpoint string            `json:"endpoint"`
	Params   map[string]string `json:"params"`
	Headers  map[string]string `json:"headers"`
}

func (*SMSProvider) Header

func (instance *SMSProvider) Header(name string) string

func (*SMSProvider) Param

func (instance *SMSProvider) Param(name string) string

func (*SMSProvider) String

func (instance *SMSProvider) String() string

type SMSSender

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

func NewSMSSender

func NewSMSSender(autoShortUrl bool, provider *SMSProvider) *SMSSender

func (*SMSSender) Send

func (instance *SMSSender) Send(message, to, from string) error

Jump to

Keyboard shortcuts

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