s3

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 21 Imported by: 0

README

S3 Storage Implementation

Please head over to the S3 Storage Implementation documentation for more information.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidConfig is returned if the S3 configuration is invalid.
	ErrInvalidConfig = errors.New("invalid S3 configuration")

	// ErrBucketNotFound is returned if the specified bucket does not exist.
	ErrBucketNotFound = errors.New("bucket not found")

	// ErrS3EndpointMissingScheme is returned if the S3 endpoint does not include a scheme.
	ErrS3EndpointMissingScheme = errors.New("S3 endpoint must include scheme (http:// or https://)")
)

Functions

func Example

func Example()

Example demonstrates how to use the S3 storage implementation with AWS S3.

func ExampleMinIO

func ExampleMinIO()

ExampleMinIO demonstrates how to use the S3 storage with MinIO.

Types

type Store

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

Store represents an S3 store and implements storage.Store.

func New

func New(ctx context.Context, cfg s3.Config) (*Store, error)

New creates a new S3 store with the given configuration.

func (*Store) DeleteNar

func (s *Store) DeleteNar(ctx context.Context, narURL nar.URL) error

DeleteNar deletes the nar from the store.

func (*Store) DeleteNarInfo

func (s *Store) DeleteNarInfo(ctx context.Context, hash string) error

DeleteNarInfo deletes the narinfo from the store.

func (*Store) DeleteSecretKey

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

DeleteSecretKey deletes the secret key in the store.

func (*Store) GetNar

func (s *Store) GetNar(ctx context.Context, narURL nar.URL) (int64, io.ReadCloser, error)

GetNar returns nar from the store. NOTE: The caller must close the returned io.ReadCloser!

func (*Store) GetNarInfo

func (s *Store) GetNarInfo(ctx context.Context, hash string) (*narinfopkg.NarInfo, error)

GetNarInfo returns narinfo from the store.

func (*Store) GetSecretKey

func (s *Store) GetSecretKey(ctx context.Context) (signature.SecretKey, error)

GetSecretKey returns secret key from the store.

func (*Store) HasNar

func (s *Store) HasNar(ctx context.Context, narURL nar.URL) bool

HasNar returns true if the store has the nar.

func (*Store) HasNarInfo

func (s *Store) HasNarInfo(ctx context.Context, hash string) bool

HasNarInfo returns true if the store has the narinfo.

func (*Store) HasNarinfoDir added in v0.9.1

func (s *Store) HasNarinfoDir(ctx context.Context) (bool, error)

HasNarinfoDir checks if any objects exist under the given prefix.

func (*Store) PutNar

func (s *Store) PutNar(ctx context.Context, narURL nar.URL, body io.Reader) (int64, error)

PutNar puts the nar in the store.

func (*Store) PutNarInfo

func (s *Store) PutNarInfo(ctx context.Context, hash string, narInfo *narinfopkg.NarInfo) error

PutNarInfo puts the narinfo in the store.

func (*Store) PutSecretKey

func (s *Store) PutSecretKey(ctx context.Context, sk signature.SecretKey) error

PutSecretKey stores the secret key in the store.

func (*Store) WalkNarInfos added in v0.8.0

func (s *Store) WalkNarInfos(ctx context.Context, fn func(hash string) error) error

WalkNarInfos walks all narinfos in the store and calls fn for each one.

func (*Store) WalkNars added in v0.9.2

func (s *Store) WalkNars(ctx context.Context, fn func(narURL nar.URL) error) error

WalkNars walks all NAR files in the store and calls fn for each one.

Jump to

Keyboard shortcuts

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