Documentation ¶
Index ¶
- func ParseAMResponse(r APIRequest, data []byte) (interface{}, error)
- type APIRequest
- type AdminAPI
- type BaseAMResponse
- type BaseRequest
- type DefaultAdminAPI
- func (api *DefaultAdminAPI) AddToken(token string, plugins []string) (interface{}, error)
- func (api *DefaultAdminAPI) AllowToken(token string, plugins []string) (interface{}, error)
- func (api *DefaultAdminAPI) Close() error
- func (api *DefaultAdminAPI) DisallowToken(token string, plugins []string) (interface{}, error)
- func (api *DefaultAdminAPI) HandleInfo(sessionID, handleID uint64) (interface{}, error)
- func (api *DefaultAdminAPI) ListHandles(sessionID uint64) (interface{}, error)
- func (api *DefaultAdminAPI) ListSessions() (interface{}, error)
- func (api *DefaultAdminAPI) ListTokens() (interface{}, error)
- func (api *DefaultAdminAPI) MessagePlugin(request plugins.PluginRequest) (interface{}, error)
- func (api *DefaultAdminAPI) RemoveToken(token string) (interface{}, error)
- type ErrorAMResponse
- type HandleInfoResponse
- type HandleRequest
- type HandleResponse
- type HttpTransport
- type ListHandlesResponse
- type ListSessionsResponse
- type ListTokensResponse
- type MessagePluginRequest
- type MessagePluginResponse
- type SessionRequest
- type SessionResponse
- type StoredToken
- type SuccessAMResponse
- type TokenRequest
- type Transport
- type TransportError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseAMResponse ¶
func ParseAMResponse(r APIRequest, data []byte) (interface{}, error)
Types ¶
type APIRequest ¶
type AdminAPI ¶
type AdminAPI interface { AddToken(token string, plugins []string) (interface{}, error) AllowToken(token string, plugins []string) (interface{}, error) DisallowToken(token string, plugins []string) (interface{}, error) RemoveToken(token string) (interface{}, error) ListTokens() (interface{}, error) ListSessions() (interface{}, error) MessagePlugin(request plugins.PluginRequest) (interface{}, error) ListHandles(sessionID uint64) (interface{}, error) HandleInfo(sessionID, handleID uint64) (interface{}, error) Close() error }
type BaseAMResponse ¶
type BaseRequest ¶
func (*BaseRequest) ActionName ¶
func (r *BaseRequest) ActionName() string
func (*BaseRequest) Endpoint ¶
func (r *BaseRequest) Endpoint() string
func (*BaseRequest) Payload ¶
func (r *BaseRequest) Payload() map[string]interface{}
type DefaultAdminAPI ¶
type DefaultAdminAPI struct {
// contains filtered or unexported fields
}
func NewAdminAPI ¶
func NewAdminAPI(url, secret string) (*DefaultAdminAPI, error)
func (*DefaultAdminAPI) AddToken ¶
func (api *DefaultAdminAPI) AddToken(token string, plugins []string) (interface{}, error)
func (*DefaultAdminAPI) AllowToken ¶
func (api *DefaultAdminAPI) AllowToken(token string, plugins []string) (interface{}, error)
func (*DefaultAdminAPI) Close ¶
func (api *DefaultAdminAPI) Close() error
func (*DefaultAdminAPI) DisallowToken ¶
func (api *DefaultAdminAPI) DisallowToken(token string, plugins []string) (interface{}, error)
func (*DefaultAdminAPI) HandleInfo ¶
func (api *DefaultAdminAPI) HandleInfo(sessionID, handleID uint64) (interface{}, error)
func (*DefaultAdminAPI) ListHandles ¶
func (api *DefaultAdminAPI) ListHandles(sessionID uint64) (interface{}, error)
func (*DefaultAdminAPI) ListSessions ¶
func (api *DefaultAdminAPI) ListSessions() (interface{}, error)
func (*DefaultAdminAPI) ListTokens ¶
func (api *DefaultAdminAPI) ListTokens() (interface{}, error)
func (*DefaultAdminAPI) MessagePlugin ¶
func (api *DefaultAdminAPI) MessagePlugin(request plugins.PluginRequest) (interface{}, error)
func (*DefaultAdminAPI) RemoveToken ¶
func (api *DefaultAdminAPI) RemoveToken(token string) (interface{}, error)
type ErrorAMResponse ¶
type ErrorAMResponse struct { BaseAMResponse Err janus.ErrorData `json:"error"` }
func (*ErrorAMResponse) Error ¶
func (err *ErrorAMResponse) Error() string
type HandleInfoResponse ¶
type HandleInfoResponse struct { HandleResponse Info map[string]interface{} `json:"info"` }
type HandleRequest ¶
type HandleRequest struct { SessionRequest HandleID uint64 }
func (*HandleRequest) Endpoint ¶
func (r *HandleRequest) Endpoint() string
func (*HandleRequest) Payload ¶
func (r *HandleRequest) Payload() map[string]interface{}
type HandleResponse ¶
type HandleResponse struct { SessionResponse HandleID uint64 `json:"handle_id"` }
type HttpTransport ¶
type HttpTransport struct {
// contains filtered or unexported fields
}
func NewHttpTransport ¶
func NewHttpTransport(url string) *HttpTransport
func (*HttpTransport) Close ¶
func (t *HttpTransport) Close() error
func (*HttpTransport) Request ¶
func (t *HttpTransport) Request(r APIRequest) (interface{}, error)
type ListHandlesResponse ¶
type ListHandlesResponse struct { SessionResponse Handles []uint64 `json:"handles"` }
type ListSessionsResponse ¶
type ListSessionsResponse struct { BaseAMResponse Sessions []uint64 `json:"sessions"` }
type ListTokensResponse ¶
type ListTokensResponse struct { BaseAMResponse Data map[string][]*StoredToken `json:"data"` }
type MessagePluginRequest ¶
type MessagePluginRequest struct { BaseRequest Request plugins.PluginRequest }
func (*MessagePluginRequest) Payload ¶
func (r *MessagePluginRequest) Payload() map[string]interface{}
type MessagePluginResponse ¶
type MessagePluginResponse struct { BaseAMResponse Response map[string]interface{} `json:"response"` }
type SessionRequest ¶
type SessionRequest struct { BaseRequest SessionID uint64 }
func (*SessionRequest) Endpoint ¶
func (r *SessionRequest) Endpoint() string
func (*SessionRequest) Payload ¶
func (r *SessionRequest) Payload() map[string]interface{}
type SessionResponse ¶
type SessionResponse struct { BaseAMResponse SessionID uint64 `json:"session_id"` }
type StoredToken ¶
type SuccessAMResponse ¶
type SuccessAMResponse struct { BaseAMResponse Data map[string]interface{} `json:"data"` }
type TokenRequest ¶
type TokenRequest struct { BaseRequest Token string Plugins []string }
func (*TokenRequest) Payload ¶
func (r *TokenRequest) Payload() map[string]interface{}
type Transport ¶
type Transport interface { Request(APIRequest) (interface{}, error) Close() error }
type TransportError ¶
func (*TransportError) Error ¶
func (e *TransportError) Error() string
Click to show internal directories.
Click to hide internal directories.