mobileqq

package
v0.0.0-...-d85f73f Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PackageName    = "goqq" + PackageSuffix
	PackageSuffix  = "-dev"
	PackageVersion = "v0.0.0+100" + PackageSuffix
)

Variables

View Source
var ConfigYAML = fmt.Sprintf(`# Go MobileQQ API Configuration Template

accounts:
  - username: 10000
    password: 123456
    botToken: 10000:ABC-DEF1234ghIkl-zyx57W2v1u123ew11

configs:
  auth:
    address: localhost:0
    captcha: true
  database:
    dataSourceName: goqqd.db?parseTime=true
    driverName: sqlite3
  deviceInfo:
    randomSeed: %d
  logLevel: info
  protocol: android

servers:
  endpoints:
    - socket://msfwifi.3g.qq.com:8080
    - socket://msfwifiv6.3g.qq.com:8080
  forceIPv6: false
  overwrite: false

targets:
  - peerId: 0
    userId: 10000
`, time.Now().UnixNano())

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opt *Options) *Client

func (*Client) GetClient

func (c *Client) GetClient() *client.Client

func (*Client) Run

func (c *Client) Run(
	ctx context.Context,
	run func(ctx context.Context, once bool, restart chan struct{}) error,
) (err error)

type ClientConfig

type ClientConfig struct {
	BaseDir  string
	CacheDir string

	Engine *config.Config
}

func NewClientConfig

func NewClientConfig() *ClientConfig

func NewClientConfigForAndroid

func NewClientConfigForAndroid() *ClientConfig

func NewClientConfigForAndroidTablet

func NewClientConfigForAndroidTablet() *ClientConfig

func NewClientConfigFromViper

func NewClientConfigFromViper() *ClientConfig

type Config

type Config struct {
	Accounts []struct {
		Username string `json:"username"`
		Password string `json:"password"`
		BotToken string `json:"botToken"`
	} `json:"accounts"`
	Configs struct {
		Auth struct {
			Address string `json:"address"`
			Captcha bool   `json:"captcha"`
		} `json:"auth"`
		Database struct {
			DataSourceName string `json:"dataSourceName"`
			DriverName     string `json:"driverName"`
		} `json:"database"`
		DeviceInfo struct {
			RandomSeed int64 `json:"randomSeed"`
		} `json:"deviceInfo"`
		LogLevel string `json:"logLevel"`
		Protocol string `json:"protocol"`
	} `json:"configs"`
	Servers *struct {
		Endpoints []string `json:"endpoints,omitempty"`
		ForceIPv6 bool     `json:"forceIPv6,omitempty"`
		Overwrite bool     `json:"overwrite,omitempty"`
	} `json:"servers,omitempty"`
	Targets []*struct {
		ChatID string `json:"chatId,omitempty"`
		PeerID int64  `json:"peerId,omitempty"`
		UserID int64  `json:"ueerId,omitempty"`
	} `json:"targets,omitempty"`
}

type Options

type Options struct {
	BaseDir  string
	CacheDir string
	LogDir   string
	LogLevel string
	Client   *ClientConfig
	Engine   *rpc.Config
}

Directories

Path Synopsis
db
tcp

Jump to

Keyboard shortcuts

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