Documentation
¶
Index ¶
- Variables
- func RegisterServiceServer(s *grpc.Server, srv ServiceServer)
- type Device
- func (*Device) Descriptor() ([]byte, []int)deprecated
- func (x *Device) GetActive() bool
- func (x *Device) GetFiles() []*File
- func (x *Device) GetHash() string
- func (x *Device) GetIp() string
- func (x *Device) GetName() string
- func (x *Device) GetPort() string
- func (x *Device) GetSocketPort() string
- func (*Device) ProtoMessage()
- func (x *Device) ProtoReflect() protoreflect.Message
- func (x *Device) Reset()
- func (x *Device) String() string
- type Devices
- type FetchResponse
- func (*FetchResponse) Descriptor() ([]byte, []int)deprecated
- func (x *FetchResponse) GetError() string
- func (x *FetchResponse) GetSuccess() bool
- func (*FetchResponse) ProtoMessage()
- func (x *FetchResponse) ProtoReflect() protoreflect.Message
- func (x *FetchResponse) Reset()
- func (x *FetchResponse) String() string
- type File
- func (*File) Descriptor() ([]byte, []int)deprecated
- func (x *File) GetExt() string
- func (x *File) GetHash() string
- func (x *File) GetName() string
- func (x *File) GetSize() int64
- func (x *File) GetType() string
- func (*File) ProtoMessage()
- func (x *File) ProtoReflect() protoreflect.Message
- func (x *File) Reset()
- func (x *File) String() string
- type Message
- type Server
- func (s *Server) Fetch(ctx context.Context, in *File) (*FetchResponse, error)
- func (s *Server) Init(ctx context.Context, in *Device) (*Devices, error)
- func (s *Server) List(ctx context.Context, in *Void) (*Devices, error)
- func (s *Server) Refresh(ctx context.Context, in *Device) (*Device, error)
- func (s *Server) Status(ctx context.Context, in *Void) (*Device, error)
- type ServiceClient
- type ServiceServer
- type UnimplementedServiceServer
- func (*UnimplementedServiceServer) Fetch(context.Context, *File) (*FetchResponse, error)
- func (*UnimplementedServiceServer) Init(context.Context, *Device) (*Devices, error)
- func (*UnimplementedServiceServer) List(context.Context, *Void) (*Devices, error)
- func (*UnimplementedServiceServer) Refresh(context.Context, *Device) (*Device, error)
- func (*UnimplementedServiceServer) Status(context.Context, *Void) (*Device, error)
- type Void
Constants ¶
This section is empty.
Variables ¶
View Source
var File_api_api_proto protoreflect.FileDescriptor
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s *grpc.Server, srv ServiceServer)
Types ¶
type Device ¶
type Device struct {
Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Ip string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"`
Port string `protobuf:"bytes,4,opt,name=port,proto3" json:"port,omitempty"`
SocketPort string `protobuf:"bytes,5,opt,name=socketPort,proto3" json:"socketPort,omitempty"`
Files []*File `protobuf:"bytes,6,rep,name=files,proto3" json:"files,omitempty"`
Active bool `protobuf:"varint,7,opt,name=active,proto3" json:"active,omitempty"`
// contains filtered or unexported fields
}
func (*Device) Descriptor
deprecated
func (*Device) GetSocketPort ¶
func (*Device) ProtoMessage ¶
func (*Device) ProtoMessage()
func (*Device) ProtoReflect ¶
func (x *Device) ProtoReflect() protoreflect.Message
type Devices ¶
type Devices struct {
Devices []*Device `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"`
// contains filtered or unexported fields
}
func (*Devices) Descriptor
deprecated
func (*Devices) GetDevices ¶
func (*Devices) ProtoMessage ¶
func (*Devices) ProtoMessage()
func (*Devices) ProtoReflect ¶
func (x *Devices) ProtoReflect() protoreflect.Message
type FetchResponse ¶
type FetchResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
// contains filtered or unexported fields
}
func (*FetchResponse) Descriptor
deprecated
func (*FetchResponse) Descriptor() ([]byte, []int)
Deprecated: Use FetchResponse.ProtoReflect.Descriptor instead.
func (*FetchResponse) GetError ¶
func (x *FetchResponse) GetError() string
func (*FetchResponse) GetSuccess ¶
func (x *FetchResponse) GetSuccess() bool
func (*FetchResponse) ProtoMessage ¶
func (*FetchResponse) ProtoMessage()
func (*FetchResponse) ProtoReflect ¶
func (x *FetchResponse) ProtoReflect() protoreflect.Message
func (*FetchResponse) Reset ¶
func (x *FetchResponse) Reset()
func (*FetchResponse) String ¶
func (x *FetchResponse) String() string
type File ¶
type File struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
Ext string `protobuf:"bytes,4,opt,name=ext,proto3" json:"ext,omitempty"`
Size int64 `protobuf:"varint,5,opt,name=size,proto3" json:"size,omitempty"`
// contains filtered or unexported fields
}
func (*File) Descriptor
deprecated
func (*File) ProtoMessage ¶
func (*File) ProtoMessage()
func (*File) ProtoReflect ¶
func (x *File) ProtoReflect() protoreflect.Message
type Message ¶
type Message struct {
Body string `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
// contains filtered or unexported fields
}
func (*Message) Descriptor
deprecated
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type ServiceClient ¶
type ServiceClient interface {
// master services
Init(ctx context.Context, in *Device, opts ...grpc.CallOption) (*Devices, error)
Refresh(ctx context.Context, in *Device, opts ...grpc.CallOption) (*Device, error)
// node service
List(ctx context.Context, in *Void, opts ...grpc.CallOption) (*Devices, error)
Status(ctx context.Context, in *Void, opts ...grpc.CallOption) (*Device, error)
Fetch(ctx context.Context, in *File, opts ...grpc.CallOption) (*FetchResponse, error)
}
ServiceClient is the client API for Service service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer interface {
// master services
Init(context.Context, *Device) (*Devices, error)
Refresh(context.Context, *Device) (*Device, error)
// node service
List(context.Context, *Void) (*Devices, error)
Status(context.Context, *Void) (*Device, error)
Fetch(context.Context, *File) (*FetchResponse, error)
}
ServiceServer is the server API for Service service.
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct {
}
UnimplementedServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedServiceServer) Fetch ¶
func (*UnimplementedServiceServer) Fetch(context.Context, *File) (*FetchResponse, error)
type Void ¶
type Void struct {
// contains filtered or unexported fields
}
func (*Void) Descriptor
deprecated
func (*Void) ProtoMessage ¶
func (*Void) ProtoMessage()
func (*Void) ProtoReflect ¶
func (x *Void) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.