// SPDX-License-Identifier: MIT
// Copyright © 2022 The Tvix Authors
// 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/rpc_blobstore.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)
)

type StatBlobRequest struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The blake3 digest of the blob requested
	Digest []byte `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"`
	// Whether the server should reply with a list of more granular chunks.
	SendChunks bool `protobuf:"varint,2,opt,name=send_chunks,json=sendChunks,proto3" json:"send_chunks,omitempty"`
	// Whether the server should reply with a bao.
	SendBao       bool `protobuf:"varint,3,opt,name=send_bao,json=sendBao,proto3" json:"send_bao,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*StatBlobRequest) ProtoMessage() {}

func (x *StatBlobRequest) ProtoReflect() protoreflect.Message {
	mi := &file_snix_castore_protos_rpc_blobstore_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 StatBlobRequest.ProtoReflect.Descriptor instead.
func (*StatBlobRequest) Descriptor() ([]byte, []int) {
	return file_snix_castore_protos_rpc_blobstore_proto_rawDescGZIP(), []int{0}
}

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

func (x *StatBlobRequest) GetSendChunks() bool {
	if x != nil {
		return x.SendChunks
	}
	return false
}

func (x *StatBlobRequest) GetSendBao() bool {
	if x != nil {
		return x.SendBao
	}
	return false
}

type StatBlobResponse struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// If `send_chunks` was set to true, this MAY contain a list of more
	// granular chunks, which then may be read individually via the `Read`
	// method.
	Chunks []*StatBlobResponse_ChunkMeta `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks,omitempty"`
	// If `send_bao` was set to true, this MAY contain a outboard bao.
	// The exact format and message types here will still be fleshed out.
	Bao           []byte `protobuf:"bytes,3,opt,name=bao,proto3" json:"bao,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*StatBlobResponse) ProtoMessage() {}

func (x *StatBlobResponse) ProtoReflect() protoreflect.Message {
	mi := &file_snix_castore_protos_rpc_blobstore_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 StatBlobResponse.ProtoReflect.Descriptor instead.
func (*StatBlobResponse) Descriptor() ([]byte, []int) {
	return file_snix_castore_protos_rpc_blobstore_proto_rawDescGZIP(), []int{1}
}

func (x *StatBlobResponse) GetChunks() []*StatBlobResponse_ChunkMeta {
	if x != nil {
		return x.Chunks
	}
	return nil
}

func (x *StatBlobResponse) GetBao() []byte {
	if x != nil {
		return x.Bao
	}
	return nil
}

type ReadBlobRequest struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The blake3 digest of the blob or chunk requested
	Digest        []byte `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*ReadBlobRequest) ProtoMessage() {}

func (x *ReadBlobRequest) ProtoReflect() protoreflect.Message {
	mi := &file_snix_castore_protos_rpc_blobstore_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 ReadBlobRequest.ProtoReflect.Descriptor instead.
func (*ReadBlobRequest) Descriptor() ([]byte, []int) {
	return file_snix_castore_protos_rpc_blobstore_proto_rawDescGZIP(), []int{2}
}

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

// This represents some bytes of a blob.
// Blobs are sent in smaller chunks to keep message sizes manageable.
type BlobChunk struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Data          []byte                 `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*BlobChunk) ProtoMessage() {}

func (x *BlobChunk) ProtoReflect() protoreflect.Message {
	mi := &file_snix_castore_protos_rpc_blobstore_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 BlobChunk.ProtoReflect.Descriptor instead.
func (*BlobChunk) Descriptor() ([]byte, []int) {
	return file_snix_castore_protos_rpc_blobstore_proto_rawDescGZIP(), []int{3}
}

func (x *BlobChunk) GetData() []byte {
	if x != nil {
		return x.Data
	}
	return nil
}

type PutBlobResponse struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The blake3 digest of the data that was sent.
	Digest        []byte `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*PutBlobResponse) ProtoMessage() {}

func (x *PutBlobResponse) ProtoReflect() protoreflect.Message {
	mi := &file_snix_castore_protos_rpc_blobstore_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 PutBlobResponse.ProtoReflect.Descriptor instead.
func (*PutBlobResponse) Descriptor() ([]byte, []int) {
	return file_snix_castore_protos_rpc_blobstore_proto_rawDescGZIP(), []int{4}
}

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

type StatBlobResponse_ChunkMeta struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Digest of that specific chunk
	Digest []byte `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"`
	// Length of that chunk, in bytes.
	Size          uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *StatBlobResponse_ChunkMeta) Reset() {
	*x = StatBlobResponse_ChunkMeta{}
	mi := &file_snix_castore_protos_rpc_blobstore_proto_msgTypes[5]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*StatBlobResponse_ChunkMeta) ProtoMessage() {}

