Skip to content
/ go-sms Public

A SMS service component implemented in Go language.

License

Notifications You must be signed in to change notification settings

flc1125/go-sms

Repository files navigation

Go SMS

Go Version GoDoc codecov Go Report Card lint test MIT license

Installation

go get github.com/flc1125/go-sms

Usage

sms with driver

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/flc1125/go-sms"
	"github.com/flc1125/go-sms/driver/writer"
)

func main() {
	s := sms.New(
		writer.NewDriver(os.Stdout),
	)
	resp, err := s.Send(context.Background(), &sms.Request{
		Phone:   "1234567890",
		Content: "test",
	})
	if err != nil {
		panic(err)
	}
	fmt.Println(resp.Status, resp.Message)

	// Output: writer: send sms {1234567890 test <nil>}
}

Drivers

License

The MIT License (MIT). Please see License File for more information.