node

package
v0.3.1-rc.7 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 34 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

func NewTag

func NewTag(f *FileStore) gn.TagServer

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 HashKey

type HashKey struct{}

func (HashKey) String

func (HashKey) String() string

type Nodes

type Nodes struct {
	gn.UnimplementedNodeServer
	proxy.EmptyDispatch
	// contains filtered or unexported fields
}

func NewNodes

func NewNodes(fileStore *FileStore) *Nodes

func (*Nodes) Conn

func (n *Nodes) Conn(ctx context.Context, 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 *gn.NowReq) (*point.Point, error)

func (*Nodes) PacketConn

func (n *Nodes) PacketConn(ctx context.Context, 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 *gn.UseReq) (*point.Point, error)

type Subscribe

type Subscribe struct {
	gn.UnimplementedSubscribeServer
	// 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 *gn.LinkReq) (*emptypb.Empty, error)

func (*Subscribe) Save

func (*Subscribe) Update

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

type TagKey

type TagKey struct{}

func (TagKey) String

func (TagKey) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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