policy

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSchemaCompatibility added in v0.6.0

func CheckSchemaCompatibility(ctx context.Context, chorusVersion string, client redis.UniversalClient) error

func NewService

func NewService(client redis.UniversalClient, queueSVC tasks.QueueService, mainStorage string) *policySvc

Types

type ContextSvc added in v0.6.0

type ContextSvc interface {
	// Sets active policies to proxy request context.
	BuildProxyContext(ctx context.Context, user, bucket string) (context.Context, error)
	// Same as BuildProxyContext but for requests where bucket is not known (e.g. ListBuckets).
	BuildProxyNoBucketContext(ctx context.Context, user string) (context.Context, error)
	// Sets active policies to agent bucket notification request context.
	BuildAgentContext(ctx context.Context, user, bucket string) (context.Context, error)
}

type ReplicationSvc added in v0.6.0

type ReplicationSvc interface {
	// common methods for user and bucket replication policies
	PauseReplication(ctx context.Context, id entity.UniversalReplicationID) error
	ResumeReplication(ctx context.Context, id entity.UniversalReplicationID) error
	GetReplicationPolicyInfoExtended(ctx context.Context, id entity.UniversalReplicationID) (entity.ReplicationStatusExtended, error)

	// user replication policies
	AddUserReplicationPolicy(ctx context.Context, policy entity.UserReplicationPolicy, opts entity.ReplicationOptions) error
	DeleteUserReplication(ctx context.Context, policy entity.UserReplicationPolicy) error
	ListUserReplicationsInfo(ctx context.Context) (map[entity.UserReplicationPolicy]entity.ReplicationStatusExtended, error)
	IsUserReplicationExists(ctx context.Context, user string) (bool, error)

	// bucket replication policies
	AddBucketReplicationPolicy(ctx context.Context, id entity.BucketReplicationPolicy, opts entity.ReplicationOptions) error
	ListBucketReplicationsInfo(ctx context.Context, user string) (map[entity.BucketReplicationPolicy]entity.ReplicationStatusExtended, error)
	DeleteBucketReplication(ctx context.Context, id entity.BucketReplicationPolicy) error
}

type ReplicationSwitchSvc added in v0.6.0

type ReplicationSwitchSvc interface {
	// Upsert downtime replication switch. If switch already exists and not in progress, it will be updated.
	SetDowntimeReplicationSwitch(ctx context.Context, replID entity.UniversalReplicationID, opts *entity.ReplicationSwitchDowntimeOpts) error
	// Change downtime replication switch status. Makes required adjustments to routing and replication policies.
	// According to switch status and configured options.
	UpdateDowntimeSwitchStatus(ctx context.Context, replID entity.UniversalReplicationID, newStatus entity.ReplicationSwitchStatus, description string) error
	// Creates new zero downtime replication switch.
	AddZeroDowntimeReplicationSwitch(ctx context.Context, replID entity.UniversalReplicationID, opts *entity.ReplicationSwitchZeroDowntimeOpts) error
	// Completes zero downtime replication switch.
	CompleteZeroDowntimeReplicationSwitch(ctx context.Context, replID entity.UniversalReplicationID) error
	// Deletes any replication switch if exists and reverts routing policy if switch was not done.
	DeleteReplicationSwitch(ctx context.Context, replID entity.UniversalReplicationID) error
	// Returns replication switch config and status information.
	GetReplicationSwitchInfo(ctx context.Context, replID entity.UniversalReplicationID) (entity.ReplicationSwitchInfo, error)
}

type RoutingSvc added in v0.6.0

type RoutingSvc interface {
	SetUserRouting(ctx context.Context, user string, toStorage string) error
	GetUserRoutings(ctx context.Context) (map[string]string, error)
	GetUserRoutingBlocks(ctx context.Context) (map[string]bool, error)
	DeleteUserRouting(ctx context.Context, user string) error
	BlockUserRouting(ctx context.Context, user string) error
	UnblockUserRouting(ctx context.Context, user string) error

	SetBucketRouting(ctx context.Context, id entity.BucketRoutingPolicyID, toStorage string) error
	GetBucketRoutings(ctx context.Context, user string) (map[string]string, error)
	GetBucketRoutingBlocks(ctx context.Context, user string) (map[string]bool, error)
	DeleteBucketRouting(ctx context.Context, id entity.BucketRoutingPolicyID) error
	BlockBucketRouting(ctx context.Context, id entity.BucketRoutingPolicyID) error
	UnblockBucketRouting(ctx context.Context, id entity.BucketRoutingPolicyID) error
}

Jump to

Keyboard shortcuts

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