data

package
v1.0.0-bate1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPort = 8910
View Source
const ESConfigFileName = "es.json"
View Source
const ESConfigPath = "esconfig"
View Source
const ESKeyFileExt = ".eskey"
View Source
const ESVersion = 1

Variables

This section is empty.

Functions

func GetCurrentDirectory

func GetCurrentDirectory() string

GetCurrentDirectory 获取程序运行路径

func GetRunDirectory

func GetRunDirectory() string

GetRunDirectory 获取启动指令的执行目录

Types

type ESConfig

type ESConfig struct {
	Port   int    `json:"port"`   //服务端口,默认端口8910
	Name   string `json:"name"`   //系统中的nodename用于区分不同服务
	Key    string `json:"key"`    //链接密钥,用于链接到整个系统中
	Server string `json:"server"` //索引服务器的访问端点
	//以下问索引服务配置
	// 访问端点指的是一个可以公共可访问的端点,ip+端口 或者域名+端口
	//IndexServer才需要访问端点,比如istest.kuaibang360.com:3456
	Endpoint string `json:"endpoint"` // 访问端点
}

ESConfig 配置文件映射结构

func GetConfig

func GetConfig(configFile ...string) (*ESConfig, error)

type ESKey

type ESKey struct {
	Name string `json:"name"` // NodeName
	Key  string `json:"key"`  // 密钥
}

ESKey 密钥文件映射结构,索引服务配置文件目录需要增加相应客户端的密码,客户端才可以连

type Request

type Request struct {
	NodeName   string   // 节点名称
	Path       string   //服务包路径
	Method     string   //服务名
	Parameters [][]byte //调用参数
}

Request 调用服务的时候发出去的数据

func (*Request) AddParameter

func (r *Request) AddParameter(parameter interface{}) error

func (*Request) SetParameters

func (r *Request) SetParameters(parameter ...interface{}) error

type Result

type Result struct {
	Binary [][]byte // 方法返回的数据
}

Result 服务执行结果

func NewResult

func NewResult(vs []reflect.Value) (*Result, error)

func (*Result) AddData

func (r *Result) AddData(typeValue reflect.Value) error

AddData 增加数据

func (*Result) GetData

func (r *Result) GetData() [][]byte

func (*Result) GetResult

func (r *Result) GetResult(function interface{}) error

GetResult 利用回调方法获取数据

func (*Result) SetData

func (r *Result) SetData(data [][]byte)

Jump to

Keyboard shortcuts

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