Documentation ¶
Index ¶
- type ObjectPool
- func (o *ObjectPool) Create(ctx context.Context, repo *gitalypb.Repository) (err error)
- func (o *ObjectPool) Exists() bool
- func (o *ObjectPool) FullPath() string
- func (o *ObjectPool) GetGitAlternateObjectDirectories() []string
- func (o *ObjectPool) GetGitObjectDirectory() string
- func (o *ObjectPool) GetRelativePath() string
- func (o *ObjectPool) GetStorageName() string
- func (o *ObjectPool) IsValid() bool
- func (o *ObjectPool) Link(ctx context.Context, repo *gitalypb.Repository) error
- func (o *ObjectPool) Remove(ctx context.Context) (err error)
- func (o *ObjectPool) ToProto() *gitalypb.ObjectPool
- func (o *ObjectPool) Unlink(ctx context.Context, repo *gitalypb.Repository) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectPool ¶
type ObjectPool struct {
// contains filtered or unexported fields
}
ObjectPool are a way to dedup objects between repositories, where the objects live in a pool in a distinct repository which is used as an alternate object store for other repositories.
func NewObjectPool ¶
func NewObjectPool(storageName, relativePath string) (pool *ObjectPool, err error)
NewObjectPool will initialize the object with the required data on the storage shard. If the shard cannot be found, this function returns an error
func (*ObjectPool) Create ¶
func (o *ObjectPool) Create(ctx context.Context, repo *gitalypb.Repository) (err error)
Create will create a pool for a repository and pull the required data to this pool. `repo` that is passed also joins the repository.
func (*ObjectPool) Exists ¶
func (o *ObjectPool) Exists() bool
Exists will return true if the pool path exists and is a directory
func (*ObjectPool) FullPath ¶
func (o *ObjectPool) FullPath() string
FullPath on disk, depending on the storage path, and the pools relative path
func (*ObjectPool) GetGitAlternateObjectDirectories ¶
func (o *ObjectPool) GetGitAlternateObjectDirectories() []string
GetGitAlternateObjectDirectories for object pools are empty, given pools are never a member of another pool, nor do they share Alternate objects with other repositories which the pool doesn't contain itself
func (*ObjectPool) GetGitObjectDirectory ¶
func (o *ObjectPool) GetGitObjectDirectory() string
GetGitObjectDirectory satisfies the repository.GitRepo interface, but is not used for ObjectPools
func (*ObjectPool) GetRelativePath ¶
func (o *ObjectPool) GetRelativePath() string
GetRelativePath will create the relative path to the ObjectPool from the storage path.
func (*ObjectPool) GetStorageName ¶
func (o *ObjectPool) GetStorageName() string
GetStorageName exposes the shard name, to satisfy the repository.GitRepo interface
func (*ObjectPool) IsValid ¶
func (o *ObjectPool) IsValid() bool
IsValid checks if a repository exists, and if its valid.
func (*ObjectPool) Link ¶ added in v1.4.0
func (o *ObjectPool) Link(ctx context.Context, repo *gitalypb.Repository) error
Link will write the relative path to the object pool from the repository that is to join the pool. This does not trigger deduplication, which is the responsibility of the caller.
func (*ObjectPool) Remove ¶
func (o *ObjectPool) Remove(ctx context.Context) (err error)
Remove will remove the pool, and all its contents without preparing and/or updating the repositories depending on this object pool Subdirectories will remain to exist, and will never be cleaned up, even when these are empty.
func (*ObjectPool) ToProto ¶
func (o *ObjectPool) ToProto() *gitalypb.ObjectPool
ToProto returns a new struct that is the protobuf definition of the ObjectPool
func (*ObjectPool) Unlink ¶ added in v1.9.0
func (o *ObjectPool) Unlink(ctx context.Context, repo *gitalypb.Repository) error
Unlink removes the alternates file, so Git won't look there anymore It removes the remote from the object pool too,