package contenthash

import "github.com/moby/buildkit/cache/contenthash"

Index

Constants

const (
	CacheRecordTypeFile      = CacheRecordType_FILE
	CacheRecordTypeDir       = CacheRecordType_DIR
	CacheRecordTypeDirHeader = CacheRecordType_DIR_HEADER
	CacheRecordTypeSymlink   = CacheRecordType_SYMLINK
)

Variables

var (
	CacheRecordType_name = map[int32]string{
		0: "FILE",
		1: "DIR",
		2: "DIR_HEADER",
		3: "SYMLINK",
	}
	CacheRecordType_value = map[string]int32{
		"FILE":       0,
		"DIR":        1,
		"DIR_HEADER": 2,
		"SYMLINK":    3,
	}
)

Enum value maps for CacheRecordType.

var File_github_com_moby_buildkit_cache_contenthash_checksum_proto protoreflect.FileDescriptor

Functions

func Checksum

func Checksum(ctx context.Context, ref cache.ImmutableRef, path string, opts ChecksumOpts, s session.Group) (digest.Digest, error)

func ClearCacheContext

func ClearCacheContext(md cache.RefMetadata)

func NewFileHash

func NewFileHash(path string, fi os.FileInfo) (hash.Hash, error)

NewFileHash returns new hash that is used for the builder cache keys

func NewFromStat

func NewFromStat(stat *fstypes.Stat) (hash.Hash, error)

func SetCacheContext

func SetCacheContext(ctx context.Context, md cache.RefMetadata, cc CacheContext) error

func WriteV1TarsumHeaders

func WriteV1TarsumHeaders(h *tar.Header, w io.Writer)

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, opts ChecksumOpts, 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 cache.RefMetadata) (CacheContext, error)

type CacheRecord

type CacheRecord struct {
	Digest   string          `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"`
	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"`
	// contains filtered or unexported fields
}

func (*CacheRecord) CloneMessageVT

func (m *CacheRecord) CloneMessageVT() proto.Message

func (*CacheRecord) CloneVT

func (m *CacheRecord) CloneVT() *CacheRecord

func (*CacheRecord) Descriptor

func (*CacheRecord) Descriptor() ([]byte, []int)

Deprecated: Use CacheRecord.ProtoReflect.Descriptor instead.

func (*CacheRecord) EqualMessageVT

func (this *CacheRecord) EqualMessageVT(thatMsg proto.Message) bool

func (*CacheRecord) EqualVT

func (this *CacheRecord) EqualVT(that *CacheRecord) bool

func (*CacheRecord) GetDigest

func (x *CacheRecord) GetDigest() string

func (*CacheRecord) GetLinkname

func (x *CacheRecord) GetLinkname() string

func (*CacheRecord) GetType

func (x *CacheRecord) GetType() CacheRecordType

func (*CacheRecord) MarshalToSizedBufferVT

func (m *CacheRecord) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*CacheRecord) MarshalToVT

func (m *CacheRecord) MarshalToVT(dAtA []byte) (int, error)

func (*CacheRecord) MarshalVT

func (m *CacheRecord) MarshalVT() (dAtA []byte, err error)

func (*CacheRecord) ProtoMessage

func (*CacheRecord) ProtoMessage()

func (*CacheRecord) ProtoReflect

func (x *CacheRecord) ProtoReflect() protoreflect.Message

func (*CacheRecord) Reset

func (x *CacheRecord) Reset()

func (*CacheRecord) SizeVT

func (m *CacheRecord) SizeVT() (n int)

func (*CacheRecord) String

func (x *CacheRecord) String() string

func (*CacheRecord) UnmarshalVT

func (m *CacheRecord) UnmarshalVT(dAtA []byte) error

type CacheRecordType

type CacheRecordType int32
const (
	CacheRecordType_FILE       CacheRecordType = 0
	CacheRecordType_DIR        CacheRecordType = 1
	CacheRecordType_DIR_HEADER CacheRecordType = 2
	CacheRecordType_SYMLINK    CacheRecordType = 3
)

func (CacheRecordType) Descriptor

func (CacheRecordType) Enum

func (x CacheRecordType) Enum() *CacheRecordType

func (CacheRecordType) EnumDescriptor

func (CacheRecordType) EnumDescriptor() ([]byte, []int)

Deprecated: Use CacheRecordType.Descriptor instead.

func (CacheRecordType) Number

func (CacheRecordType) String

func (x CacheRecordType) String() string

