gitbase.v0: gopkg.in/src-d/gitbase.v0 Index | Files

package gitbase

import "gopkg.in/src-d/gitbase.v0"

Index

Package Files

blobs.go checksum.go commit_blobs.go commit_files.go commit_trees.go commits.go database.go env.go files.go filters.go index.go packfiles.go partition.go path_utils.go ref_commits.go references.go remotes.go repositories.go repository_pool.go session.go squash.go squash_iterator.go table.go tree_entries.go utils.go

Constants

const (
    // ReferencesTableName is the name of the refs table.
    ReferencesTableName = "refs"
    // CommitsTableName is the name of the commits table.
    CommitsTableName = "commits"
    // BlobsTableName is the name of the blobs table.
    BlobsTableName = "blobs"
    // TreeEntriesTableName is the name of the tree entries table.
    TreeEntriesTableName = "tree_entries"
    // RepositoriesTableName is the name of the repositories table.
    RepositoriesTableName = "repositories"
    // RemotesTableName is the name of the remotes table.
    RemotesTableName = "remotes"
    // RefCommitsTableName is the name of the ref commits table.
    RefCommitsTableName = "ref_commits"
    // CommitTreesTableName is the name of the commit trees table.
    CommitTreesTableName = "commit_trees"
    // CommitBlobsTableName is the name of the commit blobs table.
    CommitBlobsTableName = "commit_blobs"
    // CommitFilesTableName is the name of the commit files table.
    CommitFilesTableName = "commit_files"
    // FilesTableName is the name of the files table.
    FilesTableName = "files"
)

Variables

var (
    // ErrColumnNotFound is returned when a given column is not found in the table's schema.
    ErrColumnNotFound = errors.NewKind("column %s not found for table %s")
    // ErrInvalidObjectType is returned when the received object is not of the correct type.
    ErrInvalidObjectType = errors.NewKind("got object of type %T, expecting %s")
)
var BlobsSchema = sql.Schema{
    {Name: "repository_id", Type: sql.Text, Nullable: false, Source: BlobsTableName},
    {Name: "blob_hash", Type: sql.Text, Nullable: false, Source: BlobsTableName},
    {Name: "blob_size", Type: sql.Int64, Nullable: false, Source: BlobsTableName},
    {Name: "blob_content", Type: sql.Blob, Nullable: false, Source: BlobsTableName},
}

BlobsSchema is the schema for the blobs table.

var CommitBlobsSchema = sql.Schema{
    {Name: "repository_id", Type: sql.Text, Source: CommitBlobsTableName},
    {Name: "commit_hash", Type: sql.Text, Source: CommitBlobsTableName},
    {Name: "blob_hash", Type: sql.Text, Source: CommitBlobsTableName},
}

CommitBlobsSchema is the schema for the commit blobs table.

var CommitFilesSchema = sql.Schema{
    {Name: "repository_id", Type: sql.Text, Source: CommitFilesTableName},
    {Name: "commit_hash", Type: sql.Text, Source: CommitFilesTableName},
    {Name: "file_path", Type: sql.Text, Source: CommitFilesTableName},
    {Name: "blob_hash", Type: sql.Text, Source: CommitFilesTableName},
    {Name: "tree_hash", Type: sql.Text, Source: CommitFilesTableName},
}

CommitFilesSchema is the schema for the commit trees table.

var CommitTreesSchema = sql.Schema{
    {Name: "repository_id", Type: sql.Text, Source: CommitTreesTableName},
    {Name: "commit_hash", Type: sql.Text, Source: CommitTreesTableName},
    {Name: "tree_hash", Type: sql.Text, Source: CommitTreesTableName},
}

CommitTreesSchema is the schema for the commit trees table.

var CommitsSchema = sql.Schema{
    {Name: "repository_id", Type: sql.Text, Nullable: false, Source: CommitsTableName},
    {Name: "commit_hash", Type: sql.Text, Nullable: false, Source: CommitsTableName},
    {Name: "commit_author_name", Type: sql.Text, Nullable: false, Source: CommitsTableName},
    {Name: "commit_author_email", Type: sql.Text, Nullable: false, Source: CommitsTableName},
    {Name: "commit_author_when", Type: sql.Timestamp, Nullable: false, Source: CommitsTableName},
    {Name: "committer_name", Type: sql.Text, Nullable: false, Source: CommitsTableName},
    {Name: "committer_email", Type: sql.Text, Nullable: false, Source: CommitsTableName},
    {Name: "committer_when", Type: sql.Timestamp, Nullable: false, Source: CommitsTableName},
    {Name: "commit_message", Type: sql.Text, Nullable: false, Source: CommitsTableName},
    {Name: "tree_hash", Type: sql.Text, Nullable: false, Source: CommitsTableName},
    {Name: "commit_parents", Type: sql.Array(sql.Text), Nullable: false, Source: CommitsTableName},
}

