grpc

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const MaxConcurrent = 20

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(withTLS bool, certPath, addr string) error

Types

type Client

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

func NewClient

func NewClient(ctx context.Context, addr string, caPath string, withTLS, skipVerify bool) (*Client, error)

func NewClientLoadBalancer

func NewClientLoadBalancer(servers []string) (*Client, error)

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) error

func (*Client) Receive

func (c *Client) Receive(ctx context.Context, id uuid.UUID, resChan chan *pb.ReceiveResponse) error

func (*Client) ReceiveInit

func (c *Client) ReceiveInit(ctx context.Context, id uuid.UUID) (string, int64, error)

func (*Client) Share

func (c *Client) Share(ctx context.Context, uid uuid.UUID, chunks chan *pb.ShareRequest) error

func (*Client) ShareInit

func (c *Client) ShareInit(ctx context.Context, uid uuid.UUID, fileName string, fileSize int64) error

type Server

type Server struct {
	pb.UnimplementedGoShareServer
	// contains filtered or unexported fields
}

func (*Server) Ping

func (s *Server) Ping(ctx context.Context, _ *pb.PingMsg) (*pb.PongMsg, error)

func (*Server) Receive

func (s *Server) Receive(req *pb.ReceiveRequest, receiver pb.GoShare_ReceiveServer) error

func (*Server) ReceiveInit

func (s *Server) ReceiveInit(ctx context.Context, req *pb.ReceiveRequest) (*pb.ReceiveInitResponse, error)

func (*Server) Share

func (s *Server) Share(stream pb.GoShare_ShareServer) error

func (*Server) ShareInit

func (s *Server) ShareInit(ctx context.Context, req *pb.ShareInitRequest) (*pb.ShareInitResponse, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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