silo

package
v1.3.13 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package silo keeps the bytes of the files in Silo, the S3 storage of compose.yaml.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotConfigured = errors.New("S3_ENDPOINT, S3_ACCESS_KEY, S3_SECRET_KEY and S3_BUCKET must be set")

Functions

This section is empty.

Types

type Memory

type Memory struct {
	Objects map[string][]byte
	Written map[string]time.Time // when each key was put; a test moves it back to age an object
	// contains filtered or unexported fields
}

Memory is a Store in a map, for the tests.

func NewMemory

func NewMemory() *Memory

func (*Memory) Get

func (m *Memory) Get(_ context.Context, key string) (io.ReadCloser, error)

func (*Memory) List

func (m *Memory) List(_ context.Context) ([]Object, error)

func (*Memory) Put

func (m *Memory) Put(_ context.Context, key string, data []byte, _ string) error

func (*Memory) Remove

func (m *Memory) Remove(_ context.Context, key string) error

type Object

type Object struct {
	Key     string
	Written time.Time
}

Object is what the store keeps under a key, its bytes left out: purgefiles reads Written to leave alone an upload that may still be running.

type Store

type Store interface {
	Put(ctx context.Context, key string, data []byte, contentType string) error
	Get(ctx context.Context, key string) (io.ReadCloser, error)
	Remove(ctx context.Context, key string) error
	List(ctx context.Context) ([]Object, error)
}

Store is Silo, or Memory in the tests.

func New

func New(ctx context.Context) (Store, error)

New connects to the Silo of the S3_* variables, and makes its bucket on first use. S3_SECURE=true for TLS: Silo is reached on the loopback or the Docker network, in clear.

func Sealed

func Sealed(store Store) Store

Sealed encrypts the bytes put in store with the key of their account, the first part of the key, and decrypts them on Get: the account's key must be loaded.

Jump to

Keyboard shortcuts

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