Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildUserAgent ¶
func BuildUserAgent() string
BuildUserAgent returns the user agent string used by the application. e.g. "AgoraRESTClient Language/go LanguageVersion/1.22.2 Arch/arm64 OS/darwin SDKVersion/0.0.2"
Types ¶
type BaseResponse ¶
type BaseResponse struct {
// HTTP Raw response
RawResponse *http.Response
// Raw body of the response
RawBody []byte
// HTTP status code
HttpStatusCode int
}
@brief HTTP response
@since v0.7.0
func (*BaseResponse) GetRequestID ¶
func (r *BaseResponse) GetRequestID() string
@brief Get the request ID from the response
@since v0.7.0
func (*BaseResponse) UnmarshalToTarget ¶
func (r *BaseResponse) UnmarshalToTarget(target interface{}) error
UnmarshalToTarget unmarshal body into target var successful if err is nil
type Config ¶
type Config struct {
// Agora AppID
AppID string
// Timeout for HTTP requests
HttpTimeout time.Duration
// Credential for accessing the Agora service.
//
// Available credential types:
//
// - BasicAuthCredential: See auth.NewBasicAuthCredential for details
Credential auth.Credential
// Domain area for the REST Client. See domain.Area for details.
DomainArea domain.Area
// Logger for the REST Client
//
// Implement the log.Logger interface in your project to output REST Client logs to your logging component.
//
// Alternatively, you can use the default logging component. See log.NewDefaultLogger for details.
Logger log.Logger
}
type GatewayErr ¶
func NewGatewayErr ¶
func NewGatewayErr(code int, msg string) *GatewayErr
func (*GatewayErr) Error ¶
func (g *GatewayErr) Error() string
type InternalErr ¶
type InternalErr struct {
ErrMsg string
}
func NewInternalErr ¶
func NewInternalErr(msg string) *InternalErr
func (*InternalErr) Error ¶
func (i *InternalErr) Error() string
type ResponseInterface ¶
type ResponseInterface interface {
IsSuccess() bool
}
type RetryErr ¶
type RetryErr struct {
Err error
// contains filtered or unexported fields
}
func NewRetryErr ¶
Click to show internal directories.
Click to hide internal directories.