CommitsSchema is the schema for the commits table.

var ErrBblfshConnection = errors.NewKind("unable to establish a connection with the bblfsh server: %s")

ErrBblfshConnection is returned when it's impossible to connect to bblfsh.

var ErrInvalidContext = errors.NewKind("invalid context received: %v")

ErrInvalidContext is returned when some node expected an sql.Context with gitbase session but received something else.

var ErrInvalidGitbaseSession = errors.NewKind("expecting gitbase session, but received: %T")

ErrInvalidGitbaseSession is returned when some node expected a gitbase session but received something else.

var ErrNoRepositoryPartition = errors.NewKind("%T not a valid repository partition")

ErrNoRepositoryPartition is returned when the partition is not a valid repository partition.

var ErrPoolRepoNotFound = errors.NewKind("repository id %s not found in the pool")

ErrPoolRepoNotFound is returned when a repository id is not present in the pool.

var ErrSessionCanceled = errors.NewKind("session canceled")

ErrSessionCanceled is returned when session context is canceled

var FilesSchema = sql.Schema{
    {Name: "repository_id", Type: sql.Text, Source: "files"},
    {Name: "file_path", Type: sql.Text, Source: "files"},
    {Name: "blob_hash", Type: sql.Text, Source: "files"},
    {Name: "tree_hash", Type: sql.Text, Source: "files"},
    {Name: "tree_entry_mode", Type: sql.Text, Source: "files"},
    {Name: "blob_content", Type: sql.Blob, Source: "files"},
    {Name: "blob_size", Type: sql.Int64, Source: "files"},
}

FilesSchema is the schema for the files table.

var RefCommitsSchema = sql.Schema{
    {Name: "repository_id", Type: sql.Text, Source: RefCommitsTableName},
    {Name: "commit_hash", Type: sql.Text, Source: RefCommitsTableName},
    {Name: "ref_name", Type: sql.Text, Source: RefCommitsTableName},
    {Name: "history_index", Type: sql.Int64, Source: RefCommitsTableName},
}

RefCommitsSchema is the schema for the ref commits table.

var RefsSchema = sql.Schema{
    {Name: "repository_id", Type: sql.Text, Nullable: false, Source: ReferencesTableName},
    {Name: "ref_name", Type: sql.Text, Nullable: false, Source: ReferencesTableName},
    {Name: "commit_hash", Type: sql.Text, Nullable: false, Source: ReferencesTableName},
}

RefsSchema is the schema for the refs table.

var RegMatchChars = regexp.MustCompile(`(^|[^\\])([*[?])`)

RegMatchChars matches a string with a glob expression inside.

var RemotesSchema = sql.Schema{
    {Name: "repository_id", Type: sql.Text, Nullable: false, Source: RemotesTableName},
    {Name: "remote_name", Type: sql.Text, Nullable: false, Source: RemotesTableName},
    {Name: "remote_push_url", Type: sql.Text, Nullable: false, Source: RemotesTableName},
    {Name: "remote_fetch_url", Type: sql.Text, Nullable: false, Source: RemotesTableName},
    {Name: "remote_push_refspec", Type: sql.Text, Nullable: false, Source: RemotesTableName},
    {Name: "remote_fetch_refspec", Type: sql.Text, Nullable: false, Source: RemotesTableName},
}

RemotesSchema is the schema for the remotes table.

var RepositoriesSchema = sql.Schema{
    {Name: "repository_id", Type: sql.Text, Nullable: false, Source: RepositoriesTableName},
}

RepositoriesSchema is the schema for the repositories table.