func (x *StatBlobResponse_ChunkMeta) ProtoReflect() protoreflect.Message {
	mi := &file_snix_castore_protos_rpc_blobstore_proto_msgTypes[5]
	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 StatBlobResponse_ChunkMeta.ProtoReflect.Descriptor instead.
func (*StatBlobResponse_ChunkMeta) Descriptor() ([]byte, []int) {
	return file_snix_castore_protos_rpc_blobstore_proto_rawDescGZIP(), []int{1, 0}
}

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

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

var File_snix_castore_protos_rpc_blobstore_proto protoreflect.FileDescriptor

const file_snix_castore_protos_rpc_blobstore_proto_rawDesc = "" +
	"\n" +
	"'snix/castore/protos/rpc_blobstore.proto\x12\x0fsnix.castore.v1\"e\n" +
	"\x0fStatBlobRequest\x12\x16\n" +
	"\x06digest\x18\x01 \x01(\fR\x06digest\x12\x1f\n" +
	"\vsend_chunks\x18\x02 \x01(\bR\n" +
	"sendChunks\x12\x19\n" +
	"\bsend_bao\x18\x03 \x01(\bR\asendBao\"\xa2\x01\n" +
	"\x10StatBlobResponse\x12C\n" +
	"\x06chunks\x18\x02 \x03(\v2+.snix.castore.v1.StatBlobResponse.ChunkMetaR\x06chunks\x12\x10\n" +
	"\x03bao\x18\x03 \x01(\fR\x03bao\x1a7\n" +
	"\tChunkMeta\x12\x16\n" +
	"\x06digest\x18\x01 \x01(\fR\x06digest\x12\x12\n" +
	"\x04size\x18\x02 \x01(\x04R\x04size\")\n" +
	"\x0fReadBlobRequest\x12\x16\n" +
	"\x06digest\x18\x01 \x01(\fR\x06digest\"\x1f\n" +
	"\tBlobChunk\x12\x12\n" +
	"\x04data\x18\x01 \x01(\fR\x04data\")\n" +
	"\x0fPutBlobResponse\x12\x16\n" +
	"\x06digest\x18\x01 \x01(\fR\x06digest2\xe9\x01\n" +
	"\vBlobService\x12K\n" +
	"\x04Stat\x12 .snix.castore.v1.StatBlobRequest\x1a!.snix.castore.v1.StatBlobResponse\x12F\n" +
	"\x04Read\x12 .snix.castore.v1.ReadBlobRequest\x1a\x1a.snix.castore.v1.BlobChunk0\x01\x12E\n" +
	"\x03Put\x12\x1a.snix.castore.v1.BlobChunk\x1a .snix.castore.v1.PutBlobResponse(\x01B\"Z snix.dev/castore/proto;castorev1b\x06proto3"

var (
	file_snix_castore_protos_rpc_blobstore_proto_rawDescOnce sync.Once
	file_snix_castore_protos_rpc_blobstore_proto_rawDescData []byte
)

func file_snix_castore_protos_rpc_blobstore_proto_rawDescGZIP() []byte {
	file_snix_castore_protos_rpc_blobstore_proto_rawDescOnce.Do(func() {
		file_snix_castore_protos_rpc_blobstore_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_snix_castore_protos_rpc_blobstore_proto_rawDesc), len(file_snix_castore_protos_rpc_blobstore_proto_rawDesc)))
	})
	return file_snix_castore_protos_rpc_blobstore_proto_rawDescData
}

var file_snix_castore_protos_rpc_blobstore_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_snix_castore_protos_rpc_blobstore_proto_goTypes = []any{
	(*StatBlobRequest)(nil),            // 0: snix.castore.v1.StatBlobRequest
	(*StatBlobResponse)(nil),           // 1: snix.castore.v1.StatBlobResponse
	(*ReadBlobRequest)(nil),            // 2: snix.castore.v1.ReadBlobRequest
	(*BlobChunk)(nil),                  // 3: snix.castore.v1.BlobChunk
	(*PutBlobResponse)(nil),            // 4: snix.castore.v1.PutBlobResponse
	(*StatBlobResponse_ChunkMeta)(nil), // 5: snix.castore.v1.StatBlobResponse.ChunkMeta
}
var file_snix_castore_protos_rpc_blobstore_proto_depIdxs = []int32{
	5, // 0: snix.castore.v1.StatBlobResponse.chunks:type_name -> snix.castore.v1.StatBlobResponse.ChunkMeta
	0, // 1: snix.castore.v1.BlobService.Stat:input_type -> snix.castore.v1.StatBlobRequest
	2, // 2: snix.castore.v1.BlobService.Read:input_type -> snix.castore.v1.ReadBlobRequest
	3, // 3: snix.castore.v1.BlobService.Put:input_type -> snix.castore.v1.BlobChunk
	1, // 4: snix.castore.v1.BlobService.Stat:output_type -> snix.castore.v1.StatBlobResponse
	3, // 5: snix.castore.v1.BlobService.Read:output_type -> snix.castore.v1.BlobChunk
	4, // 6: snix.castore.v1.BlobService.Put:output_type -> snix.castore.v1.PutBlobResponse
	4, // [4:7] is the sub-list for method output_type
	1, // [1:4] is the sub-list for method input_type
	1, // [1:1] is the sub-list for extension type_name
	1, // [1:1] is the sub-list for extension extendee
	0, // [0:1] is the sub-list for field type_name
}

func init() { file_snix_castore_protos_rpc_blobstore_proto_init() }
func file_snix_castore_protos_rpc_blobstore_proto_init() {
	if File_snix_castore_protos_rpc_blobstore_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_snix_castore_protos_rpc_blobstore_proto_rawDesc), len(file_snix_castore_protos_rpc_blobstore_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   6,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_snix_castore_protos_rpc_blobstore_proto_goTypes,
		DependencyIndexes: file_snix_castore_protos_rpc_blobstore_proto_depIdxs,
		MessageInfos:      file_snix_castore_protos_rpc_blobstore_proto_msgTypes,
	}.Build()
	File_snix_castore_protos_rpc_blobstore_proto = out.File
	file_snix_castore_protos_rpc_blobstore_proto_goTypes = nil
	file_snix_castore_protos_rpc_blobstore_proto_depIdxs = nil
}
