Documentation ¶
Index ¶
- type Config
- func (c *Config) MergeIn(cfgs ...*Config)
- func (c *Config) WithAPIKey(key string) *Config
- func (c *Config) WithContext(ctx context.Context) *Config
- func (c *Config) WithHTTPClient(client *http.Client) *Config
- func (c *Config) WithPingDuration(dur time.Duration) *Config
- func (c *Config) WithRESTHost(host string) *Config
- func (c *Config) WithSecret(secret string) *Config
- func (c *Config) WithUseSSL(use bool) *Config
- func (c *Config) WithWSSDialer(dialer *websocket.Dialer) *Config
- func (c *Config) WithWSSHost(host string) *Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { RESTHost *string WSSHost *string APIKey *string Secret *string UseSSL *bool PingDuration *time.Duration HTTPClient *http.Client WSSDialer *websocket.Dialer Context context.Context }
Config 是sdk的相关配置
func (*Config) WithAPIKey ¶
WithAPIKey 设置sdk访问的API key
func (*Config) WithContext ¶
WithContext 设置自定义context.Context
func (*Config) WithHTTPClient ¶
WithHTTPClient 设置请求rest接口时的http client
func (*Config) WithPingDuration ¶
WithPingDuration 设置保活消息发送的时间间隔
func (*Config) WithRESTHost ¶
WithRESTHost 设置rest接口的地址
func (*Config) WithSecret ¶
WithSecret 设置sdk访问的Secret
func (*Config) WithUseSSL ¶
WithUseSSL 设置sdk访问rest接口时是否使用https
func (*Config) WithWSSDialer ¶
WithWSSDialer 设置自定义的Websocket dialer
func (*Config) WithWSSHost ¶
WithWSSHost 设置wss接口的地址
Click to show internal directories.
Click to hide internal directories.