Documentation
¶
Index ¶
- func ApplyOperation(rootDir string, op *FileOperationMessage) error
- func BuildFileManifest(rootDir string, ignorer *PathIgnorer) (map[string]string, error)
- func ComputeFileHash(filePath string) (string, error)
- type Client
- type ClientConfig
- type FileContentMessage
- type FileOperationMessage
- type FileRequestMessage
- type ManifestMessage
- type MessageType
- type MessageWrapper
- type OperationType
- type PathIgnorer
- type SafeConn
- type Server
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyOperation ¶
func ApplyOperation(rootDir string, op *FileOperationMessage) error
func BuildFileManifest ¶
func BuildFileManifest(rootDir string, ignorer *PathIgnorer) (map[string]string, error)
func ComputeFileHash ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(cfg ClientConfig) (*Client, error)
type ClientConfig ¶
type FileContentMessage ¶
type FileOperationMessage ¶
type FileOperationMessage struct {
Op OperationType `json:"op"`
Path string `json:"path"`
Content []byte `json:"content"`
IsDir bool `json:"is_dir,omitempty"`
}
type FileRequestMessage ¶
type FileRequestMessage struct {
Paths []string `json:"paths"`
}
type ManifestMessage ¶
type MessageType ¶
type MessageType string
const ( TypeManifest MessageType = "manifest" TypeFileRequest MessageType = "file_request" TypeFileContent MessageType = "file_content" TypeFileOperation MessageType = "file_operation" )
type MessageWrapper ¶
type MessageWrapper struct {
Type MessageType `json:"type"`
Payload json.RawMessage `json:"payload"`
}
type OperationType ¶
type OperationType string
const ( OpWrite OperationType = "write" OpRemove OperationType = "remove" )
type PathIgnorer ¶
type PathIgnorer struct {
// contains filtered or unexported fields
}
func NewPathIgnorer ¶
func NewPathIgnorer(ignoreStr string) *PathIgnorer
func (*PathIgnorer) IsIgnored ¶
func (pi *PathIgnorer) IsIgnored(path string) bool
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(cfg ServerConfig) (*Server, error)
type ServerConfig ¶
Click to show internal directories.
Click to hide internal directories.