Documentation ¶
Index ¶
- Constants
- Variables
- func ResponseError(resp *http.Response) (err error)
- func Sign(secret, data []byte) (token string)
- func URI_DelStream(id string) string
- func URI_GetStream(id string) string
- func URI_GetStreamSegments(id string, options map[string]interface{}) (httpurl string)
- func URI_ListStreams(hub string, options map[string]interface{}) (httpurl string)
- func URI_NewStream() string
- func URI_SetStream(id string) string
- func UserAgent() string
- type API_Client
- func (app API_Client) CreateStream(hub, title, publishKey, publishSecurity string) (ret Stream, err error)
- func (app API_Client) DelStream(id string) (ret interface{}, err error)
- func (app API_Client) GetStream(id string) (ret Stream, err error)
- func (app API_Client) GetStreamSegments(id string, startTime, endTime int64) (ret StreamSegmentList, err error)
- func (app API_Client) ListStreams(hub, marker string, limit int64) (ret StreamList, err error)
- func (app API_Client) SetStream(id, publishKey, publishSecurity string) (ret Stream, err error)
- type Error
- type ErrorInfo
- type ErrorRet
- type Mac
- type PlayPolicy
- type PublishPolicy
- type RPC_Client
- func (r RPC_Client) Del(url string) (resp *http.Response, err error)
- func (r RPC_Client) DelCall(ret interface{}, url string) (err error)
- func (r RPC_Client) Do(req *http.Request) (resp *http.Response, err error)
- func (r RPC_Client) Get(url string) (resp *http.Response, err error)
- func (r RPC_Client) GetCall(ret interface{}, url string) (err error)
- func (r RPC_Client) Post(url string, data interface{}) (resp *http.Response, err error)
- func (r RPC_Client) PostCall(ret interface{}, url string, params interface{}) (err error)
- func (r RPC_Client) RequestWith(method string, url string, bodyType string, body io.Reader, bodyLength int) (resp *http.Response, err error)
- type Stream
- type StreamList
- type StreamSegment
- type StreamSegmentList
- type Transport
Constants ¶
View Source
const ( SDK_VERSION = "1.0.2" API_VERSION = "v1" DEFAULT_API_HOST = "pili.qiniuapi.com" )
Variables ¶
View Source
var ( API_HOST string USE_HTTPS bool )
View Source
var API_BASE_URL = fmt.Sprintf("%s://%s/%s", getHttpScheme(), getApiHost(), API_VERSION)
View Source
var DefaultClient = RPC_Client{http.DefaultClient}
Functions ¶
func ResponseError ¶
func URI_DelStream ¶
func URI_GetStream ¶
func URI_GetStreamSegments ¶
func URI_ListStreams ¶
func URI_NewStream ¶
func URI_NewStream() string
func URI_SetStream ¶
Types ¶
type API_Client ¶
type API_Client struct {
Conn RPC_Client
}
func NewClient ¶
func NewClient(mac *Mac) API_Client
func (API_Client) CreateStream ¶
func (app API_Client) CreateStream(hub, title, publishKey, publishSecurity string) (ret Stream, err error)
func (API_Client) DelStream ¶
func (app API_Client) DelStream(id string) (ret interface{}, err error)
func (API_Client) GetStreamSegments ¶
func (app API_Client) GetStreamSegments(id string, startTime, endTime int64) (ret StreamSegmentList, err error)
func (API_Client) ListStreams ¶
func (app API_Client) ListStreams(hub, marker string, limit int64) (ret StreamList, err error)
type PlayPolicy ¶
type PlayPolicy struct { RtmpPlayHost string // required, replace with your customized domain HlsPlayHost string // required, replace with your customized domain StreamId string // required, format: <zone>.<hub>.<title> }
func (PlayPolicy) HlsLiveUrl ¶
func (p PlayPolicy) HlsLiveUrl(preset string) (url string)
func (PlayPolicy) HlsPlaybackUrl ¶
func (p PlayPolicy) HlsPlaybackUrl(start, end int64, preset string) (url string)
func (PlayPolicy) RtmpLiveUrl ¶
func (p PlayPolicy) RtmpLiveUrl(preset string) (url string)
type PublishPolicy ¶
type PublishPolicy struct { RtmpPublishHost string // required, replace with your customized domain StreamId string // required, format: <zone>.<hub>.<title> StreamPublishKey string // required, a secret key for signing the <publishToken> StreamPublishSecurity string // required, can be "dynamic" or "static" Nonce int64 // optional, for "dynamic" only, default is time.Now().UnixNano() }
func (PublishPolicy) NonceVal ¶
func (p PublishPolicy) NonceVal() (nonce int64)
func (PublishPolicy) Token ¶
func (p PublishPolicy) Token() (token string)
func (PublishPolicy) Url ¶
func (p PublishPolicy) Url() (url string)
type RPC_Client ¶
func (RPC_Client) DelCall ¶
func (r RPC_Client) DelCall(ret interface{}, url string) (err error)
func (RPC_Client) GetCall ¶
func (r RPC_Client) GetCall(ret interface{}, url string) (err error)
func (RPC_Client) Post ¶
func (r RPC_Client) Post(url string, data interface{}) (resp *http.Response, err error)
func (RPC_Client) PostCall ¶
func (r RPC_Client) PostCall(ret interface{}, url string, params interface{}) (err error)
type StreamList ¶
type StreamSegment ¶
type StreamSegmentList ¶
type StreamSegmentList struct {
Segments []*StreamSegment `json:"segments"`
}
Click to show internal directories.
Click to hide internal directories.