assets

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetID

func AssetID(sessionID corepkg.SessionID, imageID int) llm.AssetID

Types

type FileAssetStore

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

func NewFileAssetStore

func NewFileAssetStore(configDir string) (*FileAssetStore, error)

func (*FileAssetStore) DeleteSessionImages

func (s *FileAssetStore) DeleteSessionImages(ctx context.Context, sessionID corepkg.SessionID) error

func (*FileAssetStore) GC

func (s *FileAssetStore) GC(ctx context.Context, keepSessionIDs []corepkg.SessionID, olderThan time.Time) error

func (*FileAssetStore) GetImageByAssetID

func (s *FileAssetStore) GetImageByAssetID(ctx context.Context, sessionID corepkg.SessionID, assetID llm.AssetID) (ImageBlob, error)

func (*FileAssetStore) PutImage

func (s *FileAssetStore) PutImage(ctx context.Context, in PutImageInput) (ImageMeta, error)

type ImageBlob

type ImageBlob struct {
	SessionID corepkg.SessionID
	ImageID   int
	MediaType string
	FileName  string
	Data      []byte
	ByteSize  int64
	CachePath string
}

type ImageMeta

type ImageMeta struct {
	AssetID   llm.AssetID
	ImageID   int
	MediaType string
	FileName  string
	CachePath string
	ByteSize  int64
	Width     int
	Height    int
}

type ImageStore

type ImageStore interface {
	PutImage(ctx context.Context, in PutImageInput) (ImageMeta, error)
	GetImageByAssetID(ctx context.Context, sessionID corepkg.SessionID, assetID llm.AssetID) (ImageBlob, error)
	DeleteSessionImages(ctx context.Context, sessionID corepkg.SessionID) error
	GC(ctx context.Context, keepSessionIDs []corepkg.SessionID, olderThan time.Time) error
}

type PutImageInput

type PutImageInput struct {
	SessionID corepkg.SessionID
	ImageID   int
	MediaType string
	FileName  string
	Data      []byte
	Width     int
	Height    int
}

Jump to

Keyboard shortcuts

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