Documentation
¶
Overview ¶
Package sqlite is the SQLite-backed adapter for the ingestion.Store port.
Index ¶
- Variables
- type Store
- func (s *Store) CreateRepo(ctx context.Context, repo ingestion.NewRepo) (ingestion.Repo, error)
- func (s *Store) DB() *sql.DB
- func (s *Store) DeleteForgeToken(ctx context.Context, id string) error
- func (s *Store) DeleteRepo(ctx context.Context, id string) error
- func (s *Store) ForgeToken(ctx context.Context, forge ingestion.Forge, instanceURL string) (string, error)
- func (s *Store) GetRepo(ctx context.Context, id string) (ingestion.Repo, error)
- func (s *Store) ListForgeTokens(ctx context.Context) ([]ingestion.SavedToken, error)
- func (s *Store) ListRepoIdentifiers(ctx context.Context, forge ingestion.Forge, instanceURL string) ([]string, error)
- func (s *Store) ListRepos(ctx context.Context, filter ingestion.RepoListFilter) ([]ingestion.Repo, bool, error)
- func (s *Store) LocateJob(ctx context.Context, runID, jobID string) (ingestion.JobLocation, error)
- func (s *Store) ReplaceSteps(ctx context.Context, jobID string, steps []ingestion.Step) error
- func (s *Store) RepoByIdentifier(ctx context.Context, forge ingestion.Forge, identifier string) (ingestion.Repo, error)
- func (s *Store) RepoToken(ctx context.Context, id string) (string, error)
- func (s *Store) RunByID(ctx context.Context, id string) (ingestion.Run, error)
- func (s *Store) RunStates(ctx context.Context, repoID string) (map[string]ingestion.RunState, error)
- func (s *Store) SaveForgeToken(ctx context.Context, forge ingestion.Forge, instanceURL, token string) (ingestion.SavedToken, error)
- func (s *Store) SetIngestionStatus(ctx context.Context, id string, status ingestion.Status, reason string) error
- func (s *Store) SetReconcileETag(ctx context.Context, id string, etag string) error
- func (s *Store) UpsertJob(ctx context.Context, job ingestion.Job) (ingestion.Job, error)
- func (s *Store) UpsertRun(ctx context.Context, run ingestion.Run) (ingestion.Run, error)
Constants ¶
This section is empty.
Variables ¶
var ErrRepoNotFound = errors.New("repo not found")
ErrRepoNotFound is returned when no repo matches the requested id.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements ingestion.Store against a SQLite database.
func NewStore ¶
NewStore returns a Store that encrypts tokens at rest under key (32 bytes, AES-256).
func (*Store) CreateRepo ¶
CreateRepo implements ingestion.Store.
func (*Store) DB ¶
DB returns the underlying connection, for callers (such as tests) that need to observe storage directly rather than through the port.
func (*Store) DeleteForgeToken ¶ added in v0.70.0
DeleteForgeToken implements ingestion.ForgeTokenStore.
func (*Store) DeleteRepo ¶ added in v0.9.0
DeleteRepo implements ingestion.Store. The schema's ON DELETE CASCADE takes care of its runs, jobs, and steps.
func (*Store) ForgeToken ¶ added in v0.70.0
func (s *Store) ForgeToken(ctx context.Context, forge ingestion.Forge, instanceURL string) (string, error)
ForgeToken implements ingestion.ForgeTokenStore.
func (*Store) ListForgeTokens ¶ added in v0.70.0
ListForgeTokens implements ingestion.ForgeTokenStore.
func (*Store) ListRepoIdentifiers ¶ added in v0.30.1
func (s *Store) ListRepoIdentifiers(ctx context.Context, forge ingestion.Forge, instanceURL string) ([]string, error)
ListRepoIdentifiers implements ingestion.Store.
func (*Store) ListRepos ¶
func (s *Store) ListRepos(ctx context.Context, filter ingestion.RepoListFilter) ([]ingestion.Repo, bool, error)
ListRepos implements ingestion.Store.
func (*Store) LocateJob ¶ added in v0.70.0
LocateJob implements ingestion.JobLocator. A job id that belongs to a different run is not found: the pair must match.
func (*Store) ReplaceSteps ¶ added in v0.4.0
ReplaceSteps implements ingestion.RunStore.
func (*Store) RepoByIdentifier ¶ added in v0.4.0
func (s *Store) RepoByIdentifier(ctx context.Context, forge ingestion.Forge, identifier string) (ingestion.Repo, error)
RepoByIdentifier implements ingestion.RunStore.
func (*Store) RunByID ¶ added in v0.70.0
RunByID implements ingestion.RunLookup. It returns what an action on the run needs, not the whole row.
func (*Store) RunStates ¶ added in v0.32.1
func (s *Store) RunStates(ctx context.Context, repoID string) (map[string]ingestion.RunState, error)
RunStates implements ingestion.RunStore.
func (*Store) SaveForgeToken ¶ added in v0.70.0
func (s *Store) SaveForgeToken(ctx context.Context, forge ingestion.Forge, instanceURL, token string) (ingestion.SavedToken, error)
SaveForgeToken implements ingestion.ForgeTokenStore.
func (*Store) SetIngestionStatus ¶
func (s *Store) SetIngestionStatus(ctx context.Context, id string, status ingestion.Status, reason string) error
SetIngestionStatus implements ingestion.Store.
func (*Store) SetReconcileETag ¶ added in v0.4.0
SetReconcileETag implements ingestion.Store.