agora

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2025 License: MIT Imports: 9 Imported by: 0

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

type GatewayErr struct {
	Code int
	Msg  string
}

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

func NewRetryErr(needRetry bool, err error) *RetryErr

func (*RetryErr) Error

func (r *RetryErr) Error() string

func (*RetryErr) NeedRetry

func (r *RetryErr) NeedRetry() bool

func (*RetryErr) Unwrap

func (r *RetryErr) Unwrap() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL