pb_filesystem

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Status_name = map[int32]string{
		0: "SUCCESS",
		1: "FAILURE",
	}
	Status_value = map[string]int32{
		"SUCCESS": 0,
		"FAILURE": 1,
	}
)

Enum value maps for Status.

View Source
var FileSever_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "filesystem.FileSever",
	HandlerType: (*FileSeverServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListDir",
			Handler:    _FileSever_ListDir_Handler,
		},
		{
			MethodName: "MakeDir",
			Handler:    _FileSever_MakeDir_Handler,
		},
		{
			MethodName: "Remove",
			Handler:    _FileSever_Remove_Handler,
		},
		{
			MethodName: "CreateFile",
			Handler:    _FileSever_CreateFile_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ReadFile",
			Handler:       _FileSever_ReadFile_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "WriteFile",
			Handler:       _FileSever_WriteFile_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "filesystem.proto",
}

FileSever_ServiceDesc is the grpc.ServiceDesc for FileSever 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_filesystem_proto protoreflect.FileDescriptor

Functions

func RegisterFileSeverServer

func RegisterFileSeverServer(s grpc.ServiceRegistrar, srv FileSeverServer)

Types

type Dir

type Dir struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

func (*Dir) Descriptor deprecated

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

Deprecated: Use Dir.ProtoReflect.Descriptor instead.

func (*Dir) GetName

func (x *Dir) GetName() string

func (*Dir) GetPath

func (x *Dir) GetPath() string

func (*Dir) ProtoMessage

func (*Dir) ProtoMessage()

func (*Dir) ProtoReflect

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

func (*Dir) Reset

func (x *Dir) Reset()

func (*Dir) String

func (x *Dir) String() string

type File

type File struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	Size int64  `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
	// contains filtered or unexported fields
}

func (*File) Descriptor deprecated

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

Deprecated: Use File.ProtoReflect.Descriptor instead.

func (*File) GetName

func (x *File) GetName() string

func (*File) GetPath

func (x *File) GetPath() string

func (*File) GetSize

func (x *File) GetSize() int64

func (*File) ProtoMessage

func (*File) ProtoMessage()

func (*File) ProtoReflect

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

func (*File) Reset

func (x *File) Reset()

func (*File) String

func (x *File) String() string

type FilePayload

type FilePayload struct {

	// Types that are assignable to Input:
	//	*FilePayload_Path
	//	*FilePayload_Data
	Input isFilePayload_Input `protobuf_oneof:"input"`
	// contains filtered or unexported fields
}

func (*FilePayload) Descriptor deprecated

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

Deprecated: Use FilePayload.ProtoReflect.Descriptor instead.

func (*FilePayload) GetData

func (x *FilePayload) GetData() []byte

func (*FilePayload) GetInput

func (m *FilePayload) GetInput() isFilePayload_Input

func (*FilePayload) GetPath

func (x *FilePayload) GetPath() string

func (*FilePayload) ProtoMessage

func (*FilePayload) ProtoMessage()

func (*FilePayload) ProtoReflect

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

func (*FilePayload) Reset

func (x *FilePayload) Reset()

func (*FilePayload) String

func (x *FilePayload) String() string

type FilePayload_Data

type FilePayload_Data struct {
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3,oneof"`
}

type FilePayload_Path

type FilePayload_Path struct {
	Path string `protobuf:"bytes,1,opt,name=path,proto3,oneof"`
}

type FileSeverClient

type FileSeverClient interface {
	// Returns the list of files/dirs at path.
	ListDir(ctx context.Context, in *Path, opts ...grpc.CallOption) (*ListResponse, error)
	// Creates a directory at path.
	MakeDir(ctx context.Context, in *Path, opts ...grpc.CallOption) (*StatusResponse, error)
	// Removes a file/dir at path.
	Remove(ctx context.Context, in *Path, opts ...grpc.CallOption) (*StatusResponse, error)
	// Create a file at path.
	CreateFile(ctx context.Context, in *Path, opts ...grpc.CallOption) (*StatusResponse, error)
	// Returns file content as a stream of bytes.
	ReadFile(ctx context.Context, in *Path, opts ...grpc.CallOption) (FileSever_ReadFileClient, error)
	// A client-to-server streaming RPC.
	//
	WriteFile(ctx context.Context, opts ...grpc.CallOption) (FileSever_WriteFileClient, error)
}

