// SPDX-FileCopyrightText: edef <edef@unfathomable.blue>
// SPDX-License-Identifier: OSL-3.0 OR MIT OR Apache-2.0
// Copyright © 2025 The Snix Project

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        (unknown)
// source: snix/castore/protos/castore.proto

package castorev1

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// A Directory can contain Directory, File or Symlink entries.
// Each of these nodes have a name attribute, which is the basename in that
// directory and node type specific attributes.
// The name attribute:
//   - MUST not contain slashes or null bytes
//   - MUST not be '.' or '..'
//   - MUST be unique across all three lists
//
// Elements in each list need to be lexicographically ordered by the name
// attribute.
type Directory struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Directories   []*DirectoryEntry      `protobuf:"bytes,1,rep,name=directories,proto3" json:"directories,omitempty"`
	Files         []*FileEntry           `protobuf:"bytes,2,rep,name=files,proto3" json:"files,omitempty"`
	Symlinks      []*SymlinkEntry        `protobuf:"bytes,3,rep,name=symlinks,proto3" json:"symlinks,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *Directory) Reset() {
	*x = Directory{}
	mi := &file_snix_castore_protos_castore_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *Directory) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Directory) ProtoMessage() {}

func (x *Directory) ProtoReflect() protoreflect.Message {
	mi := &file_snix_castore_protos_castore_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use Directory.ProtoReflect.Descriptor instead.
func (*Directory) Descriptor() ([]byte, []int) {
	return file_snix_castore_protos_castore_proto_rawDescGZIP(), []int{0}
}

func (x *Directory) GetDirectories() []*DirectoryEntry {
	if x != nil {
		return x.Directories
	}
	return nil
}

func (x *Directory) GetFiles() []*FileEntry {
	if x != nil {
		return x.Files
	}
	return nil
}

func (x *Directory) GetSymlinks() []*SymlinkEntry {
	if x != nil {
		return x.Symlinks
	}
	return nil
}

// A DirectoryEntry represents a directory.
type DirectoryEntry struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The (base)name of the directory
	Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The blake3 digest of a Directory message.
	Digest []byte `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"`
	// Number of child elements in the Directory referred to by `digest`.
	// Calculated by summing up the numbers of `directories`, `files` and
	// `symlinks`, and for each directory, its size field. Used for inode number
	// calculation.
	// This field is precisely as verifiable as any other Merkle tree edge.
	// Resolve `digest`, and you can compute it incrementally. Resolve the entire
	// tree, and you can fully compute it from scratch.
	// A credulous implementation won't reject an excessive size, but this is
	// harmless: you'll have some ordinals without nodes. Undersizing is obvious
	// and easy to reject: you won't have an ordinal for some nodes.
	Size          uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *DirectoryEntry) Reset() {
	*x = DirectoryEntry{}
	mi := &file_snix_castore_protos_castore_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *DirectoryEntry) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*DirectoryEntry) ProtoMessage() {}

func (x *DirectoryEntry) ProtoReflect() protoreflect.Message {
	mi := &file_snix_castore_protos_castore_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use DirectoryEntry.ProtoReflect.Descriptor instead.
func (*DirectoryEntry) Descriptor() ([]byte, []int) {
	return file_snix_castore_protos_castore_proto_rawDescGZIP(), []int{1}
}

func (x *DirectoryEntry) GetName() []byte {
	if x != nil {
		return x.Name
	}
	return nil
}

func (x *DirectoryEntry) GetDigest() []byte {
	if x != nil {
		return x.Digest
	}
	return nil
}

func (x *DirectoryEntry) GetSize() uint64 {
	if x != nil {
		return x.Size
	}
	return 0
}

// A FileEntry represents a regular or executable file.
type FileEntry struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The (base)name of the file
	Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The blake3 digest of the file contents
	Digest []byte `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"`
	// The file content size
	Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
	// Whether the file is executable
	Executable    bool `protobuf:"varint,4,opt,name=executable,proto3" json:"executable,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *FileEntry) Reset() {
	*x = FileEntry{}
	mi := &file_snix_castore_protos_castore_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *FileEntry) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*FileEntry) ProtoMessage() {}

func (x *FileEntry) ProtoReflect() protoreflect.Message {
	mi := &file_snix_castore_protos_castore_proto_msgTypes[2]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use FileEntry.ProtoReflect.Descriptor instead.
func (*FileEntry) Descriptor() ([]byte, []int) {
	return file_snix_castore_protos_castore_proto_rawDescGZIP(), []int{2}
}

func (x *FileEntry) GetName() []byte {
	if x != nil {
		return x.Name
	}
	return nil
}

func (x *FileEntry) GetDigest() []byte {
	if x != nil {
		return x.Digest
	}
	return nil
}

func (x *FileEntry) GetSize() uint64 {
	if x != nil {
		return x.Size
	}
	return 0
}

func (x *FileEntry) GetExecutable() bool {
	if x != nil {
		return x.Executable
	}
	return false
}

// A SymlinkEntry represents a symbolic link.
type SymlinkEntry struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The (base)name of the symlink
	Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The target of the symlink.
	Target        []byte `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *SymlinkEntry) Reset() {
	*x = SymlinkEntry{}
	mi := &file_snix_castore_protos_castore_proto_msgTypes[3]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *SymlinkEntry) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*SymlinkEntry) ProtoMessage() {}