var TreeEntriesSchema = sql.Schema{
    {Name: "repository_id", Type: sql.Text, Nullable: false, Source: TreeEntriesTableName},
    {Name: "tree_entry_name", Type: sql.Text, Nullable: false, Source: TreeEntriesTableName},
    {Name: "blob_hash", Type: sql.Text, Nullable: false, Source: TreeEntriesTableName},
    {Name: "tree_hash", Type: sql.Text, Nullable: false, Source: TreeEntriesTableName},
    {Name: "tree_entry_mode", Type: sql.Text, Nullable: false, Source: TreeEntriesTableName},
}

TreeEntriesSchema is the schema for the tree entries table.

func IsGitRepo Uses

func IsGitRepo(path string) (bool, error)

IsGitRepo checks that the given path is a git repository.

func IsSivaFile Uses

func IsSivaFile(file string) bool

IsSivaFile checks that the given file is a siva file.

func NewChainableRowIter Uses

func NewChainableRowIter(iter ChainableIter) sql.RowIter

NewChainableRowIter converts a ChainableIter into a sql.RowIter.

func NewCommitsByHashIter Uses

func NewCommitsByHashIter(
    repo *Repository,
    hashes []plumbing.Hash,
) (object.CommitIter, error)

NewCommitsByHashIter creates a CommitIter that can use a list of hashes to iterate. If the list is empty it scans all commits.

func NewDatabase Uses

func NewDatabase(name string, pool *RepositoryPool) sql.Database

NewDatabase creates a new Database structure and initializes its tables with the given pool

func NewSchemaMapperIter Uses

func NewSchemaMapperIter(iter sql.RowIter, mappings []int) sql.RowIter

NewSchemaMapperIter reorders the rows in the given row iter according to the given column mappings.

func NewSessionBuilder Uses

func NewSessionBuilder(pool *RepositoryPool, opts ...SessionOption) server.SessionBuilder

NewSessionBuilder creates a SessionBuilder with the given Repository Pool.

func PatternMatches Uses

func PatternMatches(pattern string) ([]string, error)

PatternMatches returns the paths matched and any error found.

type BblfshClient Uses

type BblfshClient struct {
    *bblfsh.Client
    // contains filtered or unexported fields
}

BblfshClient is a wrapper around a bblfsh client to extend its functionality.

func (*BblfshClient) IsLanguageSupported Uses

func (c *BblfshClient) IsLanguageSupported(ctx context.Context, lang string) (bool, error)

IsLanguageSupported returns whether the language is supported in the bblfsh server this client is connected to.

func (*BblfshClient) Parse Uses

func (c *BblfshClient) Parse(
    ctx context.Context,
    lang string,
    content []byte,
) (bblfsh.Node, string, error)

Parse the given content with the given language.

func (*BblfshClient) ParseWithMode Uses

func (c *BblfshClient) ParseWithMode(
    ctx context.Context,
    mode bblfsh.Mode,
    lang string,
    content []byte,
) (bblfsh.Node, string, error)

ParseWithMode the given content with the given language.

func (*BblfshClient) SupportedLanguages Uses

func (c *BblfshClient) SupportedLanguages(ctx context.Context) ([]string, error)

SupportedLanguages returns the list of supported languages for the bblfsh server this client is connected to.

type BlobsIter Uses

type BlobsIter interface {
    ChainableIter
    Blob() *object.Blob
}

BlobsIter is a chainable iterator that operates on blobs.

func NewAllCommitBlobsIter Uses

func NewAllCommitBlobsIter(filters sql.Expression) BlobsIter

NewAllCommitBlobsIter returns all commit_blobs.

func NewCommitBlobBlobsIter Uses

func NewCommitBlobBlobsIter(
    commitBlobs BlobsIter,
    filters sql.Expression,
    readContent bool,
) BlobsIter

NewCommitBlobBlobsIter returns the blobs for all commit blobs in the given iterator.

func NewCommitBlobsIter Uses

func NewCommitBlobsIter(
    commits CommitsIter,
    filters sql.Expression,
) BlobsIter

NewCommitBlobsIter returns an iterator that will return all commit blobs of each commit in the given iterator.

func NewIndexCommitBlobsIter Uses

func NewIndexCommitBlobsIter(index sql.IndexLookup, filters sql.Expression) BlobsIter

NewIndexCommitBlobsIter returns an iterator that will return all results in the given index.

func NewRepoBlobsIter Uses

func NewRepoBlobsIter(
    repos ReposIter,
    filters sql.Expression,
    readContent bool,
) BlobsIter

