websocketfile

package
v0.0.0-...-ac2a657 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Open client side file from server side over websocket

Index

Constants

This section is empty.

Variables

View Source
var ErrResponse = errors.New("ErrResponse")

Functions

This section is empty.

Types

type Command

type Command struct {
	Command   CommandType            `json:"command"`   // command type
	Param     map[string]interface{} `json:"param"`     // command param
	RequestId string                 `json:"requestId"` // requestId for check response
}

type CommandType

type CommandType int32
const (
	CommandTypeReadAt CommandType = 1
	CommandTypeSize   CommandType = 2
	CommandTypeName   CommandType = 3
	CommandTypeDone   CommandType = 4
)

type WebsocketFile

type WebsocketFile interface {
	io.ReaderAt
	io.Reader
	Size() (int64, error)
	Name() (string, error)
	Done(p map[string]interface{}) error
}

func NewWebsocketFile

func NewWebsocketFile(w http.ResponseWriter, r *http.Request) (WebsocketFile, error)

Jump to

Keyboard shortcuts

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