packet

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CompileInfoHeader = 0
)

Variables

This section is empty.

Functions

func ReadMessage

func ReadMessage(reader io.Reader) (int, []byte, error)

读取消息

func WriteCompileCommand

func WriteCompileCommand(writer io.Writer, cmd *CompileCommand) error

写入编译命令

func WriteCompileFile

func WriteCompileFile(writer io.Writer, data []byte, callback ...func(uint8, float64)) error

分片写入编译文件

func WriteComplieError

func WriteComplieError(writer io.Writer, err error)

写入编译错误响应

func WriteComplieResponse

func WriteComplieResponse(writer io.Writer, resp *ComplieResponse) error

写入编译响应

Types

type CompileCommand

type CompileCommand struct {
	CGO    bool   `json:"cgo"`    // 是否开启CGO
	GOOS   string `json:"goos"`   // 目标操作系统
	GOARCH string `json:"goarch"` // 目标架构
	Output string `json:"output"` // 输出文件名
	Shell  string `json:"shell"`  // 编译前执行的shell脚本
	Size   int64  `json:"size"`   // 压缩文件大小
}

func ParseComplieCommand

func ParseComplieCommand(data []byte) (*CompileCommand, error)

解析编译命令

type ComplieResponse

type ComplieResponse struct {
	Exec string `json:"exec"` // 可执行文件名称
	Size int64  `json:"size"` // 可执行文件大小
	Err  string `json:"err"`  // 错误信息
}

func ParseComplieResponse

func ParseComplieResponse(data []byte) (*ComplieResponse, error)

解析编译响应

Jump to

Keyboard shortcuts

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