file

package
v3.0.0-...-0f0c0e2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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(currentFiles, modifiedFiles map[string]*mpi.File) (
	map[string]*mpi.File, 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

func (*FileManagerService) Rollback

func (fms *FileManagerService) Rollback(ctx context.Context, instanceID string) error

func (*FileManagerService) SetIsConnected

func (fms *FileManagerService) SetIsConnected(isConnected bool)

func (*FileManagerService) UpdateCurrentFilesOnDisk

func (fms *FileManagerService) UpdateCurrentFilesOnDisk(currentFiles map[string]*mpi.File)

UpdateCurrentFilesOnDisk updates the FileManagerService currentFilesOnDisk slice which contains the files currently on disk

func (*FileManagerService) UpdateFile

func (fms *FileManagerService) UpdateFile(
	ctx context.Context,
	instanceID string,
	fileToUpdate *mpi.File,
) error

func (*FileManagerService) UpdateOverview

func (fms *FileManagerService) UpdateOverview(
	ctx context.Context,
	instanceID string,
	filesToUpdate []*mpi.File,
	iteration int,
) error

type FileOperator

type FileOperator struct{}

func NewFileOperator

func NewFileOperator() *FileOperator

func (*FileOperator) Write

func (fo *FileOperator) Write(ctx context.Context, fileContent []byte, file *mpi.FileMeta) error

type FilePlugin

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

func NewFilePlugin

func NewFilePlugin(agentConfig *config.Config, grpcConnection grpc.GrpcConnectionInterface) *FilePlugin

func (*FilePlugin) Close

func (fp *FilePlugin) Close(ctx context.Context) error

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) Process

func (fp *FilePlugin) Process(ctx context.Context, msg *bus.Message)

func (*FilePlugin) Subscriptions

func (fp *FilePlugin) Subscriptions() []string

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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