gorilla

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package gorillaは、Gorilla WebSocket(https://github.com/gorilla/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 DialWithTLS added in v0.11.0

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

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

`token` はWebSocket接続時の認証ヘッダーに使用します。 `tlsConfig` がnilの場合は無視します。

Types

type Conn

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

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

func New

func New(wsconn *gwebsocket.Conn) *Conn

Newは、Connを返却します。

func (*Conn) Close

func (c *Conn) Close() error

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

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) 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