Documentation ¶
Index ¶
- type DatabaseStore
- func (s *DatabaseStore) Create(repo *model.Repository) error
- func (s *DatabaseStore) Get(id kallax.ULID) (*model.Repository, error)
- func (s *DatabaseStore) GetByEndpoints(endpoints ...string) ([]*model.Repository, error)
- func (s *DatabaseStore) GetRefsByInit(init model.SHA1) ([]*model.Reference, error)
- func (s *DatabaseStore) InitHasRefs(init model.SHA1) (bool, error)
- func (s *DatabaseStore) SetEndpoints(repo *model.Repository, endpoints ...string) error
- func (s *DatabaseStore) SetStatus(repo *model.Repository, status model.FetchStatus) error
- func (s *DatabaseStore) UpdateFailed(repo *model.Repository, status model.FetchStatus) error
- func (s *DatabaseStore) UpdateFetched(repo *model.Repository, fetchedAt time.Time) error
- type LocalStore
- func (s *LocalStore) Create(r *model.Repository) error
- func (s *LocalStore) Get(id kallax.ULID) (*model.Repository, error)
- func (s *LocalStore) GetByEndpoints(endpoints ...string) ([]*model.Repository, error)
- func (s *LocalStore) GetRefsByInit(init model.SHA1) ([]*model.Reference, error)
- func (s *LocalStore) InitHasRefs(init model.SHA1) (bool, error)
- func (s *LocalStore) SetEndpoints(r *model.Repository, endpoints ...string) error
- func (s *LocalStore) SetStatus(r *model.Repository, status model.FetchStatus) error
- func (s *LocalStore) UpdateFailed(r *model.Repository, status model.FetchStatus) error
- func (s *LocalStore) UpdateFetched(r *model.Repository, fetchedAt time.Time) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseStore ¶ added in v0.14.0
type DatabaseStore struct {
*model.RepositoryStore
}
DatabaseStore implements a borges.RepositoryStorage based on a database.
func FromDatabase ¶
func FromDatabase(db *sql.DB) *DatabaseStore
FromDatabase returns a new repository store that interacts with a PostgreSQL FromDatabase to store all the data.
func (*DatabaseStore) Create ¶ added in v0.14.0
func (s *DatabaseStore) Create(repo *model.Repository) error
Create honors the borges.RepositoryStore interface.
func (*DatabaseStore) Get ¶ added in v0.14.0
func (s *DatabaseStore) Get(id kallax.ULID) (*model.Repository, error)
Get honors the borges.RepositoryStore interface.
func (*DatabaseStore) GetByEndpoints ¶ added in v0.14.0
func (s *DatabaseStore) GetByEndpoints( endpoints ...string, ) ([]*model.Repository, error)
GetByEndpoints honors the borges.RepositoryStore interface.
func (*DatabaseStore) GetRefsByInit ¶ added in v0.18.1
GetRefsByInit honors the borges.RepositoryStore interface.
func (*DatabaseStore) InitHasRefs ¶ added in v0.18.1
func (s *DatabaseStore) InitHasRefs( init model.SHA1, ) (bool, error)
InitHasRefs honors the borges.RepositoryStore interface.
func (*DatabaseStore) SetEndpoints ¶ added in v0.14.0
func (s *DatabaseStore) SetEndpoints(repo *model.Repository, endpoints ...string) error
SetEndpoints honors the borges.RepositoryStore interface.
func (*DatabaseStore) SetStatus ¶ added in v0.14.0
func (s *DatabaseStore) SetStatus(repo *model.Repository, status model.FetchStatus) error
SetStatus honors the borges.RepositoryStore interface.
func (*DatabaseStore) UpdateFailed ¶ added in v0.14.0
func (s *DatabaseStore) UpdateFailed(repo *model.Repository, status model.FetchStatus) error
UpdateFailed honors the borges.RepositoryStore interface.
func (*DatabaseStore) UpdateFetched ¶ added in v0.14.0
func (s *DatabaseStore) UpdateFetched(repo *model.Repository, fetchedAt time.Time) error
UpdateFetched honors the borges.RepositoryStore interface.
type LocalStore ¶ added in v0.14.0
LocalStore represents a borges.RepositoryStore that isn't backed by any database.
func Local ¶
func Local() *LocalStore
Local creates a new local repository store that needs no database connection.
func (*LocalStore) Create ¶ added in v0.14.0
func (s *LocalStore) Create(r *model.Repository) error
Create honors the borges.RepositoryStore interface.
func (*LocalStore) Get ¶ added in v0.14.0
func (s *LocalStore) Get(id kallax.ULID) (*model.Repository, error)
Get honors the borges.RepositoryStore interface.
func (*LocalStore) GetByEndpoints ¶ added in v0.14.0
func (s *LocalStore) GetByEndpoints(endpoints ...string) ([]*model.Repository, error)
GetByEndpoints honors the borges.RepositoryStore interface.
func (*LocalStore) GetRefsByInit ¶ added in v0.18.1
GetRefsByInit honors the borges.RepositoryStore interface.
func (*LocalStore) InitHasRefs ¶ added in v0.18.1
func (s *LocalStore) InitHasRefs( init model.SHA1, ) (bool, error)
InitHasRefs honors the borges.RepositoryStore interface.
func (*LocalStore) SetEndpoints ¶ added in v0.14.0
func (s *LocalStore) SetEndpoints(r *model.Repository, endpoints ...string) error
SetEndpoints honors the borges.RepositoryStore interface.
func (*LocalStore) SetStatus ¶ added in v0.14.0
func (s *LocalStore) SetStatus(r *model.Repository, status model.FetchStatus) error
SetStatus honors the borges.RepositoryStore interface.
func (*LocalStore) UpdateFailed ¶ added in v0.14.0
func (s *LocalStore) UpdateFailed(r *model.Repository, status model.FetchStatus) error
UpdateFailed honors the borges.RepositoryStore interface.
func (*LocalStore) UpdateFetched ¶ added in v0.14.0
func (s *LocalStore) UpdateFetched(r *model.Repository, fetchedAt time.Time) error
UpdateFetched honors the borges.RepositoryStore interface.