coder

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package coderは、Coder WebSocket(github.com/coder/websocket) を使ってWebSocket接続を行うためのパッケージです。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(wsURL string, token *websocket.Token) (websocket.Conn, error)

Dialは、WebSocketのコネクションを開きます。

`token` はWebSocket接続時の認証ヘッダーに使用します。

func DialConfig

func DialConfig(c websocket.DialConfig) (websocket.Conn, error)

DialCONFIGは、WebSocketのコネクションを開きます。

`tlsConfig` がnilの場合は無視します。

func DialWithTLS

func DialWithTLS(c websocket.DialConfig) (websocket.Conn, error)

DialWithTLSは、WebSocketのコネクションを開きます。

DEPRECATED: 代わりに `DialConfig` を使用してください。

Types

type Conn

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

Connは、 coder/websocketのConnのラッパーです。

func New

func New(wsconn *cwebsocket.Conn) *Conn

Newは、Connを返却します。

func NewWithUnderlyingConn

func NewWithUnderlyingConn(wsconn *cwebsocket.Conn, conn net.Conn) *Conn

NewWithUnderlyingConnは、underlying connを指定してConnを返却します。

func (*Conn) Close

func (c *Conn) Close() error

Closeは、WebSocketをクローズします。

func (*Conn) CloseWithStatus

func (c *Conn) CloseWithStatus(status transport.CloseStatus) error

CloseWithStatus implements websocket.Conn.

func (*Conn) Ping

func (c *Conn) Ping(ctx context.Context) error

Pingは、WebSocketのPingを送信します。

func (*Conn) Reader

func (c *Conn) Reader(ctx context.Context) (websocket.MessageType, io.Reader, error)

Readerは、WebSocketのReaderを取得します。

func (*Conn) SetUnderlyingConn

func (c *Conn) SetUnderlyingConn(conn net.Conn)

SetUnderlyingConnは、WebSocketの基盤となるnet.Connを設定します。 connがnilの場合、既存の設定は変更されません。

func (*Conn) UnderlyingConn

func (c *Conn) UnderlyingConn() net.Conn

UnderlyingConnは、WebSocketの基盤となるnet.Connを返します。 DialWithTCPCaptureで取得したnet.Connがある場合はそれを返し、ない場合はnilを返します。

func (*Conn) Writer

func (c *Conn) Writer(ctx context.Context, tp websocket.MessageType) (io.WriteCloser, error)

Writerは、WebSocketのWriterを取得します。

type Dialer

type Dialer struct{}

Dialerは、WebSocketのコネクションを開きます。

Jump to

Keyboard shortcuts

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