syntax = "proto3";

package contenthash;

import "github.com/gogo/protobuf/gogoproto/gogo.proto";

enum CacheRecordType {
	option (gogoproto.goproto_enum_prefix) = false;
	option (gogoproto.enum_customname) = "CacheRecordType";

	FILE = 0 [(gogoproto.enumvalue_customname) = "CacheRecordTypeFile"];
	DIR = 1 [(gogoproto.enumvalue_customname) = "CacheRecordTypeDir"];
	DIR_HEADER = 2 [(gogoproto.enumvalue_customname) = "CacheRecordTypeDirHeader"];
	SYMLINK = 3 [(gogoproto.enumvalue_customname) = "CacheRecordTypeSymlink"];
}

message CacheRecord {
	string digest = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
	CacheRecordType type = 2;
	string linkname = 3;
}

message CacheRecordWithPath {
	string path = 1;
	CacheRecord record = 2;
}

message CacheRecords {
	repeated CacheRecordWithPath paths = 1;
}