signal

package
v0.0.0-...-61b8474 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Candidate

type Candidate = signaling.Candidate

type Client

type Client interface {
	// Publish 将消息发布到指定的主题
	Publish(ctx context.Context, message *Message) error

	// Subscribe 订阅指定主题的消息,并提供一个处理函数来处理收到的消息
	Subscribe(ctx context.Context, topic string, handler func(*Message) error) error

	// Unsubscribe 取消订阅指定主题的消息
	Unsubscribe(ctx context.Context, topic string) error

	// Close 关闭客户端连接
	Close() error
}

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

func WithClientName

func WithClientName(name string) ClientOption

WithClientName 返回一个设置客户端名称的选项

type Credentials

type Credentials = signaling.Credentials

type Message

type Message = signaling.Message

type SignalingClient

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

func NewClient

func NewClient(addr string, opts ...ClientOption) (*SignalingClient, error)

func NewClientWithDialer

func NewClientWithDialer(bufDialer func(context.Context, string) (net.Conn, error), opts ...ClientOption) (*SignalingClient, error)

NewClientWithDialer 本地调试使用 bufDialer 来创建一个 gRPC 客户端

func (*SignalingClient) Close

func (c *SignalingClient) Close() error

func (*SignalingClient) Publish

func (c *SignalingClient) Publish(ctx context.Context, message *Message) error

func (*SignalingClient) Subscribe

func (c *SignalingClient) Subscribe(ctx context.Context, topic string, handler func(*Message) error) error

func (*SignalingClient) Unsubscribe

func (c *SignalingClient) Unsubscribe(ctx context.Context, topic string) error

Jump to

Keyboard shortcuts

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