secret

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store manages storage and retrieval of Spec objects in a MongoDB collection.

func NewStore

func NewStore(collection *mongo.Collection) *Store

NewStore creates a new Store with the specified MongoDB collection.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, secrets ...*secret.Secret) (int, error)

Delete removes Specs from the store based on the provided criteria.

func (*Store) Index

func (s *Store) Index(ctx context.Context) error

Index ensures the collection has the required indexes and updates them if necessary.

func (*Store) Load

func (s *Store) Load(ctx context.Context, secrets ...*secret.Secret) ([]*secret.Secret, error)

Load retrieves Specs from the store that match the given criteria.

func (*Store) Store

func (s *Store) Store(ctx context.Context, secrets ...*secret.Secret) (int, error)

Store saves the given Specs into the database.

func (*Store) Swap

func (s *Store) Swap(ctx context.Context, secrets ...*secret.Secret) (int, error)

Swap updates existing Specs in the database with the provided data.

func (*Store) Watch

func (s *Store) Watch(ctx context.Context, secrets ...*secret.Secret) (secret.Stream, error)

Watch returns a Stream that monitors changes matching the specified filter.

type Stream

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

Stream represents a MongoDB change stream for tracking Spec changes.

func (*Stream) Close

func (s *Stream) Close() error

Close closes the stream and releases any resources.

func (*Stream) Done

func (s *Stream) Done() <-chan struct{}

Done returns a channel that is closed when the stream is closed.

func (*Stream) Next

func (s *Stream) Next() <-chan resource.Event

Next returns a channel for receiving events from the stream.

Jump to

Keyboard shortcuts

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