publicartifacts

package
v0.7.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultRetention = 24 * time.Hour
	MaxRetention     = 7 * 24 * time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	ArtifactID string    `json:"artifact_id"`
	Filename   string    `json:"filename"`
	MimeType   string    `json:"mime_type"`
	Size       int64     `json:"size_bytes"`
	SHA256     string    `json:"sha256"`
	CreatedAt  time.Time `json:"created_at"`
	ExpiresAt  time.Time `json:"expires_at"`
	Archive    bool      `json:"archive"`
	Width      int       `json:"width,omitempty"`
	Height     int       `json:"height,omitempty"`
}

type PublishBytesRequest

type PublishBytesRequest struct {
	Filename         string
	Data             []byte
	MimeType         string
	Width            int
	Height           int
	RetentionSeconds int
	Now              time.Time
	BaseURL          string
}

type PublishRequest

type PublishRequest struct {
	Path             string
	RetentionSeconds int
	Now              time.Time
	BaseURL          string
}

type PublishResult

type PublishResult struct {
	Metadata
	URL string `json:"url"`
}

type Store

type Store struct {
	Root       string
	SecretPath string
	Port       int
	ServerURL  string
}

func New

func New(agentDockHome, serverURL string, port int) Store

func (Store) Cleanup

func (s Store) Cleanup(now time.Time) error

func (Store) EnsureSecret

func (s Store) EnsureSecret() error

func (Store) Publish

func (s Store) Publish(req PublishRequest) (PublishResult, error)

func (Store) PublishBytes

func (s Store) PublishBytes(req PublishBytesRequest) (PublishResult, error)

func (Store) Read

func (s Store) Read(artifactID string, maxBytes int64) (Metadata, []byte, error)

func (Store) ServeHTTP

func (s Store) ServeHTTP(w http.ResponseWriter, r *http.Request, prefix string)

Jump to

Keyboard shortcuts

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