Documentation ¶
Index ¶
- Constants
- func Activities(workspaceSid string) string
- func Activity(workspaceSid string, activitySid string) string
- func AllActivities(workspaceSid string) string
- func AllReservations(workspaceSid string, workerSid string) string
- func AllTaskQueues(workspaceSid string) string
- func AllTasks(workspaceSid string) string
- func AllWorkers(workspaceSid string) string
- func AllWorkspaces() string
- func Reservation(workspaceSid string, workerSid string, reservationSid string) string
- func Reservations(workspaceSid string, workerSid string) string
- func Task(workspaceSid string, tasksSid string) string
- func TaskQueue(workspaceSid string, taskQueueSid string) string
- func TaskQueues(workspaceSid string) string
- func Tasks(workspaceSid string) string
- func Worker(workspaceSid string, workerSid string) string
- func Workers(workspaceSid string) string
- func Workspace(workspaceSid string) string
- func Workspaces() string
- type CapabilityToken
- func (token *CapabilityToken) AddPolicy(policy Policy)
- func (token *CapabilityToken) FromJwt(jwtStr string, key string) (*CapabilityToken, error)
- func (token *CapabilityToken) Headers() map[string]interface{}
- func (token *CapabilityToken) Payload() map[string]interface{}
- func (token *CapabilityToken) ToJwt() (string, error)
- func (token *CapabilityToken) ToString() string
- type CapabilityTokenParams
- type Policy
Constants ¶
View Source
const ( Version = "v1" RouterBaseUrl = "https://taskrouter.twilio.com" WebsocketBaseUrl = "https://event-bridge.twilio.com/v1/wschannels" Get = "GET" Post = "POST" )
Variables ¶
This section is empty.
Functions ¶
func Activities ¶
func AllActivities ¶
func AllReservations ¶
func AllTaskQueues ¶
func AllWorkers ¶
func AllWorkspaces ¶
func AllWorkspaces() string
func Reservation ¶
func Reservations ¶
func TaskQueues ¶
func Workspaces ¶
func Workspaces() string
Types ¶
type CapabilityToken ¶
type CapabilityToken struct { AccountSid string AuthToken string WorkspaceSid string ChannelID string Policies []Policy // contains filtered or unexported fields }
func CreateCapabilityToken ¶
func CreateCapabilityToken(params CapabilityTokenParams) CapabilityToken
Create Capability Token for TaskRouter
func (*CapabilityToken) AddPolicy ¶
func (token *CapabilityToken) AddPolicy(policy Policy)
func (*CapabilityToken) FromJwt ¶
func (token *CapabilityToken) FromJwt(jwtStr string, key string) (*CapabilityToken, error)
Get the decoded token back from the jwt String
func (*CapabilityToken) Headers ¶
func (token *CapabilityToken) Headers() map[string]interface{}
func (*CapabilityToken) Payload ¶
func (token *CapabilityToken) Payload() map[string]interface{}
func (*CapabilityToken) ToJwt ¶
func (token *CapabilityToken) ToJwt() (string, error)
Encode the JWT struct into a string.
func (*CapabilityToken) ToString ¶
func (token *CapabilityToken) ToString() string
type CapabilityTokenParams ¶
type CapabilityTokenParams struct { // Twilio Account sid AccountSid string // Twilio auth token used to sign the JWT AuthToken string // TaskRouter Workspace SID WorkspaceSid string // TaskRouter Channel SID ChannelID string // Time in secs since epoch before which this JWT is invalid, defaults to now Nbf float64 // Time to live of the JWT in seconds, defaults to 1 hour Ttl float64 // Time in secs since epoch this JWT is valid for. Overrides ttl if provided. ValidUntil float64 }
type Policy ¶
type Policy struct { Url string `json:"url,omitempty"` Method string `json:"method,omitempty"` Allow bool `json:"allow,omitempty"` PostFilter map[string]interface{} `json:"post_filter"` QueryFilter map[string]interface{} `json:"query_filter"` }
func GeneratePolicy ¶
func WebSocketPolicies ¶
func WorkerPolicies ¶
Click to show internal directories.
Click to hide internal directories.