Documentation ¶
Index ¶
- func ClientSingleton(conf *Config) (singleton.Singleton[Client, Config], error)
- type ApiKeyConfig
- type AuthConfig
- type AuthTokenConfig
- type Client
- func (c *Client) Message(ctx context.Context, msgSid string) (*openapi.ApiV2010Message, error)
- func (c *Client) MessageStatus(ctx context.Context, msgSid string) (MessageSendStatus, error)
- func (c *Client) SendMessage(ctx context.Context, msg messages.Message, recipient string) (SendSMSResponse, error)
- type Config
- type MessageSendStatus
- type SendSMSResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApiKeyConfig ¶
type ApiKeyConfig struct { AccountSid string `json:"account_sid" yaml:"account_sid" toml:"AccountSid"` ApiKey string `json:"key" yaml:"key" toml:"Key"` ApiSecret string `json:"secret" yaml:"secret" toml:"Secret"` }
func (ApiKeyConfig) Account ¶
func (c ApiKeyConfig) Account() string
func (ApiKeyConfig) Key ¶
func (c ApiKeyConfig) Key() string
func (ApiKeyConfig) Secret ¶
func (c ApiKeyConfig) Secret() string
type AuthConfig ¶
type AuthConfig struct { AuthToken *AuthTokenConfig `json:"auth_token,omitempty" yaml:"auth_token,omitempty" toml:"AuthToken,omitempty"` ApiKey *ApiKeyConfig `json:"api_key,omitempty" yaml:"api_key,omitempty" toml:"ApiKey,omitempty"` }
type AuthTokenConfig ¶
type AuthTokenConfig struct { AccountSid string `json:"account_sid" yaml:"account_sid" toml:"AccountSid"` Token string `json:"token" yaml:"token" toml:"Token"` }
func (AuthTokenConfig) Account ¶
func (c AuthTokenConfig) Account() string
func (AuthTokenConfig) Key ¶
func (c AuthTokenConfig) Key() string
func (AuthTokenConfig) Secret ¶
func (c AuthTokenConfig) Secret() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientFromConfig ¶
func (*Client) MessageStatus ¶
func (*Client) SendMessage ¶
type Config ¶
type Config struct { Auth *AuthConfig `json:"auth,omitempty" yaml:"auth,omitempty" toml:"Auth,omitempty"` SenderNumber string `json:"sender_number" yaml:"sender_number" toml:"SenderNumber"` RecipientNumber string `json:"recipient_number" yaml:"recipient_number" toml:"RecipientNumber"` }
func LoadConfig ¶
LoadConfig reads configuration data from the file at the passed path and returns it as a fully loaded Config. `confPath` is expected to be an absolute file path. Supported file types: json, yaml, toml
type MessageSendStatus ¶
type MessageSendStatus string
const ( StatusQueued MessageSendStatus = "queued" StatusFailed MessageSendStatus = "failed" StatusSent MessageSendStatus = "sent" StatusDelivered MessageSendStatus = "delivered" StatusUndelivered MessageSendStatus = "undelivered" )
type SendSMSResponse ¶
Click to show internal directories.
Click to hide internal directories.