autoreg

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPort = 2501

Variables

This section is empty.

Functions

func Register

func Register(ctx context.Context, addr string, info Info) error

Register the hub on the hublist.

Types

type Info

type Info struct {
	Name     string
	Host     string
	Desc     string
	Users    int
	Share    uint64
	MinShare uint64
}

type Registry

type Registry interface {
	RegisterHub(info Info) error
}

Registry is an interface for a hublist registry.

type RegistryFunc

type RegistryFunc func(info Info) error

func (RegistryFunc) RegisterHub

func (f RegistryFunc) RegisterHub(info Info) error

type Server

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

func NewServer

func NewServer(r Registry) *Server

NewServer creates a new hub auto-registration server.

func (*Server) KeyCheck

func (s *Server) KeyCheck(v bool)

func (*Server) Serve

func (s *Server) Serve(lis net.Listener) error

func (*Server) ServeConn

func (s *Server) ServeConn(c net.Conn) error

Jump to

Keyboard shortcuts

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