package contenthash
import "github.com/moby/buildkit/cache/contenthash"
Index ¶
- Variables
- func Checksum(ctx context.Context, ref cache.ImmutableRef, path string, followLinks bool, s session.Group) (digest.Digest, error)
- func ChecksumWildcard(ctx context.Context, ref cache.ImmutableRef, path string, followLinks bool, s session.Group) (digest.Digest, error)
- func ClearCacheContext(md *metadata.StorageItem)
- func NewFileHash(path string, fi os.FileInfo) (hash.Hash, error)
- func NewFromStat(stat *fstypes.Stat) (hash.Hash, error)
- func SetCacheContext(ctx context.Context, md *metadata.StorageItem, cc CacheContext) error
- func WriteV1TarsumHeaders(h *tar.Header, w io.Writer)
- type CacheContext
- type CacheRecord
- func (*CacheRecord) Descriptor() ([]byte, []int)
- func (m *CacheRecord) GetLinkname() string
- func (m *CacheRecord) GetType() CacheRecordType
- func (m *CacheRecord) Marshal() (dAtA []byte, err error)
- func (m *CacheRecord) MarshalTo(dAtA []byte) (int, error)
- func (m *CacheRecord) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CacheRecord) ProtoMessage()
- func (m *CacheRecord) Reset()
- func (m *CacheRecord) Size() (n int)
- func (m *CacheRecord) String() string
- func (m *CacheRecord) Unmarshal(dAtA []byte) error
- func (m *CacheRecord) XXX_DiscardUnknown()
- func (m *CacheRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CacheRecord) XXX_Merge(src proto.Message)
- func (m *CacheRecord) XXX_Size() int
- func (m *CacheRecord) XXX_Unmarshal(b []byte) error
- type CacheRecordType
- type CacheRecordWithPath
- func (*CacheRecordWithPath) Descriptor() ([]byte, []int)
- func (m *CacheRecordWithPath) GetPath() string
- func (m *CacheRecordWithPath) GetRecord() *CacheRecord
- func (m *CacheRecordWithPath) Marshal() (dAtA []byte, err error)
- func (m *CacheRecordWithPath) MarshalTo(dAtA []byte) (int, error)
- func (m *CacheRecordWithPath) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CacheRecordWithPath) ProtoMessage()
- func (m *CacheRecordWithPath) Reset()
- func (m *CacheRecordWithPath) Size() (n int)
- func (m *CacheRecordWithPath) String() string
- func (m *CacheRecordWithPath) Unmarshal(dAtA []byte) error
- func (m *CacheRecordWithPath) XXX_DiscardUnknown()
- func (m *CacheRecordWithPath) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CacheRecordWithPath) XXX_Merge(src proto.Message)
- func (m *CacheRecordWithPath) XXX_Size() int
- func (m *CacheRecordWithPath) XXX_Unmarshal(b []byte) error
- type CacheRecords
- func (*CacheRecords) Descriptor() ([]byte, []int)
- func (m *CacheRecords) GetPaths() []*CacheRecordWithPath
- func (m *CacheRecords) Marshal() (dAtA []byte, err error)
- func (m *CacheRecords) MarshalTo(dAtA []byte) (int, error)
- func (m *CacheRecords) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CacheRecords) ProtoMessage()
- func (m *CacheRecords) Reset()
- func (m *CacheRecords) Size() (n int)
- func (m *CacheRecords) String() string
- func (m *CacheRecords) Unmarshal(dAtA []byte) error
- func (m *CacheRecords) XXX_DiscardUnknown()
- func (m *CacheRecords) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CacheRecords) XXX_Merge(src proto.Message)
- func (m *CacheRecords) XXX_Size() int
- func (m *CacheRecords) XXX_Unmarshal(b []byte) error
- type Hashed
- type Wildcard
Variables ¶
var ( ErrInvalidLengthChecksum = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowChecksum = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupChecksum = fmt.Errorf("proto: unexpected end of group") )
Functions ¶
func Checksum ¶
func Checksum(ctx context.Context, ref cache.ImmutableRef, path string, followLinks bool, s session.Group) (digest.Digest, error)
func ChecksumWildcard ¶
func ChecksumWildcard(ctx context.Context, ref cache.ImmutableRef, path string, followLinks bool, s session.Group) (digest.Digest, error)
func ClearCacheContext ¶
func ClearCacheContext(md *metadata.StorageItem)
func NewFileHash ¶
NewFileHash returns new hash that is used for the builder cache keys
func NewFromStat ¶
func SetCacheContext ¶
func SetCacheContext(ctx context.Context, md *metadata.StorageItem, cc CacheContext) error
func WriteV1TarsumHeaders ¶
WriteV1TarsumHeaders writes a tar header to a writer in V1 tarsum format.
Types ¶
type CacheContext ¶
type CacheContext interface { Checksum(ctx context.Context, ref cache.Mountable, p string, followLinks bool, s session.Group) (digest.Digest, error) ChecksumWildcard(ctx context.Context, ref cache.Mountable, p string, followLinks bool, s session.Group) (digest.Digest, error) HandleChange(kind fsutil.ChangeKind, p string, fi os.FileInfo, err error) error }
func GetCacheContext ¶
func GetCacheContext(ctx context.Context, md *metadata.StorageItem, idmap *idtools.IdentityMapping) (CacheContext, error)
type CacheRecord ¶
type CacheRecord struct { Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,1,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"` Type CacheRecordType `protobuf:"varint,2,opt,name=type,proto3,enum=contenthash.CacheRecordType" json:"type,omitempty"` Linkname string `protobuf:"bytes,3,opt,name=linkname,proto3" json:"linkname,omitempty"` }
func (*CacheRecord) Descriptor ¶
func (*CacheRecord) Descriptor() ([]byte, []int)
func (*CacheRecord) GetLinkname ¶
func (m *CacheRecord) GetLinkname() string
func (*CacheRecord) GetType ¶
func (m *CacheRecord) GetType() CacheRecordType
func (*CacheRecord) Marshal ¶
func (m *CacheRecord) Marshal() (dAtA []byte, err error)
func (*CacheRecord) MarshalTo ¶
func (m *CacheRecord) MarshalTo(dAtA []byte) (int, error)
func (*CacheRecord) MarshalToSizedBuffer ¶
func (m *CacheRecord) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CacheRecord) ProtoMessage ¶
func (*CacheRecord) ProtoMessage()
func (*CacheRecord) Reset ¶
func (m *CacheRecord) Reset()
func (*CacheRecord) Size ¶
func (m *CacheRecord) Size() (n int)
func (*CacheRecord) String ¶
func (m *CacheRecord) String() string
func (*CacheRecord) Unmarshal ¶
func (m *CacheRecord) Unmarshal(dAtA []byte) error
func (*CacheRecord) XXX_DiscardUnknown ¶
func (m *CacheRecord) XXX_DiscardUnknown()
func (*CacheRecord) XXX_Marshal ¶
func (m *CacheRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CacheRecord) XXX_Merge ¶
func (m *CacheRecord) XXX_Merge(src proto.Message)
func (*CacheRecord) XXX_Size ¶
func (m *CacheRecord) XXX_Size() int
func (*CacheRecord) XXX_Unmarshal ¶
func (m *CacheRecord) XXX_Unmarshal(b []byte) error
type CacheRecordType ¶
type CacheRecordType int32
const ( CacheRecordTypeFile CacheRecordType = 0 CacheRecordTypeDir CacheRecordType = 1 CacheRecordTypeDirHeader CacheRecordType = 2 CacheRecordTypeSymlink CacheRecordType = 3 )
func (CacheRecordType) EnumDescriptor ¶
func (CacheRecordType) EnumDescriptor() ([]byte, []int)
func (CacheRecordType) String ¶
func (x CacheRecordType) String() string
type CacheRecordWithPath ¶
type CacheRecordWithPath struct { Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` Record *CacheRecord `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` }
func (*CacheRecordWithPath) Descriptor ¶
func (*CacheRecordWithPath) Descriptor() ([]byte, []int)
func (*CacheRecordWithPath) GetPath ¶
func (m *CacheRecordWithPath) GetPath() string
func (*CacheRecordWithPath) GetRecord ¶
func (m *CacheRecordWithPath) GetRecord() *CacheRecord
func (*CacheRecordWithPath) Marshal ¶
func (m *CacheRecordWithPath) Marshal() (dAtA []byte, err error)
func (*CacheRecordWithPath) MarshalTo ¶
func (m *CacheRecordWithPath) MarshalTo(dAtA []byte) (int, error)
func (*CacheRecordWithPath) MarshalToSizedBuffer ¶
func (m *CacheRecordWithPath) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CacheRecordWithPath) ProtoMessage ¶
func (*CacheRecordWithPath) ProtoMessage()
func (*CacheRecordWithPath) Reset ¶
func (m *CacheRecordWithPath) Reset()
func (*CacheRecordWithPath) Size ¶
func (m *CacheRecordWithPath) Size() (n int)
func (*CacheRecordWithPath) String ¶
func (m *CacheRecordWithPath) String() string
func (*CacheRecordWithPath) Unmarshal ¶
func (m *CacheRecordWithPath) Unmarshal(dAtA []byte) error
func (*CacheRecordWithPath) XXX_DiscardUnknown ¶
func (m *CacheRecordWithPath) XXX_DiscardUnknown()
func (*CacheRecordWithPath) XXX_Marshal ¶
func (m *CacheRecordWithPath) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CacheRecordWithPath) XXX_Merge ¶
func (m *CacheRecordWithPath) XXX_Merge(src proto.Message)
func (*CacheRecordWithPath) XXX_Size ¶
func (m *CacheRecordWithPath) XXX_Size() int
func (*CacheRecordWithPath) XXX_Unmarshal ¶
func (m *CacheRecordWithPath) XXX_Unmarshal(b []byte) error
type CacheRecords ¶
type CacheRecords struct { Paths []*CacheRecordWithPath `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"` }
func (*CacheRecords) Descriptor ¶
func (*CacheRecords) Descriptor() ([]byte, []int)
func (*CacheRecords) GetPaths ¶
func (m *CacheRecords) GetPaths() []*CacheRecordWithPath
func (*CacheRecords) Marshal ¶
func (m *CacheRecords) Marshal() (dAtA []byte, err error)
func (*CacheRecords) MarshalTo ¶
func (m *CacheRecords) MarshalTo(dAtA []byte) (int, error)
func (*CacheRecords) MarshalToSizedBuffer ¶
func (m *CacheRecords) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CacheRecords) ProtoMessage ¶
func (*CacheRecords) ProtoMessage()
func (*CacheRecords) Reset ¶
func (m *CacheRecords) Reset()
func (*CacheRecords) Size ¶
func (m *CacheRecords) Size() (n int)
func (*CacheRecords) String ¶
func (m *CacheRecords) String() string
func (*CacheRecords) Unmarshal ¶
func (m *CacheRecords) Unmarshal(dAtA []byte) error
func (*CacheRecords) XXX_DiscardUnknown ¶
func (m *CacheRecords) XXX_DiscardUnknown()
func (*CacheRecords) XXX_Marshal ¶
func (m *CacheRecords) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CacheRecords) XXX_Merge ¶
func (m *CacheRecords) XXX_Merge(src proto.Message)
func (*CacheRecords) XXX_Size ¶
func (m *CacheRecords) XXX_Size() int
func (*CacheRecords) XXX_Unmarshal ¶
func (m *CacheRecords) XXX_Unmarshal(b []byte) error
type Hashed ¶
type Wildcard ¶
type Wildcard struct { Path string Record *CacheRecord }
Source Files ¶
checksum.go checksum.pb.go filehash.go filehash_unix.go generate.go path.go tarsum.go
- Version
- v0.8.0-rc3
- Published
- Nov 26, 2020
- Platform
- js/wasm
- Imports
- 34 packages
- Last checked
- 1 second ago –
Tools for package owners.