nodes

package
v0.0.0-...-c1e9cd8 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthNodes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowNodes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupNodes = fmt.Errorf("proto: unexpected end of group")
)

Functions

This section is empty.

Types

type Nodes

type Nodes struct {
	NodesProto
	FileMu sync.RWMutex
	MemMu  sync.RWMutex
}

func (*Nodes) AddNode

func (m *Nodes) AddNode(host string, ent string, ip uint64, name string, delay uint64)

func (*Nodes) Clear

func (m *Nodes) Clear()

func (*Nodes) CopyDelay

func (m *Nodes) CopyDelay() map[uint64]uint64

func (*Nodes) CopyHosts

func (m *Nodes) CopyHosts() map[string]uint64

func (*Nodes) CopyIp64S

func (m *Nodes) CopyIp64S() map[uint64]string

func (*Nodes) CopyNodes

func (m *Nodes) CopyNodes() map[string]string

func (*Nodes) DelNodeByIP

func (m *Nodes) DelNodeByIP(ip uint64)

func (*Nodes) IsIp64InNodes

func (m *Nodes) IsIp64InNodes(ip uint64) bool

func (*Nodes) Load

func (m *Nodes) Load(nodesfile string) error

func (*Nodes) ParseRawNodes

func (m *Nodes) ParseRawNodes(d []byte) error

func (*Nodes) Save

func (m *Nodes) Save(nodesfile string) error

type NodesProto

type NodesProto struct {
	// real ip:port to entry
	Nodes map[string]string `` /* 151-byte string literal not displayed */
	// ip64 to real ip:port
	Ip64S map[uint64]string `` /* 152-byte string literal not displayed */
	// real ip:port to ip64
	Hosts map[string]uint64 `` /* 152-byte string literal not displayed */
	// ip64 to delay
	Delay map[uint64]uint64 `` /* 153-byte string literal not displayed */
	// ip64 to host name
	Names                map[uint64]string `` /* 152-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*NodesProto) Descriptor

func (*NodesProto) Descriptor() ([]byte, []int)

func (*NodesProto) GetDelay

func (m *NodesProto) GetDelay() map[uint64]uint64

func (*NodesProto) GetHosts

func (m *NodesProto) GetHosts() map[string]uint64

func (*NodesProto) GetIp64S

func (m *NodesProto) GetIp64S() map[uint64]string

func (*NodesProto) GetNames

func (m *NodesProto) GetNames() map[uint64]string

func (*NodesProto) GetNodes

func (m *NodesProto) GetNodes() map[string]string

func (*NodesProto) Marshal

func (m *NodesProto) Marshal() (dAtA []byte, err error)

func (*NodesProto) MarshalTo

func (m *NodesProto) MarshalTo(dAtA []byte) (int, error)

func (*NodesProto) MarshalToSizedBuffer

func (m *NodesProto) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*NodesProto) ProtoMessage

func (*NodesProto) ProtoMessage()

func (*NodesProto) Reset

func (m *NodesProto) Reset()

func (*NodesProto) Size

func (m *NodesProto) Size() (n int)

func (*NodesProto) String

func (m *NodesProto) String() string

func (*NodesProto) Unmarshal

func (m *NodesProto) Unmarshal(dAtA []byte) error

func (*NodesProto) XXX_DiscardUnknown

func (m *NodesProto) XXX_DiscardUnknown()

func (*NodesProto) XXX_Marshal

func (m *NodesProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NodesProto) XXX_Merge

func (m *NodesProto) XXX_Merge(src proto.Message)

func (*NodesProto) XXX_Size

func (m *NodesProto) XXX_Size() int

func (*NodesProto) XXX_Unmarshal

func (m *NodesProto) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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