server

package
v0.0.0-...-8b35ad8 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	BaseURL string
	// SendURL is the URL used to send the file
	SendURL string
	// ReceiveURL is the URL used to Receive the file
	ReceiveURL string
	// contains filtered or unexported fields
}

Server is the server

func New

func New(cfg *config.Config) (*Server, error)

New instance of the server

func (*Server) DisplayQR

func (s *Server) DisplayQR(url string)

DisplayQR creates a handler for serving the QR code in the browser

func (*Server) ReceiveTo

func (s *Server) ReceiveTo(dir string) error

ReceiveTo sets the output directory

func (*Server) Send

func (s *Server) Send(p payload.Payload)

Send adds a handler for sending the file

func (Server) Shutdown

func (s Server) Shutdown()

Shutdown the server

func (Server) Wait

func (s Server) Wait() error

Wait for transfer to be completed, it waits forever if kept awlive

Jump to

Keyboard shortcuts

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