Documentation
¶
Index ¶
- func NewOutbound(mamanager *Manager) *outbound
- func NewSet(nodes *protocol.Set, m *Manager) (netapi.Proxy, error)
- type HashKey
- type Manager
- func (m *Manager) AddTag(tag string, t pt.TagType, hash string)
- func (m *Manager) Close() error
- func (m *Manager) DeleteLink(name ...string)
- func (mm *Manager) DeleteNode(hash string)
- func (m *Manager) DeleteRemoteNodes(group string)
- func (m *Manager) DeleteTag(tag string)
- func (m *Manager) ExistTag(tag string) (t *pt.Tags, ok bool)
- func (m *Manager) GetGroups() map[string]*node.Nodes
- func (m *Manager) GetLink(name string) (*subscribe.Link, bool)
- func (m *Manager) GetLinks() map[string]*subscribe.Link
- func (m *Manager) GetNode(hash string) (*point.Point, bool)
- func (o *Manager) GetNow(tcp bool) *point.Point
- func (m *Manager) GetStore() *ProxyStore
- func (m *Manager) GetTags() map[string]*pt.Tags
- func (n *Manager) Links() *link
- func (m *Manager) Node() *Nodes
- func (n *Manager) Outbound() *outbound
- func (m *Manager) Save() error
- func (m *Manager) SaveLinks(links ...*subscribe.Link)
- func (mm *Manager) SaveNode(ps ...*point.Point)
- func (f *Manager) Subscribe() *Subscribe
- func (f *Manager) Tag(ff func() iter.Seq[string]) gn.TagServer
- func (m *Manager) UsePoint(tcp, udp bool, hash string) error
- type Node
- type Nodes
- func (n *Nodes) Activates(context.Context, *emptypb.Empty) (*gn.ActivatesResponse, error)
- func (n *Nodes) Close(ctx context.Context, req *wrapperspb.StringValue) (*emptypb.Empty, error)
- func (n *Nodes) Get(_ context.Context, s *wrapperspb.StringValue) (*point.Point, error)
- func (n *Nodes) Latency(c context.Context, req *latency.Requests) (*latency.Response, error)
- func (n *Nodes) List(ctx context.Context, _ *emptypb.Empty) (*gn.NodesResponse, error)
- func (n *Nodes) Now(context.Context, *emptypb.Empty) (*gn.NowResp, error)
- func (n *Nodes) Remove(_ context.Context, s *wrapperspb.StringValue) (*emptypb.Empty, error)
- func (n *Nodes) Save(c context.Context, p *point.Point) (*point.Point, error)
- func (n *Nodes) Use(c context.Context, s *gn.UseReq) (*point.Point, error)
- type ProxyEntry
- type ProxyStore
- func (p *ProxyStore) Close() error
- func (p *ProxyStore) Delete(hash string)
- func (p *ProxyStore) LoadOrCreate(ctx context.Context, hash string, f func() (*ProxyEntry, error)) (netapi.Proxy, error)
- func (p *ProxyStore) Range(f func(key string, value *ProxyEntry) bool)
- func (p *ProxyStore) Refresh(po *point.Point)
- type Set
- type Subscribe
- func (s *Subscribe) Get(context.Context, *emptypb.Empty) (*gn.GetLinksResp, error)
- func (s *Subscribe) Remove(_ context.Context, l *gn.LinkReq) (*emptypb.Empty, error)
- func (s *Subscribe) Save(_ context.Context, l *gn.SaveLinkReq) (*emptypb.Empty, error)
- func (s *Subscribe) Update(_ context.Context, req *gn.LinkReq) (*emptypb.Empty, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOutbound ¶
func NewOutbound(mamanager *Manager) *outbound
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) DeleteLink ¶
func (*Manager) DeleteNode ¶
func (*Manager) DeleteRemoteNodes ¶
func (*Manager) GetStore ¶
func (m *Manager) GetStore() *ProxyStore
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) GetManager ¶
type Nodes ¶
type Nodes struct {
gn.UnimplementedNodeServer
// contains filtered or unexported fields
}
func (*Nodes) Close ¶
func (n *Nodes) Close(ctx context.Context, req *wrapperspb.StringValue) (*emptypb.Empty, error)
func (*Nodes) Get ¶
func (n *Nodes) Get(_ context.Context, s *wrapperspb.StringValue) (*point.Point, error)
func (*Nodes) Remove ¶
func (n *Nodes) Remove(_ context.Context, s *wrapperspb.StringValue) (*emptypb.Empty, error)
type ProxyEntry ¶
type ProxyEntry struct {
Proxy netapi.Proxy
Config *point.Point
// contains filtered or unexported fields
}
ProxyEntry
TODO: first solution:
Ref counter: make sure all parent(eg: [Set]) released before proxy close Slef update: update proxy (close and recreate) when point config changed
second solution:
check all using nodes(include [Set]) and close useless nodes
third solution:
double reference: node <-> [Set]
type ProxyStore ¶
type ProxyStore struct {
// contains filtered or unexported fields
}
func NewProxyStore ¶
func NewProxyStore() *ProxyStore
func (*ProxyStore) Close ¶
func (p *ProxyStore) Close() error
func (*ProxyStore) Delete ¶
func (p *ProxyStore) Delete(hash string)
func (*ProxyStore) LoadOrCreate ¶
func (p *ProxyStore) LoadOrCreate(ctx context.Context, hash string, f func() (*ProxyEntry, error)) (netapi.Proxy, error)
func (*ProxyStore) Range ¶
func (p *ProxyStore) Range(f func(key string, value *ProxyEntry) bool)
func (*ProxyStore) Refresh ¶
func (p *ProxyStore) Refresh(po *point.Point)
type Set ¶
type Set struct {
netapi.EmptyDispatch
Nodes []string
// contains filtered or unexported fields
}
Set
TODO: happyeyeballs?
func (*Set) PacketConn ¶
Click to show internal directories.
Click to hide internal directories.