NewRepoBlobsIter returns an iterator that will return all blobs for the repositories in the given iter that match the given filters.

func NewTreeEntryBlobsIter Uses

func NewTreeEntryBlobsIter(
    squashTreeEntriesIter TreeEntriesIter,
    filters sql.Expression,
    readContent bool,
) BlobsIter

NewTreeEntryBlobsIter returns an iterator that will return all blobs for the tree entries in the given iter that match the given filters.

type ChainableIter Uses

type ChainableIter interface {
    // New creates a new Chainable Iterator.
    New(*sql.Context, *Repository) (ChainableIter, error)
    // Close closes the iterator.
    Close() error
    // Repository returns the current repository the iterator is working on.
    Repository() *Repository
    // Row returns the current row. All calls to Row return the same row
    // until another call to Advance. Advance should be called before
    // calling Row.
    Row() sql.Row
    // Advance advances the position of the iterator by one. After io.EOF
    // or any other error, this method should not be called.
    Advance() error
    // Schema returns the schema of the rows returned by this iterator.
    Schema() sql.Schema
}

ChainableIter is an iterator meant to have a chaining-friendly API.

func NewCommitFileFilesIter Uses

func NewCommitFileFilesIter(
    files FilesIter,
    filters sql.Expression,
    readContent bool,
) ChainableIter

NewCommitFileFilesIter returns all files for the commit files in the given iterator.

type CommitFile Uses

type CommitFile struct {
    Repository string
    TreeHash   string
    CommitHash string
    File       *object.File
}

CommitFile is all the data needed to represent a file from a commit.

type CommitsIter Uses

type CommitsIter interface {
    ChainableIter
    // Commit returns the current repository. All calls to Commit return the
    // same commit until another call to Advance. Advance should
    // be called before calling Commit.
    Commit() *object.Commit
}

CommitsIter is a chainable iterator that operates on commits.

func NewAllCommitsIter Uses

func NewAllCommitsIter(filters sql.Expression, virtual bool) CommitsIter

NewAllCommitsIter returns an iterator that will return all commits that match the given filters.

func NewAllRefCommitsIter Uses

func NewAllRefCommitsIter(filters sql.Expression) CommitsIter

NewAllRefCommitsIter returns an iterator that will return all ref_commit rows.

func NewIndexCommitsIter Uses

func NewIndexCommitsIter(index sql.IndexLookup, filters sql.Expression) CommitsIter

NewIndexCommitsIter returns an iterator that will return all results in the given index.

func NewRefCommitCommitsIter Uses

func NewRefCommitCommitsIter(refCommits CommitsIter, filters sql.Expression) CommitsIter

NewRefCommitCommitsIter returns an iterator that will return commits based on the ref_commits returned by the previous iterator.

func NewRefHEADCommitsIter Uses

func NewRefHEADCommitsIter(
    refsIter RefsIter,
    filters sql.Expression,
    virtual bool,
) CommitsIter

NewRefHEADCommitsIter returns an iterator that will return the commit for the given iter reference heads that match the given filters.

func NewRefHeadRefCommitsIter Uses

func NewRefHeadRefCommitsIter(refs RefsIter, filters sql.Expression) CommitsIter

NewRefHeadRefCommitsIter returns an iterator that will return all ref_commit rows of the HEAD commits in references of the given iterator.

func NewRefRefCommitsIter Uses

func NewRefRefCommitsIter(refsIter RefsIter, filters sql.Expression) CommitsIter

NewRefRefCommitsIter returns an iterator that will return all ref_commits for all the references in the given iterator.

func NewRepoCommitsIter Uses

func NewRepoCommitsIter(repos ReposIter, filters sql.Expression) CommitsIter

NewRepoCommitsIter is an iterator that returns all commits for the repositories returned by the given iterator.

type Database Uses

type Database struct {
    // contains filtered or unexported fields
}

Database holds all git repository tables

func (*Database) Name Uses

func (d *Database) Name() string

Name returns the name of the database

func (*Database) Tables Uses

func (d *Database) Tables() map[string]sql.Table

Tables returns a map with all initialized tables

type FilesIter Uses

type FilesIter interface {
    ChainableIter
    File() *object.File
    TreeHash() plumbing.Hash
}

FilesIter is a chainable iterator that operates on files.

func NewAllCommitFilesIter Uses

