Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
Context type is localized for future purposes. Network Host can have multiple IDs, but each action must be executed with only one ID. Context is used in all actions to select specific ID to work with.
type HostHandler ¶
type HostHandler interface { Disconnect() Listen() error ObtainIP() error Bootstrap() error StartAuthorize() error NumHosts(ctx Context) int AnalyzeNetwork(ctx Context) error ConfirmNodeRole(role string) bool HtFromCtx(ctx Context) *routing.HashTable StoreRetrieve(key store.Key) ([]byte, bool) EqualAuthSentKey(targetID string, key []byte) bool SendRequest(packet *packet.Packet) (transport.Future, error) FindHost(ctx Context, targetID string) (*host.Host, bool, error) RemoteProcedureRegister(name string, method core.RemoteProcedure) InvokeRPC(sender *host.Host, method string, args [][]byte) ([]byte, error) CascadeSendMessage(data core.Cascade, targetID string, method string, args [][]byte) error Store(key store.Key, data []byte, replication time.Time, expiration time.Time, publisher bool) error RemoteProcedureCall(ctx Context, targetID string, method string, args [][]byte) (result []byte, err error) AddPossibleProxyID(id string) AddPossibleRelayID(id string) AddProxyHost(targetID string) AddSubnetID(ip, targetID string) AddAuthSentKey(id string, key []byte) AddRelayClient(host *host.Host) error AddReceivedKey(target string, key []byte) AddHost(ctx Context, host *routing.RouteHost) AddActiveNodes(activeNode []*core.ActiveNode) error RemoveAuthHost(key string) RemoveProxyHost(targetID string) RemovePossibleProxyID(id string) RemoveAuthSentKeys(targetID string) RemoveRelayClient(host *host.Host) error SetHighKnownHostID(id string) SetOuterHostsCount(hosts int) SetAuthStatus(targetID string, status bool) SetNodeKeeper(keeper consensus.NodeKeeper) GetHostsFromBootstrap() GetProxyHostsCount() int GetOuterHostsCount() int GetNodeID() core.RecordRef GetHighKnownHostID() string GetSelfKnownOuterHosts() int GetOriginHost() *host.Origin GetPacketTimeout() time.Duration GetPrivateKey() *ecdsa.PrivateKey GetReplicationTime() time.Duration HostIsAuthenticated(targetID string) bool KeyIsReceived(targetID string) ([]byte, bool) GetNetworkCommonFacade() NetworkCommonFacade GetExpirationTime(ctx Context, key []byte) time.Time GetActiveNodesList() []*core.ActiveNode AddUnsync(nodeID core.RecordRef, roles []core.NodeRole, address string, version string) (chan *core.ActiveNode, error) }
HostHandler is an interface which uses for host network implementation.
type NetworkCommonFacade ¶
type NetworkCommonFacade interface { GetRPC() rpc.RPC GetCascade() *cascade.Cascade GetPulseManager() core.PulseManager SetPulseManager(manager core.PulseManager) SetConsensus(insolarConsensus consensus.Processor) GetConsensus() consensus.Processor SetNetworkCoordinator(coordinator core.NetworkCoordinator) GetNetworkCoordinator() core.NetworkCoordinator GetSignHandler() signhandler.SignHandler }
NetworkCommonFacade is used to implement additional features in network to evade showing them in the main HostHandler interface
func NewNetworkCommonFacade ¶
func NewNetworkCommonFacade(r rpc.RPC, casc *cascade.Cascade, signH signhandler.SignHandler) NetworkCommonFacade
NewNetworkCommonFacade creates a NetworkCommonFacade.
Click to show internal directories.
Click to hide internal directories.