Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterMonitorServiceServer(s grpc.ServiceRegistrar, srv MonitorServiceServer)
- func RegisterServer(s grpc.ServiceRegistrar, monitors *sync.Map, reporter report.Reporter, ...)
- type FileInfo
- func (*FileInfo) Descriptor() ([]byte, []int)deprecated
- func (x *FileInfo) GetATime() int64
- func (x *FileInfo) GetCTime() int64
- func (x *FileInfo) GetHash() string
- func (x *FileInfo) GetHashValues() []*HashValue
- func (x *FileInfo) GetIsDir() int32
- func (x *FileInfo) GetLinkTo() string
- func (x *FileInfo) GetMTime() int64
- func (x *FileInfo) GetPath() string
- func (x *FileInfo) GetSize() int64
- func (*FileInfo) ProtoMessage()
- func (x *FileInfo) ProtoReflect() protoreflect.Message
- func (x *FileInfo) Reset()
- func (x *FileInfo) String() string
- type HashValue
- type MonitorMessage
- func (*MonitorMessage) Descriptor() ([]byte, []int)deprecated
- func (x *MonitorMessage) GetAction() int32
- func (x *MonitorMessage) GetBaseUrl() string
- func (x *MonitorMessage) GetFileInfo() *FileInfo
- func (*MonitorMessage) ProtoMessage()
- func (x *MonitorMessage) ProtoReflect() protoreflect.Message
- func (x *MonitorMessage) Reset()
- func (x *MonitorMessage) String() string
- type MonitorServiceClient
- type MonitorServiceServer
- type MonitorService_MonitorClient
- type MonitorService_MonitorServer
- type UnimplementedMonitorServiceServer
- type UnsafeMonitorServiceServer
Constants ¶
const (
MonitorService_Monitor_FullMethodName = "/monitor.MonitorService/Monitor"
)
Variables ¶
var File_api_proto_monitor_proto protoreflect.FileDescriptor
var MonitorService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "monitor.MonitorService", HandlerType: (*MonitorServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Monitor", Handler: _MonitorService_Monitor_Handler, ServerStreams: true, }, }, Metadata: "api/proto/monitor.proto", }
MonitorService_ServiceDesc is the grpc.ServiceDesc for MonitorService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMonitorServiceServer ¶
func RegisterMonitorServiceServer(s grpc.ServiceRegistrar, srv MonitorServiceServer)
func RegisterServer ¶
func RegisterServer(s grpc.ServiceRegistrar, monitors *sync.Map, reporter report.Reporter, token authapi.Token)
RegisterServer register the monitor server
Types ¶
type FileInfo ¶
type FileInfo struct {
// Path the file path
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
// IsDir is a dir the path
IsDir int32 `protobuf:"varint,2,opt,name=is_dir,json=isDir,proto3" json:"is_dir,omitempty"`
// Size the size of path for bytes
Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
// Hash calculate the path hash value, if the path is a file
Hash string `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"`
// HashValues the hash value of the entire file and first chunk and some checkpoints
HashValues []*HashValue `protobuf:"bytes,5,rep,name=hash_values,json=hashValues,proto3" json:"hash_values,omitempty"`
// CTime creation time, unix sec
CTime int64 `protobuf:"varint,6,opt,name=c_time,json=cTime,proto3" json:"c_time,omitempty"`
// ATime last access time, unix sec
ATime int64 `protobuf:"varint,7,opt,name=a_time,json=aTime,proto3" json:"a_time,omitempty"`
// MTime last modify time, unix sec
MTime int64 `protobuf:"varint,8,opt,name=m_time,json=mTime,proto3" json:"m_time,omitempty"`
// LinkTo link to the real file
LinkTo string `protobuf:"bytes,9,opt,name=link_to,json=linkTo,proto3" json:"link_to,omitempty"`
// contains filtered or unexported fields
}
FileInfo the basic file info description
func (*FileInfo) Descriptor
deprecated
func (*FileInfo) GetHashValues ¶
func (*FileInfo) ProtoMessage ¶
func (*FileInfo) ProtoMessage()
func (*FileInfo) ProtoReflect ¶
func (x *FileInfo) ProtoReflect() protoreflect.Message
type HashValue ¶
type HashValue struct {
// Offset the file data to calculate the hash value from zero to offset
Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"`
// Hash the file checkpoint hash value
Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
// contains filtered or unexported fields
}
HashValue the file hash info
func ToHashValueMessageList ¶
func ToHashValueMessageList(hvs hashutil.HashValues) []*HashValue
ToHashValueMessageList convert the hashutil.HashValues to a HashValue array
func (*HashValue) Descriptor
deprecated
func (*HashValue) ProtoMessage ¶
func (*HashValue) ProtoMessage()
func (*HashValue) ProtoReflect ¶
func (x *HashValue) ProtoReflect() protoreflect.Message
type MonitorMessage ¶
type MonitorMessage struct {
FileInfo *FileInfo `protobuf:"bytes,1,opt,name=file_info,json=fileInfo,proto3" json:"file_info,omitempty"`
// Action the action of file change
Action int32 `protobuf:"varint,2,opt,name=action,proto3" json:"action,omitempty"`
// BaseUrl the base url of file server
BaseUrl string `protobuf:"bytes,3,opt,name=base_url,json=baseUrl,proto3" json:"base_url,omitempty"`
// contains filtered or unexported fields
}
FileServerInfo the file server basic info
func (*MonitorMessage) Descriptor
deprecated
func (*MonitorMessage) Descriptor() ([]byte, []int)
Deprecated: Use MonitorMessage.ProtoReflect.Descriptor instead.
func (*MonitorMessage) GetAction ¶
func (x *MonitorMessage) GetAction() int32
func (*MonitorMessage) GetBaseUrl ¶
func (x *MonitorMessage) GetBaseUrl() string
func (*MonitorMessage) GetFileInfo ¶
func (x *MonitorMessage) GetFileInfo() *FileInfo
func (*MonitorMessage) ProtoMessage ¶
func (*MonitorMessage) ProtoMessage()
func (*MonitorMessage) ProtoReflect ¶
func (x *MonitorMessage) ProtoReflect() protoreflect.Message
func (*MonitorMessage) Reset ¶
func (x *MonitorMessage) Reset()
func (*MonitorMessage) String ¶
func (x *MonitorMessage) String() string
type MonitorServiceClient ¶
type MonitorServiceClient interface {
// Monitor monitor the remote server
Monitor(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (MonitorService_MonitorClient, error)
}
MonitorServiceClient is the client API for MonitorService 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 NewMonitorServiceClient ¶
func NewMonitorServiceClient(cc grpc.ClientConnInterface) MonitorServiceClient
type MonitorServiceServer ¶
type MonitorServiceServer interface {
// Monitor monitor the remote server
Monitor(*emptypb.Empty, MonitorService_MonitorServer) error
// contains filtered or unexported methods
}
MonitorServiceServer is the server API for MonitorService service. All implementations must embed UnimplementedMonitorServiceServer for forward compatibility
type MonitorService_MonitorClient ¶
type MonitorService_MonitorClient interface {
Recv() (*MonitorMessage, error)
grpc.ClientStream
}
type MonitorService_MonitorServer ¶
type MonitorService_MonitorServer interface {
Send(*MonitorMessage) error
grpc.ServerStream
}
type UnimplementedMonitorServiceServer ¶
type UnimplementedMonitorServiceServer struct {
}
UnimplementedMonitorServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedMonitorServiceServer) Monitor ¶
func (UnimplementedMonitorServiceServer) Monitor(*emptypb.Empty, MonitorService_MonitorServer) error
type UnsafeMonitorServiceServer ¶
type UnsafeMonitorServiceServer interface {
// contains filtered or unexported methods
}
UnsafeMonitorServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MonitorServiceServer will result in compilation errors.