pb

package
v0.0.0-...-51d8bf1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Method_name = map[int32]string{
		0: "CREATE",
		1: "DELELT",
		3: "READ",
		4: "WRITE",
	}
	Method_value = map[string]int32{
		"CREATE": 0,
		"DELELT": 1,
		"READ":   3,
		"WRITE":  4,
	}
)

Enum value maps for Method.

View Source
var FileService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "FileService",
	HandlerType: (*FileServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetChuncks",
			Handler:       _FileService_GetChuncks_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "files.proto",
}

FileService_ServiceDesc is the grpc.ServiceDesc for FileService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_file_handler_proto protoreflect.FileDescriptor
View Source
var File_files_proto protoreflect.FileDescriptor
View Source
var File_health_check_proto protoreflect.FileDescriptor
View Source
var HealthCheckService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "HealthCheckService",
	HandlerType: (*HealthCheckServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CheckHealthStatus",
			Handler:    _HealthCheckService_CheckHealthStatus_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "health_check.proto",
}

HealthCheckService_ServiceDesc is the grpc.ServiceDesc for HealthCheckService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func Connect

func Connect(address string, port int) (*grpc.ClientConn, error)

func InsecureConnect

func InsecureConnect(address string, port int) (*grpc.ClientConn, error)

func RegisterFileServiceServer

func RegisterFileServiceServer(s grpc.ServiceRegistrar, srv FileServiceServer)

func RegisterHealthCheckServiceServer

func RegisterHealthCheckServiceServer(s grpc.ServiceRegistrar, srv HealthCheckServiceServer)

Types

type ChunckHandler

type ChunckHandler struct {
	ChunkServiceAddress string `protobuf:"bytes,1,opt,name=chunkServiceAddress,proto3" json:"chunkServiceAddress,omitempty"`
	Method              Method `protobuf:"varint,2,opt,name=method,proto3,enum=Method" json:"method,omitempty"`
	Permitted           bool   `protobuf:"varint,3,opt,name=permitted,proto3" json:"permitted,omitempty"`
	// contains filtered or unexported fields
}

func (*ChunckHandler) Descriptor deprecated

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

Deprecated: Use ChunckHandler.ProtoReflect.Descriptor instead.

func (*ChunckHandler) GetChunkServiceAddress

func (x *ChunckHandler) GetChunkServiceAddress() string

func (*ChunckHandler) GetMethod

func (x *ChunckHandler) GetMethod() Method

func (*ChunckHandler) GetPermitted

func (x *ChunckHandler) GetPermitted() bool

func (*ChunckHandler) ProtoMessage

func (*ChunckHandler) ProtoMessage()

func (*ChunckHandler) ProtoReflect

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

func (*ChunckHandler) Reset

func (x *ChunckHandler) Reset()

func (*ChunckHandler) String

func (x *ChunckHandler) String() string

type FileRequest

type FileRequest struct {
	FileName string `protobuf:"bytes,1,opt,name=fileName,proto3" json:"fileName,omitempty"`
	Index    int32  `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` // chunck index
	// contains filtered or unexported fields
}

func (*FileRequest) Descriptor deprecated

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

Deprecated: Use FileRequest.ProtoReflect.Descriptor instead.

func (*FileRequest) GetFileName

func (x *FileRequest) GetFileName() string

func (*FileRequest) GetIndex

func (x *FileRequest) GetIndex() int32

func (*FileRequest) ProtoMessage

func (*FileRequest) ProtoMessage()

func (*FileRequest) ProtoReflect

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

func (*FileRequest) Reset

func (x *FileRequest) Reset()

func (*FileRequest) String

func (x *FileRequest) String() string

type FileResponse

type FileResponse struct {
	Filename string         `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"`
	Handler  *ChunckHandler `protobuf:"bytes,2,opt,name=handler,proto3" json:"handler,omitempty"`
	// contains filtered or unexported fields
}

func (*FileResponse) Descriptor deprecated

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

Deprecated: Use FileResponse.ProtoReflect.Descriptor instead.

func (*FileResponse) GetFilename

func (x *FileResponse) GetFilename() string

func (*FileResponse) GetHandler

func (x *FileResponse) GetHandler() *ChunckHandler

func (*FileResponse) ProtoMessage

func (*FileResponse) ProtoMessage()

func (*FileResponse) ProtoReflect

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

func (*FileResponse) Reset

func (x *FileResponse) Reset()

func (*FileResponse) String