func (CacheRecordType) Type

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"`
	// contains filtered or unexported fields
}

func (*CacheRecordWithPath) CloneMessageVT

func (m *CacheRecordWithPath) CloneMessageVT() proto.Message

func (*CacheRecordWithPath) CloneVT

func (*CacheRecordWithPath) Descriptor

func (*CacheRecordWithPath) Descriptor() ([]byte, []int)

Deprecated: Use CacheRecordWithPath.ProtoReflect.Descriptor instead.

func (*CacheRecordWithPath) EqualMessageVT

func (this *CacheRecordWithPath) EqualMessageVT(thatMsg proto.Message) bool

func (*CacheRecordWithPath) EqualVT

func (this *CacheRecordWithPath) EqualVT(that *CacheRecordWithPath) bool

func (*CacheRecordWithPath) GetPath

func (x *CacheRecordWithPath) GetPath() string

func (*CacheRecordWithPath) GetRecord

func (x *CacheRecordWithPath) GetRecord() *CacheRecord

func (*CacheRecordWithPath) MarshalToSizedBufferVT

func (m *CacheRecordWithPath) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*CacheRecordWithPath) MarshalToVT

func (m *CacheRecordWithPath) MarshalToVT(dAtA []byte) (int, error)

func (*CacheRecordWithPath) MarshalVT

func (m *CacheRecordWithPath) MarshalVT() (dAtA []byte, err error)

func (*CacheRecordWithPath) ProtoMessage

func (*CacheRecordWithPath) ProtoMessage()

func (*CacheRecordWithPath) ProtoReflect

func (x *CacheRecordWithPath) ProtoReflect() protoreflect.Message

func (*CacheRecordWithPath) Reset

func (x *CacheRecordWithPath) Reset()

func (*CacheRecordWithPath) SizeVT

func (m *CacheRecordWithPath) SizeVT() (n int)

func (*CacheRecordWithPath) String

func (x *CacheRecordWithPath) String() string

func (*CacheRecordWithPath) UnmarshalVT

func (m *CacheRecordWithPath) UnmarshalVT(dAtA []byte) error

type CacheRecords

type CacheRecords struct {
	Paths []*CacheRecordWithPath `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"`
	// contains filtered or unexported fields
}

func (*CacheRecords) CloneMessageVT

func (m *CacheRecords) CloneMessageVT() proto.Message

func (*CacheRecords) CloneVT

func (m *CacheRecords) CloneVT() *CacheRecords

func (*CacheRecords) Descriptor

func (*CacheRecords) Descriptor() ([]byte, []int)

Deprecated: Use CacheRecords.ProtoReflect.Descriptor instead.

func (*CacheRecords) EqualMessageVT

func (this *CacheRecords) EqualMessageVT(thatMsg proto.Message) bool

func (*CacheRecords) EqualVT

func (this *CacheRecords) EqualVT(that *CacheRecords) bool

func (*CacheRecords) GetPaths

func (x *CacheRecords) GetPaths() []*CacheRecordWithPath

func (*CacheRecords) MarshalToSizedBufferVT

func (m *CacheRecords) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*CacheRecords) MarshalToVT

func (m *CacheRecords) MarshalToVT(dAtA []byte) (int, error)

func (*CacheRecords) MarshalVT

func (m *CacheRecords) MarshalVT() (dAtA []byte, err error)

func (*CacheRecords) ProtoMessage

func (*CacheRecords) ProtoMessage()

func (*CacheRecords) ProtoReflect

func (x *CacheRecords) ProtoReflect() protoreflect.Message

func (*CacheRecords) Reset

func (x *CacheRecords) Reset()

func (*CacheRecords) SizeVT

func (m *CacheRecords) SizeVT() (n int)

func (*CacheRecords) String

func (x *CacheRecords) String() string

func (*CacheRecords) UnmarshalVT

func (m *CacheRecords) UnmarshalVT(dAtA []byte) error

type ChecksumOpts

type ChecksumOpts struct {
	FollowLinks     bool
	Wildcard        bool
	IncludePatterns []string
	ExcludePatterns []string
}

type Hashed

type Hashed interface {
	Digest() digest.Digest
}

Source Files

checksum.go checksum.pb.go checksum_unix.go checksum_vtproto.pb.go filehash.go filehash_unix.go path.go tarsum.go

Version
v0.20.0
Published
Feb 19, 2025
Platform
js/wasm
Imports
35 packages
Last checked
2 minutes ago

Tools for package owners.