Versions in this module Expand all Collapse all v1 v1.0.1 Dec 30, 2020 v1.0.0 Dec 20, 2020 Changes in this version + var ErrEmptyIdentity = errors.New("generate access token for empty identity") + var ErrMissingAccountSid = errors.New("twilio accounSid not set") + var ErrMissingAuthToken = errors.New("twilio auth token not set") + var ErrMissingKeySecret = errors.New("twilio key secret not set") + var ErrMissingKeySid = errors.New("twilio key sid not set") + var ErrUnsupportedAlgorithm = errors.New("signing method is not supported") + type AccessToken struct + func NewAccessToken(accountSid, keySid, keySecret string) *AccessToken + func (a *AccessToken) AddGrant(grant Grant) *AccessToken + func (a *AccessToken) SetIdentity(identity string) *AccessToken + func (a *AccessToken) SetNotBefore(notBefore time.Time) *AccessToken + func (a *AccessToken) SetTTL(ttl time.Duration) *AccessToken + func (a *AccessToken) ToJWT() ([]byte, error) + func (a *AccessToken) ToJWTWithMethod(method crypto.SigningMethod) ([]byte, error) + type Capability struct + func NewCapability(accountSid, authToken string) *Capability + func (c *Capability) AllowClientIncoming(clientName string) *Capability + func (c *Capability) AllowClientOutgoing(appSid string, appParams map[string]string) *Capability + func (c *Capability) AllowEventStream(filters string) *Capability + func (c *Capability) SetTTL(ttl time.Duration) *Capability + func (c *Capability) ToJWT() ([]byte, error) + type Grant interface + Key func() string + Payload func() interface{} + func NewChatGrant(serviceSid, endpointID, deploymentRoleSid, pushCredentialSid string) Grant + func NewConversationGrant(sid string) Grant + func NewIPMessagingGrant(serviceSid, endpointID, deploymentRoleSid, pushCredentialSid string) Grant + func NewVideoGrant(room string) Grant + func NewVoiceGrant(applicationSid, pushCredentialSid, endpointID string, allowIncoming bool, ...) Grant