Documentation
¶
Overview ¶
Package state is the --state-dir SQLite store behind the proxy's in-memory indexes: job records, Idempotency-Key claims, the asset index, and the output-id signing secret. One store belongs to one proxy and one ComfyUI.
The schema matches the reference, so a state directory written by the Python proxy opens here, plus a nullable assets.expires_at column that the reference never persisted.
Index ¶
- type Store
- func (s *Store) ClaimIdempotency(key string, claimedAt time.Time) (bool, error)
- func (s *Store) Close() error
- func (s *Store) DeleteAsset(id string) error
- func (s *Store) GetJob(id string) (*proxy.JobRecord, error)
- func (s *Store) GetJobWorkflow(id string) (json.RawMessage, error)
- func (s *Store) GetMeta(key string) (string, bool, error)
- func (s *Store) LoadAssets() ([]proxy.AssetRecord, map[string]string, error)
- func (s *Store) LoadIdempotencyKeys() ([]string, error)
- func (s *Store) LoadJobs(limit int) ([]proxy.JobRecord, error)
- func (s *Store) ReleaseIdempotency(key string) error
- func (s *Store) SetMeta(key, value string) error
- func (s *Store) TrimIdempotency(max int) error
- func (s *Store) UpsertAsset(rec proxy.AssetRecord) error
- func (s *Store) UpsertJob(rec proxy.JobRecord) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// Warnings lists permission changes that could not be made. They are not
// fatal, as in the reference: a filesystem without POSIX modes (FAT, some
// network mounts) still works, it just cannot be locked down.
Warnings []string
// contains filtered or unexported fields
}
Store implements proxy.Persist.
func Open ¶
Open creates or opens dir/state.sqlite3. The directory is 0700 and the database 0600: it holds the HMAC secret that signs output asset ids, and any local user who could read it could mint valid ids. The directory mode also covers the WAL and SHM files SQLite creates beside it.
func (*Store) ClaimIdempotency ¶
func (*Store) DeleteAsset ¶
func (*Store) GetJobWorkflow ¶
func (s *Store) GetJobWorkflow(id string) (json.RawMessage, error)
func (*Store) LoadAssets ¶
func (*Store) LoadIdempotencyKeys ¶
func (*Store) ReleaseIdempotency ¶
func (*Store) TrimIdempotency ¶
func (*Store) UpsertAsset ¶
func (s *Store) UpsertAsset(rec proxy.AssetRecord) error