storage

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2019 License: GPL-3.0 Imports: 7 Imported by: 10

Documentation

Index

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

func (s *DatabaseStore) GetRefsByInit(
	init model.SHA1,
) ([]*model.Reference, error)

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

type LocalStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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

func (s *LocalStore) GetRefsByInit(
	init model.SHA1,
) ([]*model.Reference, error)

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.

Jump to

Keyboard shortcuts

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