Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeObject(ctx context.Context, server RemoteProvider, hash Hash) (t objects.ObjectType, obj objects.Object, retErr error)
- func FetchBlob(ctx context.Context, remote RemoteProvider, hash Hash) (content []byte, retErr error)
- func FetchObject[T any](ctx context.Context, remote RemoteProvider, hash Hash) (*T, error)
- func FetchRange(ctx context.Context, client *http.Client, urlStr string, start, end int64) (data []byte, retErr error)
- func NewContextWithUser(ctx context.Context, user User) context.Context
- func PushFile(ctx context.Context, fileName string, remote RemoteProvider) (hash entities.Hash, size int64, retErr error)
- func RobustFetchRange(ctx context.Context, client *http.Client, urlStr string, start, end int64, ...) ([]byte, error)
- func SetSegmentSize(size int64)
- type ACL
- type ACLEvaluator
- func (a *ACLEvaluator) DropCaches()
- func (a *ACLEvaluator) Evaluate(key ACLQuery) (bool, error)
- func (a *ACLEvaluator) EvaluateMapACLs(entity Entity, accessType AccessType) (bool, error)
- func (a *ACLEvaluator) Resolve(ctx context.Context, store entities.CASStore, hp *hashpath.HashPath, ...) (*hashpath.Resolution, error)
- type ACLQuery
- type ACLSnapshot
- type ARESService
- type AccessType
- type BundledMapResult
- type BundledObject
- type BundledReadCloser
- type BundledReader
- type CASRemoteStore
- func (s *CASRemoteStore) Close() error
- func (c *CASRemoteStore) GetDeepTree(h hash.Hash) (cas.DirEntryReadCloser, error)
- func (c *CASRemoteStore) GetDirEntries(h hash.Hash) (cas.DirEntryReadCloser, error)
- func (c *CASRemoteStore) GetDirList(hash.Hash) (cas.DirListReadCloser, error)
- func (c *CASRemoteStore) GetSymLink(h hash.Hash) (out string, retErr error)
- func (s *CASRemoteStore) Open() error
- func (c *CASRemoteStore) OpenFile(h hash.Hash) (io.ReadCloser, error)
- func (c *CASRemoteStore) Query(h hash.Hash) (*cas.QueryInfo, error)
- func (c *CASRemoteStore) Save(r io.Reader) (hash.Hash, error)
- func (c *CASRemoteStore) SaveDeepTree(r cas.DirEntryReader) (hash.Hash, error)
- func (c *CASRemoteStore) SaveDirEntries(r cas.DirEntryReader) (hash.Hash, error)
- func (c *CASRemoteStore) SaveDirList(r cas.DirListReader) (hash.Hash, error)
- func (c *CASRemoteStore) SaveFile(filepath string, size int64) (hash hash.Hash, retErr error)
- func (c *CASRemoteStore) SaveSymLink(target string) (hash.Hash, error)
- type CompressingCloser
- type CompressingProvider
- type ContentLink
- type ContentReadCloser
- func DecodeToRaw(reader ContentReadCloser) (ContentReadCloser, error)
- func EncodeToZStd(reader ContentReadCloser) (ContentReadCloser, error)
- func NewLinkReader(reader io.ReadCloser) ContentReadCloser
- func NewLinkReaderWithContext(ctx context.Context, reader io.ReadCloser, httpClient *http.Client) ContentReadCloser
- func NewZStdContentReader(content []byte) ContentReadCloser
- type ContentReader
- func ContentReaderFromBytes(data []byte) *ContentReader
- func NewBlobReader(reader io.ReadCloser, size int64) *ContentReader
- func NewBlobReaderFromBytes(content []byte) *ContentReader
- func NewContentReader(reader io.ReadCloser, encoding string) *ContentReader
- func NewContentReaderWithCustomClose(reader ContentReadCloser, close func() error) *ContentReader
- func NewReaderFromBytes(content []byte) *ContentReader
- type Entity
- type ErrObjectLinkValidation
- type ErrPermissionDenied
- type Hash
- type HashpathResolver
- type LimitedRemoteProvider
- func (r *LimitedRemoteProvider) ActiveRequests() int
- func (r *LimitedRemoteProvider) AddMapResult(ctx context.Context, from entities.Hash, to entities.Hash) error
- func (r *LimitedRemoteProvider) BlockedRequests() int
- func (r *LimitedRemoteProvider) Close() error
- func (r *LimitedRemoteProvider) GetObject(ctx context.Context, key Hash) (ContentReadCloser, error)
- func (r *LimitedRemoteProvider) GetRefs(ctx context.Context, server string, project string, refs []string) ([]Hash, error)
- func (r *LimitedRemoteProvider) Headers(ctx context.Context, keys []Hash) ([]entities.ObjectHeader, error)
- func (r *LimitedRemoteProvider) Limit() int
- func (r *LimitedRemoteProvider) MapResults(ctx context.Context, hash entities.Hash) ([]entities.Hash, error)
- func (r *LimitedRemoteProvider) Mark(ctx context.Context, hash entities.Hash, key string, value string) (int64, error)
- func (r *LimitedRemoteProvider) MaxConcurrent() int
- func (r *LimitedRemoteProvider) PutObject(ctx context.Context, key Hash, reader ContentReadCloser) error
- func (r *LimitedRemoteProvider) PutRefs(ctx context.Context, server string, project string, refs []entities.RefHash) error
- func (r *LimitedRemoteProvider) SHA256(ctx context.Context, keys []Hash) ([]entities.SHA256, error)
- func (r *LimitedRemoteProvider) SearchRefs(ctx context.Context, server string, project string, refPrefix string, ...) ([]entities.ProjectRefHash, error)
- func (r *LimitedRemoteProvider) SetLimit(limit int)
- func (r *LimitedRemoteProvider) Version(ctx context.Context) (string, error)
- func (r *LimitedRemoteProvider) WhoAmI(ctx context.Context) (string, error)
- type LinksContent
- type NopCloser
- type PatternedACL
- type ProjectRefHash
- type RefHash
- type RemoteCloser
- type RemoteProvider
- type RemoteStore
- func (s *RemoteStore) AddMapResult(ctx context.Context, from entities.Hash, to entities.Hash) error
- func (s *RemoteStore) CAS() cas.Store
- func (s *RemoteStore) Close() error
- func (s *RemoteStore) GetObject(ctx context.Context, key entities.Hash) ([]byte, error)
- func (s *RemoteStore) GetRefs(server string, project string, refs []string) ([]entities.Hash, error)
- func (s *RemoteStore) GetTree(ctx context.Context, key entities.Hash) ([]byte, entities.TreeMeta, error)
- func (s *RemoteStore) HealthCheck() error
- func (s *RemoteStore) IsObjectRemote(ctx context.Context, key entities.Hash) (bool, error)
- func (s *RemoteStore) KeepAlive(ctx context.Context, key entities.Hash) error
- func (s *RemoteStore) MapResults(ctx context.Context, id entities.Hash) ([]entities.Hash, error)
- func (s *RemoteStore) ObjectHeader(ctx context.Context, key entities.Hash) (entities.ObjectHeader, error)
- func (s *RemoteStore) OpenBlob(ctx context.Context, key entities.Hash) (io.ReadCloser, error)
- func (s *RemoteStore) OpenObjectFile(ctx context.Context, key entities.Hash) (io.ReadCloser, error)
- func (s *RemoteStore) PutObject(ctx context.Context, key entities.Hash, content []byte) error
- func (s *RemoteStore) PutRefs(server string, project string, refs []entities.RefHash) error
- func (s *RemoteStore) PutTree(ctx context.Context, key entities.Hash, content []byte, meta entities.TreeMeta) error
- func (s *RemoteStore) RefreshMapResults(ctx context.Context, id entities.Hash) error
- func (s *RemoteStore) SearchRefs(server string, project string, refPrefix string, limit int) ([]entities.ProjectRefHash, error)
- func (s *RemoteStore) StartGC(ctx context.Context) error
- func (s *RemoteStore) Stat(ctx context.Context, key entities.Hash) (entities.StatInfo, error)
- func (s *RemoteStore) WriteBlob(ctx context.Context, key entities.Hash, size int64, reader io.Reader) error
- func (s *RemoteStore) WriteObject(ctx context.Context, key entities.Hash, reader io.Reader) error
- type User
- type Validator
- type ValidatorOpts
Constants ¶
const ( // Fallback project for wider ACLs. AllProjects = "abfs-all-projects" // File with patterns for wildcarding. DefaultACLFile = "default.json" // Permissions to access ACLs. // acl@ABFSMetaProject@ABFSMetaServer:abfs-meta-acl MetaACLFile = "abfs-meta-acl" // Permissions to access Maps. // acl@ABFSMetaProject@ABFSMetaServer:abfs-maps MapsACLFile = "abfs-maps" // Ref namespace for ACLs. ACLRef = "acl" // Sentinel allow all group AllGroup = "group:ALL" )
const ( GroupPrefix = "group:" UserPrefix = "user:" )
const ( EncodingRaw = "raw" EncodingZStd = "zstd" EncodingLinks = "links" )
const ( LinkTypeBase64 = "base64" LinkTypeURL = "url" )
const ( DefaultMaxConcurrentSegments = 16 // up to 16 concurrent range downloads DefaultMaxRetries = 5 // up to 5 retries per segment on network/server errors )
Variables ¶
var ErrInvalidRange = fmt.Errorf("invalid range")
var ErrNotSupported = fmt.Errorf("not supported")
var ErrRemoteNotSupportRange = fmt.Errorf("server does not support range requests")
var SegmentSize int64 = 16 * 1024 * 1024 // 16 MiB per range segment by default
Functions ¶
func DecodeObject ¶
func DecodeObject(ctx context.Context, server RemoteProvider, hash Hash) (t objects.ObjectType, obj objects.Object, retErr error)
func FetchObject ¶
func FetchRange ¶
func FetchRange(ctx context.Context, client *http.Client, urlStr string, start, end int64) (data []byte, retErr error)
FetchRange downloads the content in the range [start, end) from the specified URL. It assumes the range is small enough to fit in memory and returning []byte makes sense.
func NewContextWithUser ¶
NewContextWithUser returns a new context with the given user.
func RobustFetchRange ¶
func RobustFetchRange(ctx context.Context, client *http.Client, urlStr string, start, end int64, maxRetries int, initialBackoff time.Duration) ([]byte, error)
RobustFetchRange fetches a byte range from the specified URL with retries on failure, returning the downloaded bytes.
func SetSegmentSize ¶
func SetSegmentSize(size int64)
Types ¶
type ACL ¶
ACL is the structured form of ACL data present in the CAS Store. It's applicable for direct mirrors of a reference: e.g.
ref -> 'refs/heads/main' acl -> 'acl:refs/heads/main'
func (*ACL) AddReaders ¶
AddReaders adds entities to the Readers list, ensuring no duplicates.
func (*ACL) AddWriters ¶
AddWriters adds entities to the Writers list, ensuring no duplicates.
func (*ACL) RemoveReaders ¶
RemoveReaders removes entities from the Readers list.
func (*ACL) RemoveWriters ¶
RemoveWriters removes entities from the Writers list.
type ACLEvaluator ¶
type ACLEvaluator struct {
// contains filtered or unexported fields
}
func NewACLEvaluator ¶
func NewACLEvaluator(store entities.CASStore) *ACLEvaluator
func NewACLEvaluatorWithResolver ¶
func NewACLEvaluatorWithResolver(store entities.CASStore, resolver HashpathResolver) *ACLEvaluator
func (*ACLEvaluator) DropCaches ¶
func (a *ACLEvaluator) DropCaches()
func (*ACLEvaluator) Evaluate ¶
func (a *ACLEvaluator) Evaluate(key ACLQuery) (bool, error)
Evaluate returns true if the entity passes the ACL check for a ref. Hierarchy and the meta project may be searched.
func (*ACLEvaluator) EvaluateMapACLs ¶
func (a *ACLEvaluator) EvaluateMapACLs(entity Entity, accessType AccessType) (bool, error)
EvaluateMapACLs checks if a user is able to read or write map results.
type ACLQuery ¶
type ACLQuery struct {
Server string
Project string
// RefPath is normally a ref, such as 'refs/heads/main'. This is resolved
// with a hierarchical search in the 'acl' refspace.
// When used in Meta searches (acl refs, maps, etc...), this is a relative
// path from the directory which the 'acl' ref points. This is resolved
// with a single, flat search at the path.
RefPath string
Entity Entity
AccessType
}
ACLQuery is the payload issued to evaluate whether an entity has access.
type ACLSnapshot ¶
type ACLSnapshot struct {
TreeHash entities.Hash
ACLs map[string]*ACL
PatternedACLs map[string]*PatternedACL
}
ACLSnapshot is an in-memory snapshot of the ACL tree for a (sever, project) tuple.
type ARESService ¶
type AccessType ¶
type AccessType int
const ( AuthRead AccessType = iota AuthWrite )
func (AccessType) String ¶
func (a AccessType) String() string
type BundledMapResult ¶
BundledMapResult represents an additional map result to be eagerly persisted.
type BundledObject ¶
BundledObject represents an additional object to be eagerly persisted.
type BundledReadCloser ¶
type BundledReadCloser interface {
ContentReadCloser
// Blobs returns objects that should be stored in the local blob store, i.e. files and symlinks.
Blobs() []BundledObject
// Objects returns objects that should be stored in the local object store, i.e. trees.
Objects() []BundledObject
// MapResults returns mapping entries that should be stored in the local map store.
MapResults() []BundledMapResult
}
BundledReadCloser extends ContentReadCloser to allow a GetObject call to return additional "side-car" objects discovered during the primary fetch. This is used to optimize fetches (e.g., returning symlink targets along with a tree).
type BundledReader ¶
type BundledReader struct {
ContentReadCloser
// contains filtered or unexported fields
}
BundledReader implements BundledReadCloser by wrapping a ContentReadCloser and carrying a map of extra objects discovered during a fetch.
func NewBundledReader ¶
func NewBundledReader(reader ContentReadCloser, blobs []BundledObject, objects []BundledObject, mapResults []BundledMapResult) *BundledReader
NewBundledReader creates a reader that includes additional side-car objects.
func (*BundledReader) Blobs ¶
func (r *BundledReader) Blobs() []BundledObject
func (*BundledReader) MapResults ¶
func (r *BundledReader) MapResults() []BundledMapResult
func (*BundledReader) Objects ¶
func (r *BundledReader) Objects() []BundledObject
type CASRemoteStore ¶
type CASRemoteStore struct {
// contains filtered or unexported fields
}
Provide a bindcas.Store with the remote object.
func (*CASRemoteStore) Close ¶
func (s *CASRemoteStore) Close() error
func (*CASRemoteStore) GetDeepTree ¶
func (c *CASRemoteStore) GetDeepTree(h hash.Hash) (cas.DirEntryReadCloser, error)
func (*CASRemoteStore) GetDirEntries ¶
func (c *CASRemoteStore) GetDirEntries(h hash.Hash) (cas.DirEntryReadCloser, error)
func (*CASRemoteStore) GetDirList ¶
func (c *CASRemoteStore) GetDirList(hash.Hash) (cas.DirListReadCloser, error)
func (*CASRemoteStore) GetSymLink ¶
func (c *CASRemoteStore) GetSymLink(h hash.Hash) (out string, retErr error)
func (*CASRemoteStore) Open ¶
func (s *CASRemoteStore) Open() error
func (*CASRemoteStore) OpenFile ¶
func (c *CASRemoteStore) OpenFile(h hash.Hash) (io.ReadCloser, error)
func (*CASRemoteStore) SaveDeepTree ¶
func (c *CASRemoteStore) SaveDeepTree(r cas.DirEntryReader) (hash.Hash, error)
func (*CASRemoteStore) SaveDirEntries ¶
func (c *CASRemoteStore) SaveDirEntries(r cas.DirEntryReader) (hash.Hash, error)
func (*CASRemoteStore) SaveDirList ¶
func (c *CASRemoteStore) SaveDirList(r cas.DirListReader) (hash.Hash, error)
func (*CASRemoteStore) SaveSymLink ¶
func (c *CASRemoteStore) SaveSymLink(target string) (hash.Hash, error)
type CompressingCloser ¶
type CompressingCloser struct {
*CompressingProvider
// contains filtered or unexported fields
}
CompressingCloser wraps a RemoteCloser and handles compression/decompression.
func NewCompressingCloser ¶
func NewCompressingCloser(remote RemoteCloser) *CompressingCloser
NewCompressingCloser creates a new CompressingCloser.
func (*CompressingCloser) Close ¶
func (c *CompressingCloser) Close() error
type CompressingProvider ¶
type CompressingProvider struct {
RemoteProvider
}
CompressingProvider wraps a RemoteProvider and handles compression/decompression.
func NewCompressingProvider ¶
func NewCompressingProvider(remote RemoteProvider) *CompressingProvider
NewCompressingProvider creates a new CompressingProvider.
func (*CompressingProvider) GetObject ¶
func (c *CompressingProvider) GetObject(ctx context.Context, key Hash) (ContentReadCloser, error)
GetObject implements RemoteProvider.
func (*CompressingProvider) PutObject ¶
func (c *CompressingProvider) PutObject(ctx context.Context, key Hash, reader ContentReadCloser) (retErr error)
PutObject implements RemoteProvider.
type ContentLink ¶
type ContentReadCloser ¶
type ContentReadCloser interface {
io.ReadCloser
Encoding() string
}
func DecodeToRaw ¶
func DecodeToRaw(reader ContentReadCloser) (ContentReadCloser, error)
func EncodeToZStd ¶
func EncodeToZStd(reader ContentReadCloser) (ContentReadCloser, error)
func NewLinkReader ¶
func NewLinkReader(reader io.ReadCloser) ContentReadCloser
func NewLinkReaderWithContext ¶
func NewLinkReaderWithContext(ctx context.Context, reader io.ReadCloser, httpClient *http.Client) ContentReadCloser
func NewZStdContentReader ¶
func NewZStdContentReader(content []byte) ContentReadCloser
type ContentReader ¶
type ContentReader struct {
// contains filtered or unexported fields
}
func ContentReaderFromBytes ¶
func ContentReaderFromBytes(data []byte) *ContentReader
func NewBlobReader ¶
func NewBlobReader(reader io.ReadCloser, size int64) *ContentReader
func NewBlobReaderFromBytes ¶
func NewBlobReaderFromBytes(content []byte) *ContentReader
func NewContentReader ¶
func NewContentReader(reader io.ReadCloser, encoding string) *ContentReader
func NewContentReaderWithCustomClose ¶
func NewContentReaderWithCustomClose(reader ContentReadCloser, close func() error) *ContentReader
func NewReaderFromBytes ¶
func NewReaderFromBytes(content []byte) *ContentReader
func (*ContentReader) Close ¶
func (r *ContentReader) Close() error
func (*ContentReader) Encoding ¶
func (r *ContentReader) Encoding() string
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
Entity is the unit of granularity that can have ACLs applied. Examples are... user:foo@domain.com group:groupName@example.com
func (Entity) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Entity) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type ErrObjectLinkValidation ¶
type ErrObjectLinkValidation struct {
MissingLinks []Hash
}
func (*ErrObjectLinkValidation) Error ¶
func (e *ErrObjectLinkValidation) Error() string
type ErrPermissionDenied ¶
type ErrPermissionDenied struct {
Action string
}
func (*ErrPermissionDenied) Error ¶
func (e *ErrPermissionDenied) Error() string
type HashpathResolver ¶
type HashpathResolver interface {
ResolveBase(ctx context.Context, store entities.CASStore, hp *hashpath.HashPath, defaultServer, defaultProject string) (hashpath.BaseDirRef, error)
ResolvePath(ctx context.Context, store entities.CASStore, baseDirRef hashpath.BaseDirRef, hp *hashpath.HashPath) (*hashpath.Resolution, error)
}
type LimitedRemoteProvider ¶
type LimitedRemoteProvider struct {
// contains filtered or unexported fields
}
func NewLimitedRemote ¶
func NewLimitedRemote(c RemoteCloser, concurrencyLimit int) *LimitedRemoteProvider
func (*LimitedRemoteProvider) ActiveRequests ¶
func (r *LimitedRemoteProvider) ActiveRequests() int
func (*LimitedRemoteProvider) AddMapResult ¶
func (r *LimitedRemoteProvider) AddMapResult(ctx context.Context, from entities.Hash, to entities.Hash) error
AddMapResult implements RemoteProvider.
func (*LimitedRemoteProvider) BlockedRequests ¶
func (r *LimitedRemoteProvider) BlockedRequests() int
func (*LimitedRemoteProvider) Close ¶
func (r *LimitedRemoteProvider) Close() error
Close implements RemoteCloser.
func (*LimitedRemoteProvider) GetObject ¶
func (r *LimitedRemoteProvider) GetObject(ctx context.Context, key Hash) (ContentReadCloser, error)
GetObject implements RemoteProvider.
func (*LimitedRemoteProvider) GetRefs ¶
func (r *LimitedRemoteProvider) GetRefs(ctx context.Context, server string, project string, refs []string) ([]Hash, error)
GetRefs implements RemoteProvider.
func (*LimitedRemoteProvider) Headers ¶
func (r *LimitedRemoteProvider) Headers(ctx context.Context, keys []Hash) ([]entities.ObjectHeader, error)
Headers implements RemoteProvider.
func (*LimitedRemoteProvider) Limit ¶
func (r *LimitedRemoteProvider) Limit() int
func (*LimitedRemoteProvider) MapResults ¶
func (r *LimitedRemoteProvider) MapResults(ctx context.Context, hash entities.Hash) ([]entities.Hash, error)
MapResults implements RemoteProvider.
func (*LimitedRemoteProvider) Mark ¶
func (r *LimitedRemoteProvider) Mark(ctx context.Context, hash entities.Hash, key string, value string) (int64, error)
Mark implements RemoteProvider.
func (*LimitedRemoteProvider) MaxConcurrent ¶
func (r *LimitedRemoteProvider) MaxConcurrent() int
func (*LimitedRemoteProvider) PutObject ¶
func (r *LimitedRemoteProvider) PutObject(ctx context.Context, key Hash, reader ContentReadCloser) error
PutObject implements RemoteProvider.
func (*LimitedRemoteProvider) PutRefs ¶
func (r *LimitedRemoteProvider) PutRefs(ctx context.Context, server string, project string, refs []entities.RefHash) error
PutRefs implements RemoteProvider.
func (*LimitedRemoteProvider) SearchRefs ¶
func (r *LimitedRemoteProvider) SearchRefs(ctx context.Context, server string, project string, refPrefix string, limit int) ([]entities.ProjectRefHash, error)
SearchRefs implements RemoteProvider.
func (*LimitedRemoteProvider) SetLimit ¶
func (r *LimitedRemoteProvider) SetLimit(limit int)
SetLimit changes the concurrency limit. Operations already in progress or waiting to acquire a token on the old semaphore will continue to use the old limit. New operations will use the new limit. This means it is possible to temporarily exceed the limit.
type LinksContent ¶
type LinksContent struct {
Encoding string
Links []ContentLink
}
type NopCloser ¶
type NopCloser struct {
RemoteProvider
}
type PatternedACL ¶
PatternedACL is the structured form of ACL data present in the CAS Store. It's applicable for the wide, fallback ACLs found at 'default.json'. e.g.
ref -> 'refs/heads/main' acl -> 'acl:refs/heads/default.json'
func (*PatternedACL) Validate ¶
func (p *PatternedACL) Validate() error
Validate checks that patterns follow the supported rules: 1. No multiple wildcards. 2. No middle wildcards (must be suffix). 3. No duplicate '/' separators.
type ProjectRefHash ¶
type ProjectRefHash = entities.ProjectRefHash
type RemoteCloser ¶
type RemoteCloser interface {
RemoteProvider
io.Closer
}
type RemoteProvider ¶
type RemoteProvider interface {
// Headers returns a slice of headers corresponding to the provided keys.
// The returned slice is ordered to match the input keys. If a header for a
// given key is not found, the header at the corresponding index will be empty
// (i.e., its IsEmpty() method will return true).
Headers(ctx context.Context, keys []Hash) ([]entities.ObjectHeader, error)
SHA256(ctx context.Context, keys []Hash) ([]entities.SHA256, error)
GetObject(ctx context.Context, key Hash) (ContentReadCloser, error)
PutObject(ctx context.Context, key Hash, reader ContentReadCloser) error
MapResults(ctx context.Context, from Hash) ([]Hash, error)
AddMapResult(ctx context.Context, from, to Hash) error
GetRefs(ctx context.Context, server string, project string, refs []string) ([]Hash, error)
SearchRefs(ctx context.Context, server string, project string, refPrefix string, limit int) ([]ProjectRefHash, error)
PutRefs(ctx context.Context, server string, project string, refs []RefHash) error
Mark(ctx context.Context, hash Hash, key, value string) (int64, error)
Version(ctx context.Context) (string, error)
WhoAmI(ctx context.Context) (string, error)
}
type RemoteStore ¶
type RemoteStore struct {
// contains filtered or unexported fields
}
func NewRemoteStore ¶
func NewRemoteStore(remote RemoteCloser) *RemoteStore
NewRemoteStore returns a RemoteStore that does not alter compression of objects. If the objects are compressed and the provided RemoteCloser does not handle the compression, wrap the RemoteCloser in a CompressiongCloser first.
func (*RemoteStore) AddMapResult ¶
AddMapResult implements entities.CASStore.
func (*RemoteStore) CAS ¶
func (s *RemoteStore) CAS() cas.Store
func (*RemoteStore) GetRefs ¶
func (s *RemoteStore) GetRefs(server string, project string, refs []string) ([]entities.Hash, error)
GetRefs implements entities.CASStore.
func (*RemoteStore) GetTree ¶
func (s *RemoteStore) GetTree(ctx context.Context, key entities.Hash) ([]byte, entities.TreeMeta, error)
GetTree implements entities.CASStore.
func (*RemoteStore) HealthCheck ¶
func (s *RemoteStore) HealthCheck() error
func (*RemoteStore) IsObjectRemote ¶
IsObjectRemote implements entities.CASStore
func (*RemoteStore) MapResults ¶
MapResults implements entities.CASStore.
func (*RemoteStore) ObjectHeader ¶
func (s *RemoteStore) ObjectHeader(ctx context.Context, key entities.Hash) (entities.ObjectHeader, error)
ObjectSize implements entities.CASStore.
func (*RemoteStore) OpenBlob ¶
func (s *RemoteStore) OpenBlob(ctx context.Context, key entities.Hash) (io.ReadCloser, error)
OpenBlob implements entities.CASStore.
func (*RemoteStore) OpenObjectFile ¶
func (s *RemoteStore) OpenObjectFile(ctx context.Context, key entities.Hash) (io.ReadCloser, error)
OpenObjectFile implements entities.CASStore.
func (*RemoteStore) PutTree ¶
func (s *RemoteStore) PutTree(ctx context.Context, key entities.Hash, content []byte, meta entities.TreeMeta) error
PutTree implements entities.CASStore.
func (*RemoteStore) RefreshMapResults ¶
RefreshMapResults implements entities.CASStore.
func (*RemoteStore) SearchRefs ¶
func (s *RemoteStore) SearchRefs(server string, project string, refPrefix string, limit int) ([]entities.ProjectRefHash, error)
SearchRefs implements entities.CASStore.
func (*RemoteStore) StartGC ¶
func (s *RemoteStore) StartGC(ctx context.Context) error
StartGC implements entities.CASStore
func (*RemoteStore) WriteBlob ¶
func (s *RemoteStore) WriteBlob(ctx context.Context, key entities.Hash, size int64, reader io.Reader) error
WriteBlob implements entities.CASStore.
func (*RemoteStore) WriteObject ¶
WriteObject implements entities.CASStore.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func NewValidator(hash Hash, encoding string, opts ...ValidatorOpts) (*Validator, error)
type ValidatorOpts ¶
type ValidatorOpts interface{}
func ExtractLinksOpt ¶
func ExtractLinksOpt(value bool) ValidatorOpts
func ValidateHashOpt ¶
func ValidateHashOpt(value bool) ValidatorOpts