node

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLink(db *jsondb.DB[*node.Node], outbound *outbound, manager *manager) *link

func NewManager

func NewManager(m *node.Manager) *manager

func NewOutbound

func NewOutbound(db *jsondb.DB[*node.Node], 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) 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
	netapi.EmptyDispatch
	// contains filtered or unexported fields
}

func NewNodes

func NewNodes(fileStore *FileStore) *Nodes

func (*Nodes) Conn

func (n *Nodes) Conn(ctx context.Context, addr netapi.Address) (net.Conn, error)

func (*Nodes) Get

func (*Nodes) Latency

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

func (*Nodes) Manager

func (n *Nodes) Manager(context.Context, *emptypb.Empty) (*node.Manager, error)

func (*Nodes) Now

func (n *Nodes) Now(context.Context, *emptypb.Empty) (*gn.NowResp, error)

func (*Nodes) PacketConn

func (n *Nodes) PacketConn(ctx context.Context, addr netapi.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) SetRuleTags

func (n *Nodes) SetRuleTags(f func() []string)

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