credentials

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2020 License: Apache-2.0 Imports: 2 Imported by: 811

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	Account string `validate:"required,startswith=AC"`
	Sid     string `validate:"required,startswith=SK"`
	Value   string `validate:"required"`
}

APIKey represents a Twilio API Key which can be used to authenticate against the Twilio APIs

func (APIKey) AccountSid

func (apiKey APIKey) AccountSid() string

func (APIKey) Validate

func (apiKey APIKey) Validate() error

Validate ensures the API Keys is valid

type Account

type Account struct {
	Sid       string `validate:"required,startswith=AC"`
	AuthToken string `validate:"required"`
}

Account represents Twilio Account Credentials which can be used to authenticate against the Twilio APIs

func (Account) AccountSid

func (account Account) AccountSid() string

func (Account) Validate

func (account Account) Validate() error

Validate ensures the account credentials are valid

type Credentials

type Credentials struct {
	AccountSid string
	Username   string
	Password   string
}

Credentials respresent the field necessary to authenticate against the Twilio APIs

func New

func New(creds TwilioCredentials) (*Credentials, error)

New creates a new instance of credentials using the supplied twilio credentials. If the credentials are invalid then an error will be returned

type TwilioCredentials

type TwilioCredentials interface {
	Validate() error
	AccountSid() string
	// contains filtered or unexported methods
}

TwilioCredentials respresents the structure of twilio credentials

Jump to

Keyboard shortcuts

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