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

artifact

package
v0.2.32 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 25 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 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"`
}

type S3Config added in v0.2.24

type S3Config struct {
	Endpoint        string
	Region          string
	Bucket          string
	AccessKeyID     string
	SecretAccessKey string
}

type Store added in v0.2.24

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

func NewLocal

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

func NewS3 added in v0.2.24

func NewS3(ctx context.Context, db *store.Store, cfg S3Config) (*Store, error)

func (*Store) Close added in v0.2.24

func (s *Store) Close() error

func (*Store) DeleteByRetention added in v0.2.24

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

func (*Store) MetadataTx added in v0.2.24

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

func (*Store) Open added in v0.2.24

func (s *Store) Open(ctx context.Context, m Metadata) (io.ReadCloser, error)

func (*Store) Prepare added in v0.2.24

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

func (*Store) PutTx added in v0.2.24

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

func (*Store) RecordPreparedTx added in v0.2.24

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

func (*Store) RemoveBlob added in v0.2.24

func (s *Store) RemoveBlob(ctx context.Context, org, id string) error

func (*Store) Run added in v0.2.24

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

func (*Store) SweepOrphans added in v0.2.24

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

Jump to

Keyboard shortcuts

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