Documentation ¶
Index ¶
- Constants
- func AllRepos(ctx context.Context, conf *BTConfig) (map[string]*gitstore.RepoInfo, error)
- func InitBT(conf *BTConfig) error
- func NewBTGitStoreMap(ctx context.Context, repoUrls []string, btConf *BTConfig) (repograph.Map, error)
- func RepoURLFromID(ctx context.Context, conf *BTConfig, repoIDStr string) (string, bool)
- type BTConfig
- type BigTableGitStore
- func (b *BigTableGitStore) Get(ctx context.Context, hashes []string) ([]*vcsinfo.LongCommit, error)
- func (b *BigTableGitStore) GetBranches(ctx context.Context) (map[string]*gitstore.BranchPointer, error)
- func (b *BigTableGitStore) Put(ctx context.Context, commits []*vcsinfo.LongCommit) error
- func (b *BigTableGitStore) PutBranches(ctx context.Context, branches map[string]string) error
- func (b *BigTableGitStore) RangeByTime(ctx context.Context, start, end time.Time, branch string) ([]*vcsinfo.IndexCommit, error)
- func (b *BigTableGitStore) RangeN(ctx context.Context, startIndex, endIndex int, branch string) ([]*vcsinfo.IndexCommit, error)
Constants ¶
const ( DEPRECATED_TABLE_ID = "git-repos" METRIC_BT_REQS_READ = "bt_gitstore_reqs_read" METRIC_BT_REQS_WRITE = "bt_gitstore_reqs_write" METRIC_BT_ROWS_READ = "bt_gitstore_rows_read" METRIC_BT_ROWS_WRITE = "bt_gitstore_rows_write" )
const ( // Default number of shards used, if not shards provided in BTConfig. DefaultShards = 32 // DefaultWriteGoroutines defines the maximum number of goroutines // used to write to BigTable concurrently, if not provided in BTConfig. // This number was shown to keep memory usage reasonably low while still // providing decent throughput. DefaultWriteGoroutines = 100 )
Variables ¶
This section is empty.
Functions ¶
func AllRepos ¶
AllRepos returns a map of all repos contained in given BigTable project/instance/table. It returns map[normalized_URL]RepoInfo.
func InitBT ¶
InitBT initializes the BT instance for the given configuration. It uses the default way to get auth information from the environment and must be called with an account that has admin rights.
func NewBTGitStoreMap ¶
func NewBTGitStoreMap(ctx context.Context, repoUrls []string, btConf *BTConfig) (repograph.Map, error)
NewGitStoreMap returns a Map instance with Graphs for the given GitStores.
func RepoURLFromID ¶
RepoURLFromID retrieves the URL of a repository by its corresponding numeric ID. If a repository with the given ID can be found it will be returned and the second return value is true. In any other case "" and false will be returned.
Types ¶
type BTConfig ¶
type BTConfig struct { ProjectID string InstanceID string TableID string AppProfile string Shards int WriteGoroutines int }
BTConfig contains the BigTable configuration to define where the repo should be stored.
func BTTestConfig ¶
func BTTestConfig() *BTConfig
BTTestConfig returns a BTConfig which can be used for testing.
type BigTableGitStore ¶
type BigTableGitStore struct { RepoID int64 RepoURL string // contains filtered or unexported fields }
BigTableGitStore implements the GitStore interface based on BigTable.
func New ¶
New returns an instance of GitStore that uses BigTable as its backend storage. The given repoURL serves to identify the repository. Internally it is stored normalized via a call to git.NormalizeURL.
func (*BigTableGitStore) Get ¶
func (b *BigTableGitStore) Get(ctx context.Context, hashes []string) ([]*vcsinfo.LongCommit, error)
Get implements the GitStore interface.
func (*BigTableGitStore) GetBranches ¶
func (b *BigTableGitStore) GetBranches(ctx context.Context) (map[string]*gitstore.BranchPointer, error)
GetBranches implements the GitStore interface.
func (*BigTableGitStore) Put ¶
func (b *BigTableGitStore) Put(ctx context.Context, commits []*vcsinfo.LongCommit) error
Put implements the GitStore interface.
func (*BigTableGitStore) PutBranches ¶
PutBranches implements the GitStore interface.
func (*BigTableGitStore) RangeByTime ¶
func (b *BigTableGitStore) RangeByTime(ctx context.Context, start, end time.Time, branch string) ([]*vcsinfo.IndexCommit, error)
RangeByTime implements the GitStore interface.
func (*BigTableGitStore) RangeN ¶
func (b *BigTableGitStore) RangeN(ctx context.Context, startIndex, endIndex int, branch string) ([]*vcsinfo.IndexCommit, error)
RangeN implements the GitStore interface.