pbcmd

package
v0.0.0-...-6ac6f58 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCM cache.Manager

Functions

func FilepathMapping

func FilepathMapping(inputfile string, basedir string, relativedir string) (string, string, error)

FilepathMapping return relativepath, abspath, error

func InitHandlers

func InitHandlers()

InitHandlers init handlers

Types

type Handle4DispatchReq

type Handle4DispatchReq struct {
}

Handle4DispatchReq handler for dispatch task request

func NewHandle4DispatchReq

func NewHandle4DispatchReq() *Handle4DispatchReq

NewHandle4DispatchReq return Handle4DispatchReq

func (*Handle4DispatchReq) Handle

func (h *Handle4DispatchReq) Handle(
	client *protocol.TCPClient,
	head *dcProtocol.PBHead,
	body interface{},
	receivedtime time.Time,
	basedir string,
	cmdreplacerules []dcConfig.CmdReplaceRule,
	id *longtcp.MessageID,
	s *longtcp.Session) error

Handle to handle this cmd

func (*Handle4DispatchReq) ReceiveBody

func (h *Handle4DispatchReq) ReceiveBody(client *protocol.TCPClient,
	head *dcProtocol.PBHead,
	basedir string,
	c chan<- string) (interface{}, error)

ReceiveBody receive body for this cmd

type Handle4FileCache

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

Handle4FileCache describe the file cache handler in remote worker

func NewHandle4FileCache

func NewHandle4FileCache() *Handle4FileCache

NewHandle4FileCache get a new file cache handler

func (*Handle4FileCache) Handle

func (h *Handle4FileCache) Handle(client *protocol.TCPClient,
	head *dcProtocol.PBHead,
	body interface{},
	receivedtime time.Time,
	_ string,
	_ []dcConfig.CmdReplaceRule,
	id *longtcp.MessageID,
	s *longtcp.Session) error

Handle handle the request

func (*Handle4FileCache) ReceiveBody

func (h *Handle4FileCache) ReceiveBody(client *protocol.TCPClient,
	head *dcProtocol.PBHead,
	basedir string,
	c chan<- string) (interface{}, error)

ReceiveBody receive body for this cmd

type Handle4SendFile

type Handle4SendFile struct {
}

Handle4SendFile handler for send file

func NewHandle4SendFile

func NewHandle4SendFile() *Handle4SendFile

NewHandle4SendFile return Handle4DispatchReq

func (*Handle4SendFile) Handle

func (h *Handle4SendFile) Handle(client *protocol.TCPClient,
	head *dcProtocol.PBHead,
	body interface{},
	receivedtime time.Time,
	basedir string,
	cmdreplacerules []dcConfig.CmdReplaceRule,
	id *longtcp.MessageID,
	s *longtcp.Session) error

Handle to handle this cmd

func (*Handle4SendFile) ReceiveBody

func (h *Handle4SendFile) ReceiveBody(client *protocol.TCPClient,
	head *dcProtocol.PBHead,
	basedir string,
	c chan<- string) (interface{}, error)

ReceiveBody receive body for this cmd

type Handle4SyncTime

type Handle4SyncTime struct {
}

Handle4SyncTime handler for dispatch task request

func NewHandle4SyncTime

func NewHandle4SyncTime() *Handle4SyncTime

NewHandle4SyncTime return Handle4SyncTime

func (*Handle4SyncTime) Handle

func (h *Handle4SyncTime) Handle(client *protocol.TCPClient,
	head *dcProtocol.PBHead,
	body interface{},
	receivedtime time.Time,
	basedir string,
	cmdreplacerules []dcConfig.CmdReplaceRule,
	id *longtcp.MessageID,
	s *longtcp.Session) error

Handle to handle this cmd

func (*Handle4SyncTime) ReceiveBody

func (h *Handle4SyncTime) ReceiveBody(client *protocol.TCPClient,
	head *dcProtocol.PBHead,
	basedir string,
	c chan<- string) (interface{}, error)

ReceiveBody receive body for this cmd

type Handle4Unknown

type Handle4Unknown struct {
}

Handle4Unknown handler for unknown request

func NewHandle4Unknown

func NewHandle4Unknown() *Handle4Unknown

NewHandle4Unknown return Handle4Unknown

func (*Handle4Unknown) Handle

func (h *Handle4Unknown) Handle(
	client *protocol.TCPClient,
	head *dcProtocol.PBHead,
	body interface{},
	receivedtime time.Time,
	basedir string,
	cmdreplacerules []dcConfig.CmdReplaceRule,
	id *longtcp.MessageID,
	s *longtcp.Session) error

Handle to handle this cmd

func (*Handle4Unknown) ReceiveBody

func (h *Handle4Unknown) ReceiveBody(client *protocol.TCPClient,
	head *dcProtocol.PBHead,
	basedir string,
	c chan<- string) (interface{}, error)

ReceiveBody receive body for this cmd

type Handler

type Handler interface {
	ReceiveBody(client *protocol.TCPClient,
		head *dcProtocol.PBHead,
		basedir string,
		c chan<- string) (interface{}, error)
	Handle(client *protocol.TCPClient,
		head *dcProtocol.PBHead,
		body interface{},
		receivedtime time.Time,
		basedir string,
		cmdreplacerules []dcConfig.CmdReplaceRule,
		id *longtcp.MessageID,
		s *longtcp.Session) error
}

Handler describe

func GetHandler

func GetHandler(key dcProtocol.PBCmdType) Handler

GetHandler return handle by type

Jump to

Keyboard shortcuts

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