node

package
v0.3.1-rc.4 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLink(outbound *outbound, manager *manager, links map[string]*subscribe.Link) *link

func NewManager

func NewManager(m *node.Manager) *manager

func NewOutbound

func NewOutbound(tcp, udp *point.Point, mamanager *manager) *outbound

Types

type FileStore

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

func NewFileStore

func NewFileStore(path string) *FileStore

func (*FileStore) Load

func (n *FileStore) Load() *node.Node

func (*FileStore) Save

func (n *FileStore) Save() error

type Nodes

type Nodes struct {
	grpcnode.UnimplementedNodeServer
	// contains filtered or unexported fields
}

func NewNodes

func NewNodes(fileStore *FileStore) *Nodes

func (*Nodes) Conn

func (n *Nodes) Conn(addr proxy.Address) (net.Conn, error)

func (*Nodes) Do

func (n *Nodes) Do(req *http.Request) (*http.Response, error)

func (*Nodes) Get

func (*Nodes) Latency

func (n *Nodes) Latency(c context.Context, req *latency.Requests) (*latency.Response, error)

func (*Nodes) Manager

func (*Nodes) Now

func (n *Nodes) Now(_ context.Context, r *grpcnode.NowReq) (*point.Point, error)

func (*Nodes) PacketConn

func (n *Nodes) PacketConn(addr proxy.Address) (net.PacketConn, error)

func (*Nodes) Remove

func (*Nodes) Save

func (n *Nodes) Save(c context.Context, p *point.Point) (*point.Point, error)

func (*Nodes) Use

func (n *Nodes) Use(c context.Context, s *grpcnode.UseReq) (*point.Point, error)

type Subscribe

type Subscribe struct {
	grpcnode.SubscribeServer
	// contains filtered or unexported fields
}

func NewSubscribe

func NewSubscribe(f *FileStore) *Subscribe

func (*Subscribe) Get

func (*Subscribe) Remove

func (s *Subscribe) Remove(_ context.Context, l *grpcnode.LinkReq) (*emptypb.Empty, error)

func (*Subscribe) Save

func (*Subscribe) Update

func (s *Subscribe) Update(_ context.Context, req *grpcnode.LinkReq) (*emptypb.Empty, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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