gateway

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

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

func (*Base) Http

func (b *Base) Http() *resty.Client

Http returns a resty client

func (*Base) Parse

func (b *Base) Parse(phone, message interface{}) (*Phone, *Message, error)

func (*Base) ParseMessage

func (b *Base) ParseMessage(message interface{}) (*Message, error)

func (*Base) ParsePhone

func (b *Base) ParsePhone(phone interface{}) (*Phone, error)

type Config

type Config interface {
}

type Gateway

type Gateway interface {
	Send(interface{}, interface{}) (*Response, error)
}

type Message

type Message struct {
	Content  string
	Template string
	Data     map[string]interface{}
}

func NewMessage

func NewMessage(content string) *Message

func (*Message) GetContent

func (m *Message) GetContent() string

func (*Message) GetData

func (m *Message) GetData() map[string]interface{}

func (*Message) GetTemplate

func (m *Message) GetTemplate() string

func (*Message) SetContent

func (m *Message) SetContent(content string) *Message

func (*Message) SetData

func (m *Message) SetData(data map[string]interface{}) *Message

func (*Message) SetTemplate

func (m *Message) SetTemplate(template string) *Message

type MessageFunc

type MessageFunc func(*Message) *Message

type Phone

type Phone struct {
	IddCode     string
	PhoneNumber string
}

func NewPhone

func NewPhone(phoneNumber, iddcode string) *Phone

func (*Phone) GetFullNumber

func (p *Phone) GetFullNumber() string

func (*Phone) GetIddCode

func (p *Phone) GetIddCode() string

func (*Phone) GetPhoneNumber

func (p *Phone) GetPhoneNumber() string

type Response

type Response struct {
	*resty.Response
}

func NewResponse

func NewResponse(resp *resty.Response) *Response

func (*Response) GetBody

func (r *Response) GetBody() string

func (*Response) GetJson

func (r *Response) GetJson(v interface{}) error

func (*Response) GetProto

func (r *Response) GetProto() string

func (*Response) GetStatus

func (r *Response) GetStatus() string

func (*Response) GetStatusCode

func (r *Response) GetStatusCode() int

func (*Response) IsSuccessful

func (r *Response) IsSuccessful() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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