func (x *SymlinkEntry) ProtoReflect() protoreflect.Message {
	mi := &file_snix_castore_protos_castore_proto_msgTypes[3]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use SymlinkEntry.ProtoReflect.Descriptor instead.
func (*SymlinkEntry) Descriptor() ([]byte, []int) {
	return file_snix_castore_protos_castore_proto_rawDescGZIP(), []int{3}
}

func (x *SymlinkEntry) GetName() []byte {
	if x != nil {
		return x.Name
	}
	return nil
}

func (x *SymlinkEntry) GetTarget() []byte {
	if x != nil {
		return x.Target
	}
	return nil
}

// A Entry is either a DirectoryEntry, FileEntry or SymlinkEntry.
type Entry struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Types that are valid to be assigned to Entry:
	//
	//	*Entry_Directory
	//	*Entry_File
	//	*Entry_Symlink
	Entry         isEntry_Entry `protobuf_oneof:"entry"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *Entry) Reset() {
	*x = Entry{}
	mi := &file_snix_castore_protos_castore_proto_msgTypes[4]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *Entry) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Entry) ProtoMessage() {}

func (x *Entry) ProtoReflect() protoreflect.Message {
	mi := &file_snix_castore_protos_castore_proto_msgTypes[4]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use Entry.ProtoReflect.Descriptor instead.
func (*Entry) Descriptor() ([]byte, []int) {
	return file_snix_castore_protos_castore_proto_rawDescGZIP(), []int{4}
}

func (x *Entry) GetEntry() isEntry_Entry {
	if x != nil {
		return x.Entry
	}
	return nil
}

func (x *Entry) GetDirectory() *DirectoryEntry {
	if x != nil {
		if x, ok := x.Entry.(*Entry_Directory); ok {
			return x.Directory
		}
	}
	return nil
}

func (x *Entry) GetFile() *FileEntry {
	if x != nil {
		if x, ok := x.Entry.(*Entry_File); ok {
			return x.File
		}
	}
	return nil
}

func (x *Entry) GetSymlink() *SymlinkEntry {
	if x != nil {
		if x, ok := x.Entry.(*Entry_Symlink); ok {
			return x.Symlink
		}
	}
	return nil
}

type isEntry_Entry interface {
	isEntry_Entry()
}

type Entry_Directory struct {
	Directory *DirectoryEntry `protobuf:"bytes,1,opt,name=directory,proto3,oneof"`
}

type Entry_File struct {
	File *FileEntry `protobuf:"bytes,2,opt,name=file,proto3,oneof"`
}

type Entry_Symlink struct {
	Symlink *SymlinkEntry `protobuf:"bytes,3,opt,name=symlink,proto3,oneof"`
}

func (*Entry_Directory) isEntry_Entry() {}

func (*Entry_File) isEntry_Entry() {}

func (*Entry_Symlink) isEntry_Entry() {}

var File_snix_castore_protos_castore_proto protoreflect.FileDescriptor

const file_snix_castore_protos_castore_proto_rawDesc = "" +
	"\n" +
	"!snix/castore/protos/castore.proto\x12\x0fsnix.castore.v1\"\xbb\x01\n" +
	"\tDirectory\x12A\n" +
	"\vdirectories\x18\x01 \x03(\v2\x1f.snix.castore.v1.DirectoryEntryR\vdirectories\x120\n" +
	"\x05files\x18\x02 \x03(\v2\x1a.snix.castore.v1.FileEntryR\x05files\x129\n" +
	"\bsymlinks\x18\x03 \x03(\v2\x1d.snix.castore.v1.SymlinkEntryR\bsymlinks\"P\n" +
	"\x0eDirectoryEntry\x12\x12\n" +
	"\x04name\x18\x01 \x01(\fR\x04name\x12\x16\n" +
	"\x06digest\x18\x02 \x01(\fR\x06digest\x12\x12\n" +
	"\x04size\x18\x03 \x01(\x04R\x04size\"k\n" +
	"\tFileEntry\x12\x12\n" +
	"\x04name\x18\x01 \x01(\fR\x04name\x12\x16\n" +
	"\x06digest\x18\x02 \x01(\fR\x06digest\x12\x12\n" +
	"\x04size\x18\x03 \x01(\x04R\x04size\x12\x1e\n" +
	"\n" +
	"executable\x18\x04 \x01(\bR\n" +
	"executable\":\n" +
	"\fSymlinkEntry\x12\x12\n" +
	"\x04name\x18\x01 \x01(\fR\x04name\x12\x16\n" +
	"\x06target\x18\x02 \x01(\fR\x06target\"\xbe\x01\n" +
	"\x05Entry\x12?\n" +
	"\tdirectory\x18\x01 \x01(\v2\x1f.snix.castore.v1.DirectoryEntryH\x00R\tdirectory\x120\n" +
	"\x04file\x18\x02 \x01(\v2\x1a.snix.castore.v1.FileEntryH\x00R\x04file\x129\n" +
	"\asymlink\x18\x03 \x01(\v2\x1d.snix.castore.v1.SymlinkEntryH\x00R\asymlinkB\a\n" +
	"\x05entryB\"Z snix.dev/castore/proto;castorev1b\x06proto3"

var (
	file_snix_castore_protos_castore_proto_rawDescOnce sync.Once
	file_snix_castore_protos_castore_proto_rawDescData []byte
)

func file_snix_castore_protos_castore_proto_rawDescGZIP() []byte {
	file_snix_castore_protos_castore_proto_rawDescOnce.Do(func() {
		file_snix_castore_protos_castore_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_snix_castore_protos_castore_proto_rawDesc), len(file_snix_castore_protos_castore_proto_rawDesc)))
	})
	return file_snix_castore_protos_castore_proto_rawDescData
}

var file_snix_castore_protos_castore_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_snix_castore_protos_castore_proto_goTypes = []any{
	(*Directory)(nil),      // 0: snix.castore.v1.Directory
	(*DirectoryEntry)(nil), // 1: snix.castore.v1.DirectoryEntry
	(*FileEntry)(nil),      // 2: snix.castore.v1.FileEntry
	(*SymlinkEntry)(nil),   // 3: snix.castore.v1.SymlinkEntry
	(*Entry)(nil),          // 4: snix.castore.v1.Entry
}
var file_snix_castore_protos_castore_proto_depIdxs = []int32{
	1, // 0: snix.castore.v1.Directory.directories:type_name -> snix.castore.v1.DirectoryEntry
	2, // 1: snix.castore.v1.Directory.files:type_name -> snix.castore.v1.FileEntry
	3, // 2: snix.castore.v1.Directory.symlinks:type_name -> snix.castore.v1.SymlinkEntry
	1, // 3: snix.castore.v1.Entry.directory:type_name -> snix.castore.v1.DirectoryEntry
	2, // 4: snix.castore.v1.Entry.file:type_name -> snix.castore.v1.FileEntry
	3, // 5: snix.castore.v1.Entry.symlink:type_name -> snix.castore.v1.SymlinkEntry
	6, // [6:6] is the sub-list for method output_type
	6, // [6:6] is the sub-list for method input_type
	6, // [6:6] is the sub-list for extension type_name
	6, // [6:6] is the sub-list for extension extendee
	0, // [0:6] is the sub-list for field type_name
}

func init() { file_snix_castore_protos_castore_proto_init() }
func file_snix_castore_protos_castore_proto_init() {
	if File_snix_castore_protos_castore_proto != nil {
		return
	}
	file_snix_castore_protos_castore_proto_msgTypes[4].OneofWrappers = []any{
		(*Entry_Directory)(nil),
		(*Entry_File)(nil),
		(*Entry_Symlink)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_snix_castore_protos_castore_proto_rawDesc), len(file_snix_castore_protos_castore_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   5,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_snix_castore_protos_castore_proto_goTypes,
		DependencyIndexes: file_snix_castore_protos_castore_proto_depIdxs,
		MessageInfos:      file_snix_castore_protos_castore_proto_msgTypes,
	}.Build()
	File_snix_castore_protos_castore_proto = out.File
	file_snix_castore_protos_castore_proto_goTypes = nil
	file_snix_castore_protos_castore_proto_depIdxs = nil
}