func NewAllCommitFilesIter(filters sql.Expression) FilesIter

NewAllCommitFilesIter returns an iterator that will return all commit files.

func NewCommitFilesIter Uses

func NewCommitFilesIter(iter CommitsIter, filters sql.Expression) FilesIter

NewCommitFilesIter returns an iterator that will return all commit files for the commits in the given iterator.

func NewIndexCommitFilesIter Uses

func NewIndexCommitFilesIter(index sql.IndexLookup, filters sql.Expression) FilesIter

NewIndexCommitFilesIter returns an iterator that will return all commit files for the commits in the given index.

type Indexable Uses

type Indexable interface {
    sql.IndexableTable
    // contains filtered or unexported methods
}

Indexable represents an indexable gitbase table.

type Ref Uses

type Ref struct {
    RepoID string
    *plumbing.Reference
}

Ref is a git reference with the repo id.

type RefCommitsIter Uses

type RefCommitsIter interface {
    CommitsIter
    // contains filtered or unexported methods
}

RefCommitsIter is a chainable iterator that operates on ref_commits.

func NewIndexRefCommitsIter Uses

func NewIndexRefCommitsIter(index sql.IndexLookup, filters sql.Expression) RefCommitsIter

NewIndexRefCommitsIter returns an iterator that will return all results in the given index.

type RefsIter Uses

type RefsIter interface {
    ChainableIter
    // Ref returns the current repository. All calls to Ref return the
    // same reference until another call to Advance. Advance should
    // be called before calling Ref.
    Ref() *Ref
}

RefsIter is a chainable iterator that operates on references.

func NewAllRefsIter Uses

func NewAllRefsIter(filters sql.Expression, virtual bool) RefsIter

NewAllRefsIter returns an iterator that will return all references that match the given filters. If the iterator is virtual, it will always return an empty row and an empty schema. This is useful for passing it to other iterators that are chained with references but don't need the reference data in their output rows.

func NewIndexRefsIter Uses

func NewIndexRefsIter(filters sql.Expression, index sql.IndexLookup) RefsIter

NewIndexRefsIter returns an iterator that will return all references that match the given filters in the given index.

func NewRemoteRefsIter Uses

func NewRemoteRefsIter(
    remotesIter RemotesIter,
    filters sql.Expression,
) RefsIter

NewRemoteRefsIter returns an iterator that will return all references for the remotes returned by the given remotes iterator that match the given filters.

func NewRepoRefsIter Uses

func NewRepoRefsIter(
    squashReposIter ReposIter,
    filters sql.Expression,
    virtual bool,
) RefsIter

NewRepoRefsIter returns an iterator that will return all references for the repositories of the given repos iterator that match the given filters.

type Remote Uses

type Remote struct {
    RepoID string
    Name   string
    URL    string
    Fetch  string
}

Remote is the info of a single repository remote.

type RemotesIter Uses

type RemotesIter interface {
    ChainableIter
    // Remote returns the current repository. All calls to Remote return the
    // same remote until another call to Advance. Advance should
    // be called before calling Remote.
    Remote() *Remote
}

RemotesIter is a chainable iterator that operates with remotes.

func NewAllRemotesIter Uses

func NewAllRemotesIter(filters sql.Expression) RemotesIter

NewAllRemotesIter returns an iterator that will return all remotes that match the given filters.

func NewRepoRemotesIter Uses

func NewRepoRemotesIter(squashReposIter ReposIter, filters sql.Expression) RemotesIter

NewRepoRemotesIter returns an iterator that will return all remotes for the given ReposIter repositories that match the given filters.

type ReposIter Uses

type ReposIter interface {
    ChainableIter
    // contains filtered or unexported methods
}

ReposIter is a chainable iterator that operates with repositories.

func NewAllReposIter Uses

func NewAllReposIter(filters sql.Expression) ReposIter

NewAllReposIter returns an iterator that will return all repositories that match the given filters.

type Repository Uses

type Repository struct {
    *git.Repository
    ID  string
    // contains filtered or unexported fields
}

Repository struct holds an initialized repository and its ID

func NewRepository Uses

func NewRepository(id string, repo *git.Repository, closeFunc func()) *Repository

NewRepository creates and initializes a new Repository structure

func NewRepositoryFromPath Uses

func NewRepositoryFromPath(id, path string, cache cache.Object) (*Repository, error)

