socketrpc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ResponseTimout = time.Second

Variables

View Source
var (
	CmdStatus         = byte(0x1)
	CmdScanAll        = byte(0x2)
	CmdUploadFile     = byte(0x5)
	CmdAddDir         = byte(0x10)
	CmdRmDir          = byte(0x11)
	CmdCreateAlbum    = byte(0x20)
	CmdShowAlbum      = byte(0x21)
	CmdAddAlbum       = byte(0x22)
	CmdDownloadAlbum  = byte(0x23)
	CmdExit           = byte(0xFF)
	ErrOk             = byte(0x0)
	ErrGeneric        = byte(0x1)
	ErrUnknownCmd     = byte(0x2)
	ErrUnsupportedCmd = byte(0x3)
	ErrWrongArgs      = byte(0x4)
	ErrFileNotFound   = byte(0x5)
)

Functions

This section is empty.

Types

type RPCClient

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

func NewRPCClient

func NewRPCClient() (*RPCClient, error)

func (*RPCClient) Close

func (c *RPCClient) Close()

func (*RPCClient) SendMessage

func (c *RPCClient) SendMessage(cmd byte, jsonMsg string) (string, error)

type RPCServer

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

func NewRPCServer

func NewRPCServer() RPCServer

func (*RPCServer) Close

func (s *RPCServer) Close()

func (*RPCServer) RegisterCallback

func (s *RPCServer) RegisterCallback(cmd byte, f func(string) (byte, string)) error

func (*RPCServer) Start

func (s *RPCServer) Start()

func (*RPCServer) WaitForExit

func (s *RPCServer) WaitForExit()

type UploadFileRequest

type UploadFileRequest struct {
	Paths []string `json:"paths"`
	Album string   `json:"album"`
}

Jump to

Keyboard shortcuts

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