storage

package
v0.0.0-...-cf6b9b7 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package storage holds files related to storages for security profiles

Package storage holds files related to storages for security profiles

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityDumpHandler

type ActivityDumpHandler interface {
	HandleActivityDump(dump *api.ActivityDumpStreamMessage)
}

ActivityDumpHandler represents an handler for the activity dumps sent by the probe

type ActivityDumpRemoteStorage

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

ActivityDumpRemoteStorage is a remote storage that forwards dumps to the backend

func (*ActivityDumpRemoteStorage) GetStorageType

func (storage *ActivityDumpRemoteStorage) GetStorageType() config.StorageType

GetStorageType returns the storage type of the ActivityDumpLocalStorage

func (*ActivityDumpRemoteStorage) Persist

func (storage *ActivityDumpRemoteStorage) Persist(request config.StorageRequest, p *profile.Profile, raw *bytes.Buffer) error

Persist saves the provided buffer to the persistent storage

func (*ActivityDumpRemoteStorage) SendTelemetry

func (storage *ActivityDumpRemoteStorage) SendTelemetry(sender statsd.ClientInterface)

SendTelemetry sends telemetry for the current storage

type ActivityDumpRemoteStorageForwarder

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

ActivityDumpRemoteStorageForwarder is a remote storage that forwards dumps to the security-agent

func NewActivityDumpRemoteStorageForwarder

func NewActivityDumpRemoteStorageForwarder(handler ActivityDumpHandler) (*ActivityDumpRemoteStorageForwarder, error)

NewActivityDumpRemoteStorageForwarder returns a new instance of ActivityDumpRemoteStorageForwarder

func (*ActivityDumpRemoteStorageForwarder) GetStorageType

func (storage *ActivityDumpRemoteStorageForwarder) GetStorageType() config.StorageType

GetStorageType returns the storage type of the ActivityDumpRemoteStorage

func (*ActivityDumpRemoteStorageForwarder) Persist

Persist saves the provided buffer to the persistent storage

func (*ActivityDumpRemoteStorageForwarder) SendTelemetry

func (storage *ActivityDumpRemoteStorageForwarder) SendTelemetry(_ statsd.ClientInterface)

SendTelemetry sends telemetry for the current storage

type ActivityDumpStorage

type ActivityDumpStorage interface {
	// GetStorageType returns the storage type
	GetStorageType() config.StorageType
	// Persist saves the provided buffer to the persistent storage
	Persist(request config.StorageRequest, p *profile.Profile, raw *bytes.Buffer) error
	// SendTelemetry sends metrics using the provided metrics sender
	SendTelemetry(sender statsd.ClientInterface)
}

ActivityDumpStorage defines the interface implemented by all activity dump storages

func NewActivityDumpRemoteStorage

func NewActivityDumpRemoteStorage() (ActivityDumpStorage, error)

NewActivityDumpRemoteStorage returns a new instance of ActivityDumpRemoteStorage

type Directory

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

Directory is a local storage for security profiles

func NewDirectory

func NewDirectory(directoryPath string, maxProfiles int) (*Directory, error)

NewDirectory creates a new Directory instance, loading the existing profiles from the provided directory path

func (*Directory) GetStorageType

func (d *Directory) GetStorageType() config.StorageType

GetStorageType returns the storage type

func (*Directory) Load

Load loads the profile for the provided selector if it exists

func (*Directory) Persist

func (d *Directory) Persist(request config.StorageRequest, p *profile.Profile, raw *bytes.Buffer) error

Persist persists the provided profile to the directory

func (*Directory) SendTelemetry

func (d *Directory) SendTelemetry(sender statsd.ClientInterface)

SendTelemetry sends telemetry for the current storage

Jump to

Keyboard shortcuts

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