cloud

package
v0.0.0-...-f638652 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

* 包cloud包含了对云端程序的通用描述及功能集合

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KNode

type KNode struct {
	Id   string // 节点ID(uuid)
	Host string // 节点Host
}

计算机节点的kercylan-lib实现。

func NewNode

func NewNode(host string) *KNode

构建一个KNode实例

会以host来创建一个KNode,这个节点描述了这个应用程序在云端的一切信息。

由于KNode在创建时会自己产生一个ID,所以极其建议将其使用数据库或其他方式进行存储。

这样在各种分布式、集群场景中可以确保通过数据库使用id检索到节点信息,也可以使用节点信息检索到节点id。

func (*KNode) GetHost

func (slf *KNode) GetHost() string

func (*KNode) GetId

func (slf *KNode) GetId() string

type Node

type Node interface {
	// 获取节点id,
	GetId() string
	// 获取节点host。
	GetHost() string
}

计算机节点的通用描述接口

Jump to

Keyboard shortcuts

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