Documentation
¶
Index ¶
- func ConvertToMapOfFileCache(convertFiles []*mpi.File) map[string]*model.FileCache
- type FileManagerService
- func (fms *FileManagerService) ClearCache()
- func (fms *FileManagerService) ConfigApply(ctx context.Context, configApplyRequest *mpi.ConfigApplyRequest) (status model.WriteStatus, err error)
- func (fms *FileManagerService) DetermineFileActions(ctx context.Context, currentFiles map[string]*mpi.File, ...) (map[string]*model.FileCache, map[string][]byte, error)
- func (fms *FileManagerService) IsConnected() bool
- func (fms *FileManagerService) Rollback(ctx context.Context, instanceID string) error
- func (fms *FileManagerService) SetIsConnected(isConnected bool)
- func (fms *FileManagerService) UpdateCurrentFilesOnDisk(ctx context.Context, currentFiles map[string]*mpi.File, referenced bool) error
- func (fms *FileManagerService) UpdateFile(ctx context.Context, instanceID string, fileToUpdate *mpi.File) error
- func (fms *FileManagerService) UpdateManifestFile(currentFiles map[string]*mpi.File, referenced bool) (err error)
- func (fms *FileManagerService) UpdateOverview(ctx context.Context, instanceID string, filesToUpdate []*mpi.File, ...) error
- type FileOperator
- func (fo *FileOperator) CreateFileDirectories(ctx context.Context, fileMeta *mpi.FileMeta, filePermission os.FileMode) error
- func (fo *FileOperator) ReadChunk(ctx context.Context, chunkSize uint32, reader *bufio.Reader, chunkID uint32) (mpi.FileDataChunk_Content, error)
- func (fo *FileOperator) Write(ctx context.Context, fileContent []byte, file *mpi.FileMeta) error
- func (fo *FileOperator) WriteChunkedFile(ctx context.Context, file *mpi.File, header *mpi.FileDataChunkHeader, ...) error
- type FilePlugin
- func (fp *FilePlugin) Close(ctx context.Context) error
- func (fp *FilePlugin) Info() *bus.Info
- func (fp *FilePlugin) Init(ctx context.Context, messagePipe bus.MessagePipeInterface) error
- func (fp *FilePlugin) Process(ctx context.Context, msg *bus.Message)
- func (fp *FilePlugin) Subscriptions() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileManagerService ¶
type FileManagerService struct {
// contains filtered or unexported fields
}
func NewFileManagerService ¶
func NewFileManagerService(fileServiceClient mpi.FileServiceClient, agentConfig *config.Config) *FileManagerService
func (*FileManagerService) ClearCache ¶
func (fms *FileManagerService) ClearCache()
func (*FileManagerService) ConfigApply ¶
func (fms *FileManagerService) ConfigApply(ctx context.Context, configApplyRequest *mpi.ConfigApplyRequest, ) (status model.WriteStatus, err error)
func (*FileManagerService) DetermineFileActions ¶
func (fms *FileManagerService) DetermineFileActions( ctx context.Context, currentFiles map[string]*mpi.File, modifiedFiles map[string]*model.FileCache, ) ( map[string]*model.FileCache, map[string][]byte, error, )
DetermineFileActions compares two sets of files to determine the file action for each file. Returns a map of files that have changed and a map of the contents for each updated and deleted file. Key to both maps is file path nolint: revive,cyclop,gocognit
func (*FileManagerService) IsConnected ¶
func (fms *FileManagerService) IsConnected() bool
func (*FileManagerService) Rollback ¶
func (fms *FileManagerService) Rollback(ctx context.Context, instanceID string) error
nolint:revive,cyclop
func (*FileManagerService) SetIsConnected ¶
func (fms *FileManagerService) SetIsConnected(isConnected bool)
func (*FileManagerService) UpdateCurrentFilesOnDisk ¶
func (fms *FileManagerService) UpdateCurrentFilesOnDisk( ctx context.Context, currentFiles map[string]*mpi.File, referenced bool, ) error
UpdateCurrentFilesOnDisk updates the FileManagerService currentFilesOnDisk slice which contains the files currently on disk
func (*FileManagerService) UpdateFile ¶
func (*FileManagerService) UpdateManifestFile ¶
func (fms *FileManagerService) UpdateManifestFile(currentFiles map[string]*mpi.File, referenced bool) (err error)
seems to be a control flag, avoid control coupling nolint: revive
func (*FileManagerService) UpdateOverview ¶
type FileOperator ¶
type FileOperator struct{}
func NewFileOperator ¶
func NewFileOperator() *FileOperator
func (*FileOperator) CreateFileDirectories ¶
func (*FileOperator) ReadChunk ¶
func (fo *FileOperator) ReadChunk( ctx context.Context, chunkSize uint32, reader *bufio.Reader, chunkID uint32, ) (mpi.FileDataChunk_Content, error)
func (*FileOperator) WriteChunkedFile ¶
func (fo *FileOperator) WriteChunkedFile( ctx context.Context, file *mpi.File, header *mpi.FileDataChunkHeader, stream grpc.ServerStreamingClient[mpi.FileDataChunk], ) error
type FilePlugin ¶
type FilePlugin struct {
// contains filtered or unexported fields
}
func NewFilePlugin ¶
func NewFilePlugin(agentConfig *config.Config, grpcConnection grpc.GrpcConnectionInterface) *FilePlugin
func (*FilePlugin) Info ¶
func (fp *FilePlugin) Info() *bus.Info
func (*FilePlugin) Init ¶
func (fp *FilePlugin) Init(ctx context.Context, messagePipe bus.MessagePipeInterface) error
func (*FilePlugin) Subscriptions ¶
func (fp *FilePlugin) Subscriptions() []string
Click to show internal directories.
Click to hide internal directories.