config

package
v0.0.0-...-f37401a Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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) MergeIn

func (c *Config) MergeIn(cfgs ...*Config)

MergeIn 用于合并多个配置

func (*Config) WithAPIKey

func (c *Config) WithAPIKey(key string) *Config

WithAPIKey 设置sdk访问的API key

func (*Config) WithContext

func (c *Config) WithContext(ctx context.Context) *Config

WithContext 设置自定义context.Context

func (*Config) WithHTTPClient

func (c *Config) WithHTTPClient(client *http.Client) *Config

WithHTTPClient 设置请求rest接口时的http client

func (*Config) WithPingDuration

func (c *Config) WithPingDuration(dur time.Duration) *Config

WithPingDuration 设置保活消息发送的时间间隔

func (*Config) WithRESTHost

func (c *Config) WithRESTHost(host string) *Config

WithRESTHost 设置rest接口的地址

func (*Config) WithSecret

func (c *Config) WithSecret(secret string) *Config

WithSecret 设置sdk访问的Secret

func (*Config) WithUseSSL

func (c *Config) WithUseSSL(use bool) *Config

WithUseSSL 设置sdk访问rest接口时是否使用https

func (*Config) WithWSSDialer

func (c *Config) WithWSSDialer(dialer *websocket.Dialer) *Config

WithWSSDialer 设置自定义的Websocket dialer

func (*Config) WithWSSHost

func (c *Config) WithWSSHost(host string) *Config

WithWSSHost 设置wss接口的地址

Jump to

Keyboard shortcuts

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