netgsm

package
v0.0.0-...-45b59b4 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Api

func Api(header, usercode, password string) (*API, *Request)

Types

type API

type API struct {
	Endpoint string
}

func (*API) Otp

func (api *API) Otp(request *Request) (res Response)

func (*API) Sms

func (api *API) Sms(request *Request) (res Response)

type Request

type Request struct {
	XMLName xml.Name `xml:"mainbody,omitempty"`
	Header  struct {
		Company   string `xml:"company,omitempty"`
		UserCode  string `xml:"usercode,omitempty"`
		Password  string `xml:"password,omitempty"`
		StartDate string `xml:"startdate,omitempty"`
		StopDate  string `xml:"stopdate,omitempty"`
		Type      string `xml:"type,omitempty"`
		MsgHeader string `xml:"msgheader,omitempty"`
	} `xml:"header,omitempty"`
	Body struct {
		Msg string `xml:"msg,omitempty"`
		No  string `xml:"no,omitempty"`
	} `xml:"body,omitempty"`
}

type Response

type Response struct {
	XMLName xml.Name `xml:"xml,omitempty"`
	Main    struct {
		Code  string `xml:"code,omitempty"`
		JobID string `xml:"jobID,omitempty"`
		Error string `xml:"error,omitempty"`
	} `xml:"main,omitempty"`
}

Jump to

Keyboard shortcuts

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