rpcutil

package module
v0.0.0-...-094e1e4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUnexpectedIfError

func IsUnexpectedIfError(err error) bool

func ReadProto

func ReadProto(r io.Reader, m proto.Message) error

func ReadString

func ReadString(r io.Reader) (string, error)

func UnexpectedIfError

func UnexpectedIfError(err error) error

func WriteCommandType

func WriteCommandType(w io.Writer, commandType CommandType) error

func WriteInvalid

func WriteInvalid(w io.Writer, err error) error

func WriteOK

func WriteOK(w io.Writer) error

func WriteProto

func WriteProto(w io.Writer, m proto.Message) error

func WriteString

func WriteString(w io.Writer, str string) error

Types

type CommandType

type CommandType = int8
const (
	CommandPing CommandType = iota

	CommandReset

	CommandList
	CommandOpen

	CommandUpload
	CommandUploadDirItem
	CommandTouch

	CommandUploadV2File
	CommandUploadV2Dir

	CommandUploadStart
	CommandUploadStartDir
	CommandUploadV3File
	CommandUploadEndDir

	CommandDownload

	CommandCat

	CommandBranchCheckout
	CommandBranchInfo
	CommandBranchList
)

func ReadCommandType

func ReadCommandType(r io.Reader) (commandType CommandType, err error)

type Status

type Status = int8
const (
	EOK       Status = 0
	ENotExist Status = 1
	EInvalid  Status = 0xF
)

func ReadStatus

func ReadStatus(r io.Reader) (status Status, errMsg string, err error)

type UnexpectedError

type UnexpectedError struct {
	Err error
}

func (*UnexpectedError) Error

func (e *UnexpectedError) Error() string

Jump to

Keyboard shortcuts

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