NewRepositoryFromPath creates and initializes a new Repository structure and initializes a go-git repository

func NewSivaRepositoryFromPath Uses

func NewSivaRepositoryFromPath(id, path string, cache cache.Object) (*Repository, error)

NewSivaRepositoryFromPath creates and initializes a new Repository structure and initializes a go-git repository backed by a siva file.

func (*Repository) Close Uses

func (r *Repository) Close()

Close closes all opened files in the repository.

type RepositoryIter Uses

type RepositoryIter struct {
    // contains filtered or unexported fields
}

RepositoryIter iterates over all repositories in the pool

func (*RepositoryIter) Close Uses

func (i *RepositoryIter) Close() error

Close finished iterator. It's no-op.

func (*RepositoryIter) Next Uses

func (i *RepositoryIter) Next() (*Repository, error)

Next retrieves the next Repository. It returns io.EOF as error when there are no more Repositories to retrieve.

type RepositoryPartition Uses

type RepositoryPartition string

RepositoryPartition represents a partition which is a repository id.

func (RepositoryPartition) Key Uses

func (p RepositoryPartition) Key() []byte

Key implements the sql.Partition interface.

type RepositoryPool Uses

type RepositoryPool struct {
    // contains filtered or unexported fields
}

RepositoryPool holds a pool git repository paths and functionality to open and iterate them.

func NewRepositoryPool Uses

func NewRepositoryPool(maxCacheSize cache.FileSize) *RepositoryPool

NewRepositoryPool initializes a new RepositoryPool with LRU cache.

func (*RepositoryPool) Add Uses

func (p *RepositoryPool) Add(repo repository) error

Add inserts a new repository in the pool.

func (*RepositoryPool) AddGit Uses

func (p *RepositoryPool) AddGit(path string) error

AddGit adds a git repository to the pool. It also sets its path as ID.

func (*RepositoryPool) AddGitWithID Uses

func (p *RepositoryPool) AddGitWithID(id, path string) error

AddGitWithID adds a git repository to the pool. ID should be specified.

func (*RepositoryPool) AddSivaFile Uses

func (p *RepositoryPool) AddSivaFile(path string) error

AddSivaFile adds a siva file to the pool. It also sets its path as ID.

func (*RepositoryPool) AddSivaFileWithID Uses

func (p *RepositoryPool) AddSivaFileWithID(id, path string) error

AddSivaFileWithID adds a siva file to the pool. ID should be specified.

func (*RepositoryPool) GetPos Uses

func (p *RepositoryPool) GetPos(pos int) (*Repository, error)

GetPos retrieves a repository at a given position. If the position is out of bounds it returns io.EOF.

func (*RepositoryPool) GetRepo Uses

func (p *RepositoryPool) GetRepo(id string) (*Repository, error)

GetRepo returns a repository with the given id from the pool.

func (*RepositoryPool) RepoIter Uses

func (p *RepositoryPool) RepoIter() (*RepositoryIter, error)

RepoIter creates a new Repository iterator

type Session Uses

type Session struct {
    sql.Session
    Pool *RepositoryPool

    SkipGitErrors bool
    // contains filtered or unexported fields
}

Session is the custom implementation of a gitbase session.

func NewSession Uses

func NewSession(pool *RepositoryPool, opts ...SessionOption) *Session

NewSession creates a new Session. It requires a repository pool and any number of session options can be passed to configure the session.

func (*Session) BblfshClient Uses

func (s *Session) BblfshClient() (*BblfshClient, error)

BblfshClient returns a BblfshClient.

func (*Session) Close Uses

func (s *Session) Close() error

Close implements the io.Closer interface.

type SessionOption Uses

type SessionOption func(*Session)

SessionOption is a function that configures the session given some options.

func WithBaseSession Uses

func WithBaseSession(sess sql.Session) SessionOption

WithBaseSession sets the given session as the base session.

func WithBblfshEndpoint Uses

func WithBblfshEndpoint(endpoint string) SessionOption

WithBblfshEndpoint configures the bblfsh endpoint of the session.

func WithSkipGitErrors Uses

func WithSkipGitErrors(enabled bool) SessionOption

WithSkipGitErrors changes the behavior with go-git error.

type Squashable Uses

type Squashable interface {
    // contains filtered or unexported methods
}

