attachments

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 15 Imported by: 0 modules, 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 attachments owns the ephemeral server attachment spool.

Index

Constants

View Source
const DiskFloorBytes uint64 = 1 << 30
View Source
const Expiry = 30 * time.Minute
View Source
const MaxFileBytes int64 = 100 << 20
View Source
const MaxTransfers = 8

Variables

This section is empty.

Functions

This section is empty.

Types

type Capacity

type Capacity struct{ Free, Total uint64 }

Capacity describes space available to this server on the spool volume.

type Download

type Download struct {
	io.ReadCloser
	Ref protocol.Attachment
}

type Error

type Error struct {
	Status int
	Code   string
}

func (*Error) Error

func (e *Error) Error() string

type Owner

type Owner struct{ Project, Registration, Token string }

type Store

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

func Open

func Open(directory string) (*Store, error)

func (*Store) Bind

func (s *Store) Bind(owner Owner, id, recipient string, sequence uint64) (*protocol.Attachment, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Delete

func (s *Store) Delete(id, reason string)

func (*Store) DeleteOwned

func (s *Store) DeleteOwned(owner Owner, id string, bindingSequence uint64)

func (*Store) DiskCapacity

func (s *Store) DiskCapacity() (Capacity, error)

func (*Store) Enabled

func (s *Store) Enabled() bool

func (*Store) Get

func (s *Store) Get(project, recipient, id string) (*Download, error)

func (*Store) SetEnabled

func (s *Store) SetEnabled(enabled bool)

func (*Store) Upload

func (s *Store) Upload(ctx context.Context, owner Owner, name string, size int64, body io.Reader) (protocol.Attachment, error)

Jump to

Keyboard shortcuts

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