Help us shape the future of Go! Take the 2026 Go Developer Survey

artifact

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const MaxSize int64 = 1 << 20
View Source
const MaxTenantSize int64 = 256 << 20

Variables

View Source
var ErrContent = errors.New("artifact content is not permitted")
View Source
var ErrQuota = errors.New("artifact storage limit reached")

Functions

func SanitizeTextLog

func SanitizeTextLog(data []byte) []byte

Types

type ArtifactStore

type ArtifactStore interface {
	PutTenantArtifact(context.Context, Metadata, io.Reader) (Metadata, error)
	GetMetadata(context.Context, domain.Actor, string) (Metadata, error)
	AuthoriseDownload(context.Context, domain.Actor, string) (io.ReadCloser, error)
	DeleteByRetention(context.Context, string, time.Time) (int, error)
}

type Local

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

func NewLocal

func NewLocal(db *store.Store, directory string) (*Local, error)

func (*Local) Close

func (s *Local) Close() error

func (*Local) DeleteByRetention

func (s *Local) DeleteByRetention(ctx context.Context, orgID string, before time.Time) (int, error)

func (*Local) MetadataTx

func (s *Local) MetadataTx(ctx context.Context, tx pgx.Tx, a domain.Actor, id string) (Metadata, error)

func (*Local) Open

func (s *Local) Open(m Metadata) (io.ReadCloser, error)

func (*Local) Prepare

func (s *Local) Prepare(ctx context.Context, m Metadata, input io.Reader) (Metadata, error)

func (*Local) PutTx

func (s *Local) PutTx(ctx context.Context, tx pgx.Tx, m Metadata, attemptID string, input io.Reader) (Metadata, error)

func (*Local) RecordPreparedTx

func (s *Local) RecordPreparedTx(ctx context.Context, tx pgx.Tx, m Metadata, attemptID string) (Metadata, error)

func (*Local) RemoveBlob

func (s *Local) RemoveBlob(org, id string) error

func (*Local) Run

func (s *Local) Run(ctx context.Context)

func (*Local) SweepOrphans

func (s *Local) SweepOrphans(ctx context.Context, before time.Time) (int, error)

type Metadata

type Metadata struct {
	ID           string    `json:"id"`
	OrgID        string    `json:"org_id"`
	RepositoryID string    `json:"repository_id"`
	TaskID       string    `json:"task_id"`
	Name         string    `json:"name"`
	MediaType    string    `json:"media_type"`
	Size         int64     `json:"size"`
	SHA256       string    `json:"sha256"`
	CreatedAt    time.Time `json:"created_at"`
	ExpiresAt    time.Time `json:"expires_at"`
}

Jump to

Keyboard shortcuts

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