policer

package
v0.38.5 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuryFunc added in v0.37.0

type BuryFunc func(context.Context, oid.Address) error

BuryFunc is the function to bury (i.e. inhume) an object.

type KeySpaceIterator added in v0.37.0

type KeySpaceIterator interface {
	Next(context.Context, uint32) ([]objectcore.AddressWithType, error)
	Rewind()
}

KeySpaceIterator is the interface that allows iterating over the key space of local storage. Note that the underlying implementation might be circular: i.e. it can restart when the end of the key space is reached.

type MetricsRegister added in v0.38.0

type MetricsRegister interface {
	IncProcessedObjects()
}

type Option

type Option func(*cfg)

Option is an option for Policer constructor.

func WithBuryFunc added in v0.37.0

func WithBuryFunc(f BuryFunc) Option

func WithContainerSource

func WithContainerSource(v container.Source) Option

WithContainerSource returns option to set container source of Policer.

func WithHeadTimeout

func WithHeadTimeout(v time.Duration) Option

WithHeadTimeout returns option to set Head timeout of Policer.

func WithKeySpaceIterator added in v0.37.0

func WithKeySpaceIterator(it KeySpaceIterator) Option

func WithLogger

func WithLogger(v *logger.Logger) Option

WithLogger returns option to set Logger of Policer.

func WithMetrics added in v0.38.0

func WithMetrics(m MetricsRegister) Option

WithMetrics returns option to set metrics.

func WithNetmapKeys

func WithNetmapKeys(v netmap.AnnouncedKeys) Option

WithNetmapKeys returns option to set tool to work with announced public keys.

func WithPlacementBuilder

func WithPlacementBuilder(v placement.Builder) Option

WithPlacementBuilder returns option to set object placement builder of Policer.

func WithPool

func WithPool(p *ants.Pool) Option

WithPool returns option to set pool for policy and replication operations.

func WithRedundantCopyCallback

func WithRedundantCopyCallback(cb RedundantCopyCallback) Option

WithRedundantCopyCallback returns option to set callback to pass redundant local object copies detected by Policer.

func WithRemoteObjectHeaderFunc added in v0.37.0

func WithRemoteObjectHeaderFunc(v RemoteObjectHeaderFunc) Option

WithRemoteObjectHeader returns option to set object header receiver of Policer.

func WithReplicator

func WithReplicator(v Replicator) Option

WithReplicator returns option to set object replicator of Policer.

type Policer

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

Policer represents the utility that verifies compliance with the object storage policy.

func New

func New(opts ...Option) *Policer

New creates, initializes and returns Policer instance.

func (*Policer) Run

func (p *Policer) Run(ctx context.Context)

type RedundantCopyCallback

type RedundantCopyCallback func(context.Context, oid.Address)

RedundantCopyCallback is a callback to pass the redundant local copy of the object.

type RemoteObjectHeaderFunc added in v0.37.0

type RemoteObjectHeaderFunc func(context.Context, netmapSDK.NodeInfo, oid.Address) (*objectSDK.Object, error)

RemoteObjectHeaderFunc is the function to obtain HEAD info from a specific remote node.

type Replicator added in v0.37.0

type Replicator interface {
	HandleTask(ctx context.Context, task replicator.Task, res replicator.TaskResult)
}

Replicator is the interface to a consumer of replication tasks.

Jump to

Keyboard shortcuts

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