func (x *FileResponse) String() string

type FileServiceClient

type FileServiceClient interface {
	GetChuncks(ctx context.Context, opts ...grpc.CallOption) (FileService_GetChuncksClient, error)
}

FileServiceClient is the client API for FileService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type FileServiceServer

type FileServiceServer interface {
	GetChuncks(FileService_GetChuncksServer) error
	// contains filtered or unexported methods
}

FileServiceServer is the server API for FileService service. All implementations must embed UnimplementedFileServiceServer for forward compatibility

type FileService_GetChuncksClient

type FileService_GetChuncksClient interface {
	Send(*FileRequest) error
	CloseAndRecv() (*FileResponse, error)
	grpc.ClientStream
}

type FileService_GetChuncksServer

type FileService_GetChuncksServer interface {
	SendAndClose(*FileResponse) error
	Recv() (*FileRequest, error)
	grpc.ServerStream
}

type HealthCheckServiceClient

type HealthCheckServiceClient interface {
	CheckHealthStatus(ctx context.Context, in *Ping, opts ...grpc.CallOption) (*ServiceStatus, error)
}

HealthCheckServiceClient is the client API for HealthCheckService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type HealthCheckServiceServer

type HealthCheckServiceServer interface {
	CheckHealthStatus(context.Context, *Ping) (*ServiceStatus, error)
	// contains filtered or unexported methods
}

HealthCheckServiceServer is the server API for HealthCheckService service. All implementations must embed UnimplementedHealthCheckServiceServer for forward compatibility

type Method

type Method int32
const (
	Method_CREATE Method = 0
	Method_DELELT Method = 1
	Method_READ   Method = 3
	Method_WRITE  Method = 4
)

func (Method) Descriptor

func (Method) Descriptor() protoreflect.EnumDescriptor

func (Method) Enum

func (x Method) Enum() *Method

func (Method) EnumDescriptor deprecated

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

Deprecated: Use Method.Descriptor instead.

func (Method) Number

func (x Method) Number() protoreflect.EnumNumber

func (Method) String

func (x Method) String() string

func (Method) Type

func (Method) Type() protoreflect.EnumType

type Ping

type Ping struct {
	// contains filtered or unexported fields
}

func (*Ping) Descriptor deprecated

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

Deprecated: Use Ping.ProtoReflect.Descriptor instead.

func (*Ping) ProtoMessage

func (*Ping) ProtoMessage()

func (*Ping) ProtoReflect

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

func (*Ping) Reset

func (x *Ping) Reset()

func (*Ping) String

func (x *Ping) String() string

type ServiceStatus

type ServiceStatus struct {
	Id             int32  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Status         int32  `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
	DiskFree       uint64 `protobuf:"varint,3,opt,name=diskFree,proto3" json:"diskFree,omitempty"`
	RecentChunkNum int32  `protobuf:"varint,4,opt,name=recentChunkNum,proto3" json:"recentChunkNum,omitempty"`
	// contains filtered or unexported fields
}

func (*ServiceStatus) Descriptor deprecated

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

Deprecated: Use ServiceStatus.ProtoReflect.Descriptor instead.

func (*ServiceStatus) GetDiskFree

func (x *ServiceStatus) GetDiskFree() uint64

func (*ServiceStatus) GetId

func (x *ServiceStatus) GetId() int32

func (*ServiceStatus) GetRecentChunkNum

func (x *ServiceStatus) GetRecentChunkNum() int32

func (*ServiceStatus) GetStatus

func (x *ServiceStatus) GetStatus() int32

func (*ServiceStatus) ProtoMessage

func (*ServiceStatus) ProtoMessage()

func (*ServiceStatus) ProtoReflect

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

func (*ServiceStatus) Reset

func (x *ServiceStatus) Reset()

func (*ServiceStatus) String

func (x *ServiceStatus) String() string

type UnimplementedFileServiceServer

type UnimplementedFileServiceServer struct {
}

UnimplementedFileServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedFileServiceServer) GetChuncks

type UnimplementedHealthCheckServiceServer

type UnimplementedHealthCheckServiceServer struct {
}

UnimplementedHealthCheckServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedHealthCheckServiceServer) CheckHealthStatus

type UnsafeFileServiceServer

type UnsafeFileServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeFileServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to FileServiceServer will result in compilation errors.

type UnsafeHealthCheckServiceServer

type UnsafeHealthCheckServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeHealthCheckServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HealthCheckServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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