contenthash

package
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthChecksum        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowChecksum          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupChecksum = fmt.Errorf("proto: unexpected end of group")
)
View Source
var CacheRecordType_name = map[int32]string{
	0: "FILE",
	1: "DIR",
	2: "DIR_HEADER",
	3: "SYMLINK",
}
View Source
var CacheRecordType_value = map[string]int32{
	"FILE":       0,
	"DIR":        1,
	"DIR_HEADER": 2,
	"SYMLINK":    3,
}

Functions

func Checksum added in v0.21.0

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

func ClearCacheContext added in v0.21.0

func ClearCacheContext(md cache.RefMetadata)

func NewFileHash added in v0.21.0

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

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

func NewFromStat added in v0.21.0

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

func SetCacheContext added in v0.21.0

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

func WriteV1TarsumHeaders added in v0.21.0

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

WriteV1TarsumHeaders writes a tar header to a writer in V1 tarsum format.

Types

type CacheContext added in v0.21.0

type CacheContext interface {
	Checksum(ctx context.Context, ref cache.Mountable, p string, opts ChecksumOpts) (digest.Digest, error)
	HandleChange(kind fsutil.ChangeKind, p string, fi os.FileInfo, err error) error
}

func GetCacheContext added in v0.21.0

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

type CacheRecord added in v0.21.0

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 added in v0.21.0

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

func (*CacheRecord) GetLinkname added in v0.21.0

func (m *CacheRecord) GetLinkname() string

func (*CacheRecord) GetType added in v0.21.0

func (m *CacheRecord) GetType() CacheRecordType

func (*CacheRecord) Marshal added in v0.21.0

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

func (*CacheRecord) MarshalTo added in v0.21.0

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

func (*CacheRecord) MarshalToSizedBuffer added in v0.21.0

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

func (*CacheRecord) ProtoMessage added in v0.21.0

func (*CacheRecord) ProtoMessage()

func (*CacheRecord) Reset added in v0.21.0

func (m *CacheRecord) Reset()

func (*CacheRecord) Size added in v0.21.0

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

func (*CacheRecord) String added in v0.21.0

func (m *CacheRecord) String() string

func (*CacheRecord) Unmarshal added in v0.21.0

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

func (*CacheRecord) XXX_DiscardUnknown added in v0.21.0

func (m *CacheRecord) XXX_DiscardUnknown()

func (*CacheRecord) XXX_Marshal added in v0.21.0

func (m *CacheRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CacheRecord) XXX_Merge added in v0.21.0

func (m *CacheRecord) XXX_Merge(src proto.Message)

func (*CacheRecord) XXX_Size added in v0.21.0

func (m *CacheRecord) XXX_Size() int

func (*CacheRecord) XXX_Unmarshal added in v0.21.0

func (m *CacheRecord) XXX_Unmarshal(b []byte) error

type CacheRecordType added in v0.21.0

type CacheRecordType int32
const (
	CacheRecordTypeFile      CacheRecordType = 0
	CacheRecordTypeDir       CacheRecordType = 1
	CacheRecordTypeDirHeader CacheRecordType = 2
	CacheRecordTypeSymlink   CacheRecordType = 3
)

func (CacheRecordType) EnumDescriptor added in v0.21.0

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

func (CacheRecordType) String added in v0.21.0

func (x CacheRecordType) String() string

type CacheRecordWithPath added in v0.21.0

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 added in v0.21.0

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

func (*CacheRecordWithPath) GetPath added in v0.21.0

func (m *CacheRecordWithPath) GetPath() string

func (*CacheRecordWithPath) GetRecord added in v0.21.0

func (m *CacheRecordWithPath) GetRecord() *CacheRecord

func (*CacheRecordWithPath) Marshal added in v0.21.0

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

func (*CacheRecordWithPath) MarshalTo added in v0.21.0

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

func (*CacheRecordWithPath) MarshalToSizedBuffer added in v0.21.0

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

func (*CacheRecordWithPath) ProtoMessage added in v0.21.0

func (*CacheRecordWithPath) ProtoMessage()

func (*CacheRecordWithPath) Reset added in v0.21.0

func (m *CacheRecordWithPath) Reset()

func (*CacheRecordWithPath) Size added in v0.21.0

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

func (*CacheRecordWithPath) String added in v0.21.0

func (m *CacheRecordWithPath) String() string

func (*CacheRecordWithPath) Unmarshal added in v0.21.0

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

func (*CacheRecordWithPath) XXX_DiscardUnknown added in v0.21.0

func (m *CacheRecordWithPath) XXX_DiscardUnknown()

func (*CacheRecordWithPath) XXX_Marshal added in v0.21.0

func (m *CacheRecordWithPath) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CacheRecordWithPath) XXX_Merge added in v0.21.0

func (m *CacheRecordWithPath) XXX_Merge(src proto.Message)

func (*CacheRecordWithPath) XXX_Size added in v0.21.0

func (m *CacheRecordWithPath) XXX_Size() int

func (*CacheRecordWithPath) XXX_Unmarshal added in v0.21.0

func (m *CacheRecordWithPath) XXX_Unmarshal(b []byte) error

type CacheRecords added in v0.21.0

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

func (*CacheRecords) Descriptor added in v0.21.0

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

func (*CacheRecords) GetPaths added in v0.21.0

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

func (*CacheRecords) Marshal added in v0.21.0

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

func (*CacheRecords) MarshalTo added in v0.21.0

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

func (*CacheRecords) MarshalToSizedBuffer added in v0.21.0

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

func (*CacheRecords) ProtoMessage added in v0.21.0

func (*CacheRecords) ProtoMessage()

func (*CacheRecords) Reset added in v0.21.0

func (m *CacheRecords) Reset()

func (*CacheRecords) Size added in v0.21.0

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

func (*CacheRecords) String added in v0.21.0

func (m *CacheRecords) String() string

func (*CacheRecords) Unmarshal added in v0.21.0

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

func (*CacheRecords) XXX_DiscardUnknown added in v0.21.0

func (m *CacheRecords) XXX_DiscardUnknown()

func (*CacheRecords) XXX_Marshal added in v0.21.0

func (m *CacheRecords) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CacheRecords) XXX_Merge added in v0.21.0

func (m *CacheRecords) XXX_Merge(src proto.Message)

func (*CacheRecords) XXX_Size added in v0.21.0

func (m *CacheRecords) XXX_Size() int

func (*CacheRecords) XXX_Unmarshal added in v0.21.0

func (m *CacheRecords) XXX_Unmarshal(b []byte) error

type CacheRefMetadata

type CacheRefMetadata struct {
	cache.RefMetadata
}

func SearchContentHash

func SearchContentHash(ctx context.Context, store cache.MetadataStore, dgst digest.Digest) ([]CacheRefMetadata, error)

func (CacheRefMetadata) GetContentHashKey

func (md CacheRefMetadata) GetContentHashKey() (digest.Digest, bool)

func (CacheRefMetadata) SetContentHashKey

func (md CacheRefMetadata) SetContentHashKey(dgst digest.Digest) error

type ChecksumOpts added in v0.21.0

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

type Hashed added in v0.21.0

type Hashed interface {
	Digest() digest.Digest
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL