client

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// 服务实例
	ChannelService service.ChannelService
	MessageService service.MessageService
	// contains filtered or unexported fields
}

Client 主客户端结构

func NewClient

func NewClient(opts ...Option) *Client

NewClient 创建新客户端

type Config

type Config struct {
	BaseURL     string
	AccessToken string
	Timeout     time.Duration
	RetryCount  int
	Debug       bool
}

Config 客户端配置

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig 默认配置

type Option

type Option func(*Config)

Option 配置选项函数类型

func WithBaseURL

func WithBaseURL(url string) Option

WithBaseURL 设置基础 URL

func WithDebug

func WithDebug(debug bool) Option

WithDebug 启用调试模式

func WithRetryCount

func WithRetryCount(count int) Option

WithRetryCount 设置重试次数

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout 设置超时时间

func WithToken

func WithToken(token string) Option

WithToken 设置访问令牌

Jump to

Keyboard shortcuts

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