transport

package
v0.0.0-...-20f6f52 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package transport defines and implementing Conn to Discord.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	Write(ctx context.Context, opcode uint32, data []byte) error
	Read(ctx context.Context) (opcode uint32, data []byte, err error)
	Close() error
}

Conn to discord.

func New

func New(ctx context.Context, opts Options) (Conn, error)

New opens new IPC Conn and returns it.

type Options

type Options struct {
	// Dialer used to connect to IPC (only on unix).
	Dialer net.Dialer
	// Conn can be used if you already have connected to Discord and just need transport wrap.
	Conn net.Conn
	// DisableInstanceLookup disables automatic Discord client lookup and only tries to connect to InstanceID.
	DisableInstanceLookup bool
	// InstanceID is variable that you can use to handle specific Discord clients. Used only if DisableInstanceLookup is true.
	// Alternative to DISCORD_INSTANCE_ID.
	// https://discord.com/developers/docs/game-sdk/getting-started#testing-locally-with-two-clients-environment-variable-example
	InstanceID uint
}

Options ...

Jump to

Keyboard shortcuts

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