FileSeverClient is the client API for FileSever 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.

func NewFileSeverClient

func NewFileSeverClient(cc grpc.ClientConnInterface) FileSeverClient

type FileSeverServer

type FileSeverServer interface {
	// Returns the list of files/dirs at path.
	ListDir(context.Context, *Path) (*ListResponse, error)
	// Creates a directory at path.
	MakeDir(context.Context, *Path) (*StatusResponse, error)
	// Removes a file/dir at path.
	Remove(context.Context, *Path) (*StatusResponse, error)
	// Create a file at path.
	CreateFile(context.Context, *Path) (*StatusResponse, error)
	// Returns file content as a stream of bytes.
	ReadFile(*Path, FileSever_ReadFileServer) error
	// A client-to-server streaming RPC.
	//
	WriteFile(FileSever_WriteFileServer) error
	// contains filtered or unexported methods
}

FileSeverServer is the server API for FileSever service. All implementations must embed UnimplementedFileSeverServer for forward compatibility

type FileSever_ReadFileClient

type FileSever_ReadFileClient interface {
	Recv() (*Payload, error)
	grpc.ClientStream
}

type FileSever_ReadFileServer

type FileSever_ReadFileServer interface {
	Send(*Payload) error
	grpc.ServerStream
}

type FileSever_WriteFileClient

type FileSever_WriteFileClient interface {
	Send(*FilePayload) error
	CloseAndRecv() (*StatusResponse, error)
	grpc.ClientStream
}

type FileSever_WriteFileServer

type FileSever_WriteFileServer interface {
	SendAndClose(*StatusResponse) error
	Recv() (*FilePayload, error)
	grpc.ServerStream
}

type ListResponse

type ListResponse struct {
	Files []*File `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"`
	Dirs  []*Dir  `protobuf:"bytes,2,rep,name=dirs,proto3" json:"dirs,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated

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

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetDirs

func (x *ListResponse) GetDirs() []*Dir

func (*ListResponse) GetFiles

func (x *ListResponse) GetFiles() []*File

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

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

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type Path

type Path struct {
	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

func (*Path) Descriptor deprecated

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

Deprecated: Use Path.ProtoReflect.Descriptor instead.

func (*Path) GetPath

func (x *Path) GetPath() string

func (*Path) ProtoMessage

func (*Path) ProtoMessage()

func (*Path) ProtoReflect

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

func (*Path) Reset

func (x *Path) Reset()

func (*Path) String

func (x *Path) String() string

type Payload

type Payload struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Payload) Descriptor deprecated

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

Deprecated: Use Payload.ProtoReflect.Descriptor instead.

func (*Payload) GetData

func (x *Payload) GetData() []byte

func (*Payload) ProtoMessage

func (*Payload) ProtoMessage()

func (*Payload) ProtoReflect

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

func (*Payload) Reset

func (x *Payload) Reset()

func (*Payload) String

func (x *Payload) String() string

type Status

type Status int32
const (
	Status_SUCCESS Status = 0
	Status_FAILURE Status = 1
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

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

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

type StatusResponse

type StatusResponse struct {
	Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=filesystem.Status" json:"status,omitempty"`
	Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
	// contains filtered or unexported fields
}

func (*StatusResponse) Descriptor deprecated

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

Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.

func (*StatusResponse) GetReason

func (x *StatusResponse) GetReason() string

func (*StatusResponse) GetStatus

func (x *StatusResponse) GetStatus() Status

func (*StatusResponse) ProtoMessage

func (*StatusResponse) ProtoMessage()

func (*StatusResponse) ProtoReflect

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

func (*StatusResponse) Reset

func (x *StatusResponse) Reset()

func (*StatusResponse) String

func (x *StatusResponse) String() string

type UnimplementedFileSeverServer

type UnimplementedFileSeverServer struct {
}

UnimplementedFileSeverServer must be embedded to have forward compatible implementations.

func (UnimplementedFileSeverServer) CreateFile

func (UnimplementedFileSeverServer) ListDir

func (UnimplementedFileSeverServer) MakeDir

func (UnimplementedFileSeverServer) ReadFile

func (UnimplementedFileSeverServer) Remove

func (UnimplementedFileSeverServer) WriteFile

type UnsafeFileSeverServer

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

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

Jump to

Keyboard shortcuts

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