Squashable represents a table that can be squashed.

type SquashedTable Uses

type SquashedTable struct {
    // contains filtered or unexported fields
}

SquashedTable is a table that combines the output of some tables as the inputs of others with chaining so it's less expensive to compute.

func NewSquashedTable Uses

func NewSquashedTable(
    iter ChainableIter,
    mapping []int,
    filters []sql.Expression,
    indexedTables []string,
    tables ...string,
) *SquashedTable

NewSquashedTable creates a new SquashedTable.

func (*SquashedTable) Name Uses

func (t *SquashedTable) Name() string

Name implements the sql.Table interface.

func (SquashedTable) PartitionCount Uses

func (SquashedTable) PartitionCount(ctx *sql.Context) (int64, error)

func (*SquashedTable) PartitionRows Uses

func (t *SquashedTable) PartitionRows(ctx *sql.Context, p sql.Partition) (sql.RowIter, error)

PartitionRows implements the sql.Table interface.

func (SquashedTable) Partitions Uses

func (SquashedTable) Partitions(ctx *sql.Context) (sql.PartitionIter, error)

func (*SquashedTable) Schema Uses

func (t *SquashedTable) Schema() sql.Schema

Schema implements the sql.Table interface.

func (*SquashedTable) String Uses

func (t *SquashedTable) String() string

type Table Uses

type Table interface {
    sql.FilteredTable
    sql.Checksumable
    sql.PartitionCounter
    // contains filtered or unexported methods
}

Table represents a gitbase table.

type TreeEntriesIter Uses

type TreeEntriesIter interface {
    ChainableIter
    // TreeEntry returns the current tree entry. All calls to TreeEntry return the
    // same tree entries until another call to Advance. Advance should
    // be called before calling TreeEntry.
    TreeEntry() *TreeEntry
}

TreeEntriesIter is a chainable iterator that operates on Tree Entries.

func NewAllTreeEntriesIter Uses

func NewAllTreeEntriesIter(filters sql.Expression) TreeEntriesIter

NewAllTreeEntriesIter returns an iterator that will return all tree entries that match the given filters.

func NewIndexTreeEntriesIter Uses

func NewIndexTreeEntriesIter(index sql.IndexLookup, filters sql.Expression) TreeEntriesIter

NewIndexTreeEntriesIter returns an iterator that will return all results in the given index.

func NewRepoTreeEntriesIter Uses

func NewRepoTreeEntriesIter(repos ReposIter, filters sql.Expression) TreeEntriesIter

NewRepoTreeEntriesIter returns an iterator that will return all tree entries for every repo returned by the given iterator.

func NewTreeTreeEntriesIter Uses

func NewTreeTreeEntriesIter(
    trees TreesIter,
    filters sql.Expression,
    virtual bool,
) TreeEntriesIter

NewTreeTreeEntriesIter returns an iterator that will return all tree entries for the trees returned by the given iterator.

type TreeEntry Uses

type TreeEntry struct {
    TreeHash plumbing.Hash
    object.TreeEntry
}

TreeEntry is a tree entry object.

type TreesIter Uses

type TreesIter interface {
    ChainableIter
    // Tree returns the current tree. All calls to Tree return the same tree
    // until another call to Advance. Advance should be called before calling
    // Tree.
    Tree() *object.Tree
}

TreesIter is a chainable iterator that operates on trees.

func NewAllCommitTreesIter Uses

func NewAllCommitTreesIter(filters sql.Expression) TreesIter

NewAllCommitTreesIter returns all commit trees.

func NewCommitMainTreeIter Uses

func NewCommitMainTreeIter(
    commits CommitsIter,
    filters sql.Expression,
    virtual bool,
) TreesIter

NewCommitMainTreeIter returns all main trees from the commits returned by the given commits iterator.

func NewCommitTreesIter Uses

func NewCommitTreesIter(
    commits CommitsIter,
    filters sql.Expression,
    virtual bool,
) TreesIter

NewCommitTreesIter returns all trees from the commits returned by the given commits iterator.

func NewIndexCommitTreesIter Uses

func NewIndexCommitTreesIter(index sql.IndexLookup, filters sql.Expression) TreesIter

NewIndexCommitTreesIter returns an iterator that will return all results in the given index.

Package gitbase imports 45 packages (graph). Updated 2019-03-14. Refresh now. Tools for package owners.