api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

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) Descriptor() ([]byte, []int)

Deprecated: Use Device.ProtoReflect.Descriptor instead.

func (*Device) GetActive

func (x *Device) GetActive() bool

func (*Device) GetFiles

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

func (*Device) GetHash

func (x *Device) GetHash() string

func (*Device) GetIp

func (x *Device) GetIp() string

func (*Device) GetName

func (x *Device) GetName() string

func (*Device) GetPort

func (x *Device) GetPort() string

func (*Device) GetSocketPort

func (x *Device) GetSocketPort() string

func (*Device) ProtoMessage

func (*Device) ProtoMessage()

func (*Device) ProtoReflect

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

func (*Device) Reset

func (x *Device) Reset()

func (*Device) String

func (x *Device) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Devices.ProtoReflect.Descriptor instead.

func (*Devices) GetDevices

func (x *Devices) GetDevices() []*Device

func (*Devices) ProtoMessage

func (*Devices) ProtoMessage()

func (*Devices) ProtoReflect

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

func (*Devices) Reset

func (x *Devices) Reset()

func (*Devices) String

func (x *Devices) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use File.ProtoReflect.Descriptor instead.

func (*File) GetExt

func (x *File) GetExt() string

func (*File) GetHash

func (x *File) GetHash() string

func (*File) GetName

func (x *File) GetName() string

func (*File) GetSize

func (x *File) GetSize() int64

func (*File) GetType

func (x *File) GetType() string

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 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) Descriptor() ([]byte, []int)

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetBody

func (x *Message) GetBody() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type Server

type Server struct {
	Devices  []*Device
	Self     *Device
	Listener *chan bool
	IsMaster bool
}

func (*Server) Fetch

func (s *Server) Fetch(ctx context.Context, in *File) (*FetchResponse, error)

func (*Server) Init

func (s *Server) Init(ctx context.Context, in *Device) (*Devices, error)

func (*Server) List

func (s *Server) List(ctx context.Context, in *Void) (*Devices, error)

func (*Server) Refresh

func (s *Server) Refresh(ctx context.Context, in *Device) (*Device, error)

func (*Server) Status

func (s *Server) Status(ctx context.Context, in *Void) (*Device, error)

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) Init

func (*UnimplementedServiceServer) List

func (*UnimplementedServiceServer) Refresh

func (*UnimplementedServiceServer) Status

type Void

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

func (*Void) Descriptor deprecated

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

Deprecated: Use Void.ProtoReflect.Descriptor instead.

func (*Void) ProtoMessage

func (*Void) ProtoMessage()

func (*Void) ProtoReflect

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

func (*Void) Reset

func (x *Void) Reset()

func (*Void) String

func (x *Void) String() string

Jump to

Keyboard shortcuts

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