services

package
v0.0.0-...-63b2ac5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddressType_name = map[int32]string{
	0: "Unknow",
	1: "UNIX",
	2: "TCP",
	3: "HTTP",
}
View Source
var AddressType_value = map[string]int32{
	"Unknow": 0,
	"UNIX":   1,
	"TCP":    2,
	"HTTP":   3,
}
View Source
var OPServiceRequest_ActionType_name = map[int32]string{
	0: "Unknow",
	1: "Register",
	2: "UnRegister",
	3: "Stop",
	4: "Terminal",
	5: "Pause",
	6: "Start",
	7: "Search",
}
View Source
var OPServiceRequest_ActionType_value = map[string]int32{
	"Unknow":     0,
	"Register":   1,
	"UnRegister": 2,
	"Stop":       3,
	"Terminal":   4,
	"Pause":      5,
	"Start":      6,
	"Search":     7,
}
View Source
var OPServiceRequest_OpOption_name = map[int32]string{
	0: "WithSearchOnlyOne",
	1: "WithSearchMultiple",
	2: "WithSearchKey",
}
View Source
var OPServiceRequest_OpOption_value = map[string]int32{
	"WithSearchOnlyOne":  0,
	"WithSearchMultiple": 1,
	"WithSearchKey":      2,
}
View Source
var OPServiceResponse_OpCode_name = map[int32]string{
	0:  "Success",
	1:  "RegisterFailed",
	11: "RegisterFailed_exist",
	7:  "SearchFailed",
	71: "SearchFailed_noExist",
}
View Source
var OPServiceResponse_OpCode_value = map[string]int32{
	"Success":              0,
	"RegisterFailed":       1,
	"RegisterFailed_exist": 11,
	"SearchFailed":         7,
	"SearchFailed_noExist": 71,
}
View Source
var ServiceAuth_AuthType_name = map[int32]string{
	0: "basic",
	1: "code",
	2: "accessToken",
}
View Source
var ServiceAuth_AuthType_value = map[string]int32{
	"basic":       0,
	"code":        1,
	"accessToken": 2,
}

Functions

func RegisterFuncServiceServer

func RegisterFuncServiceServer(s *grpc.Server, srv FuncServiceServer)

func RegisterHelloServiceServer

func RegisterHelloServiceServer(s *grpc.Server, srv HelloServiceServer)

func RegisterProxyFuncServiceServer

func RegisterProxyFuncServiceServer(s *grpc.Server, srv ProxyFuncServiceServer)

func RegisterServiceRegisterServiceServer

func RegisterServiceRegisterServiceServer(s *grpc.Server, srv ServiceRegisterServiceServer)

Types

type Ack

type Ack struct {
	Ackcode              uint32   `protobuf:"varint,1,opt,name=ackcode,proto3" json:"ackcode,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ack确认服务保活,可以用来,验证服务是否正常可正常调用,请求方随机生成一个ack码,服务方立即将ack码+1后返回.

func (*Ack) Descriptor

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

func (*Ack) GetAckcode

func (m *Ack) GetAckcode() uint32

func (*Ack) ProtoMessage

func (*Ack) ProtoMessage()

func (*Ack) Reset

func (m *Ack) Reset()

func (*Ack) String

func (m *Ack) String() string

func (*Ack) XXX_DiscardUnknown

func (m *Ack) XXX_DiscardUnknown()

func (*Ack) XXX_Marshal

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

func (*Ack) XXX_Merge

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

func (*Ack) XXX_Size

func (m *Ack) XXX_Size() int

func (*Ack) XXX_Unmarshal

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

type AddressType

type AddressType int32

服务地址类型

const (
	AddressType_Unknow AddressType = 0
	AddressType_UNIX   AddressType = 1
	AddressType_TCP    AddressType = 2
	AddressType_HTTP   AddressType = 3
)

func (AddressType) EnumDescriptor

func (AddressType) EnumDescriptor() ([]byte, []int)

func (AddressType) String

func (x AddressType) String() string

type FuncServiceClient

type FuncServiceClient interface {
	// 发送ack请求, 服务返回ack确认包.
	Ack(ctx context.Context, in *Ack, opts ...grpc.CallOption) (*Ack, error)
	// rpc服务调用, 根据不同的功能模块id,具有不同的参数和响应,此处只做透传.
	FuncInvoker(ctx context.Context, in *RpcFuncRequest, opts ...grpc.CallOption) (*RpcFuncResponse, error)
	// 根据rpc服务注册的功能模块信息,返回可用的功能列表信息,(可能会带上接口参数简述,具体详细接口信息,可能需要参阅具体的服务接口文档.)
	// 一个服务内,可以根据某些热点模块进行单独部署访问,
	GetServiceFunList(ctx context.Context, in *ServicePointInfo, opts ...grpc.CallOption) (*ServiceFunList, error)
	// 获取该服务的状态,是否正常,用于帮助诊断和分析,根据每个rpc服务的不同,具体的实现可能不同,不过这里可以进行简单的统一定义
	GetServiceStatus(ctx context.Context, in *ServicePointInfo, opts ...grpc.CallOption) (*ServiceStatus, error)
}

FuncServiceClient is the client API for FuncService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewFuncServiceClient

func NewFuncServiceClient(cc *grpc.ClientConn) FuncServiceClient

type FuncServiceServer

type FuncServiceServer interface {
	// 发送ack请求, 服务返回ack确认包.
	Ack(context.Context, *Ack) (*Ack, error)
	// rpc服务调用, 根据不同的功能模块id,具有不同的参数和响应,此处只做透传.
	FuncInvoker(context.Context, *RpcFuncRequest) (*RpcFuncResponse, error)
	// 根据rpc服务注册的功能模块信息,返回可用的功能列表信息,(可能会带上接口参数简述,具体详细接口信息,可能需要参阅具体的服务接口文档.)
	// 一个服务内,可以根据某些热点模块进行单独部署访问,
	GetServiceFunList(context.Context, *ServicePointInfo) (*ServiceFunList, error)
	// 获取该服务的状态,是否正常,用于帮助诊断和分析,根据每个rpc服务的不同,具体的实现可能不同,不过这里可以进行简单的统一定义
	GetServiceStatus(context.Context, *ServicePointInfo) (*ServiceStatus, error)
}

FuncServiceServer is the server API for FuncService service.

type HelloMsg

type HelloMsg struct {
	Text                 string   `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HelloMsg) Descriptor

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

func (*HelloMsg) GetText

func (m *HelloMsg) GetText() string

func (*HelloMsg) ProtoMessage

func (*HelloMsg) ProtoMessage()

func (*HelloMsg) Reset

func (m *HelloMsg) Reset()

func (*HelloMsg) String

func (m *HelloMsg) String() string

func (*HelloMsg) XXX_DiscardUnknown

func (m *HelloMsg) XXX_DiscardUnknown()

func (*HelloMsg) XXX_Marshal

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

func (*HelloMsg) XXX_Merge

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

func (*HelloMsg) XXX_Size

func (m *HelloMsg) XXX_Size() int

func (*HelloMsg) XXX_Unmarshal

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

type HelloServiceClient

type HelloServiceClient interface {
	Hello(ctx context.Context, in *HelloMsg, opts ...grpc.CallOption) (*HelloMsg, error)
}

HelloServiceClient is the client API for HelloService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewHelloServiceClient

func NewHelloServiceClient(cc *grpc.ClientConn) HelloServiceClient

type HelloServiceServer

type HelloServiceServer interface {
	Hello(context.Context, *HelloMsg) (*HelloMsg, error)
}

HelloServiceServer is the server API for HelloService service.

type OPServiceRequest

type OPServiceRequest struct {
	// 操作行为类别
	ActionType OPServiceRequest_ActionType `protobuf:"varint,1,opt,name=actionType,proto3,enum=services.OPServiceRequest_ActionType" json:"actionType,omitempty"`
	// 服务操作选项
	ReqOption []byte `protobuf:"bytes,2,opt,name=reqOption,proto3" json:"reqOption,omitempty"`
	// 根据不同的类别,需要的字段情况不一样
	ServiceInfo          *ServiceDetailInfo `protobuf:"bytes,3,opt,name=serviceInfo,proto3" json:"serviceInfo,omitempty"`
	SearchKey            string             `protobuf:"bytes,4,opt,name=searchKey,proto3" json:"searchKey,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

funcService 控制服务 请求

func (*OPServiceRequest) Descriptor

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

func (*OPServiceRequest) GetActionType

func (m *OPServiceRequest) GetActionType() OPServiceRequest_ActionType

func (*OPServiceRequest) GetReqOption

func (m *OPServiceRequest) GetReqOption() []byte

func (*OPServiceRequest) GetSearchKey

func (m *OPServiceRequest) GetSearchKey() string

func (*OPServiceRequest) GetServiceInfo

func (m *OPServiceRequest) GetServiceInfo() *ServiceDetailInfo

func (*OPServiceRequest) ProtoMessage

func (*OPServiceRequest) ProtoMessage()

func (*OPServiceRequest) Reset

func (m *OPServiceRequest) Reset()

func (*OPServiceRequest) String

func (m *OPServiceRequest) String() string

func (*OPServiceRequest) XXX_DiscardUnknown

func (m *OPServiceRequest) XXX_DiscardUnknown()

func (*OPServiceRequest) XXX_Marshal

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

func (*OPServiceRequest) XXX_Merge

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

func (*OPServiceRequest) XXX_Size

func (m *OPServiceRequest) XXX_Size() int

func (*OPServiceRequest) XXX_Unmarshal

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

type OPServiceRequest_ActionType

type OPServiceRequest_ActionType int32
const (
	OPServiceRequest_Unknow OPServiceRequest_ActionType = 0
	// 注册服务
	OPServiceRequest_Register OPServiceRequest_ActionType = 1
	// 卸载服务
	OPServiceRequest_UnRegister OPServiceRequest_ActionType = 2
	// 安全停止服务
	OPServiceRequest_Stop OPServiceRequest_ActionType = 3
	// 强制中断服务
	OPServiceRequest_Terminal OPServiceRequest_ActionType = 4
	// 暂停服务,停止新入请求
	OPServiceRequest_Pause OPServiceRequest_ActionType = 5
	// 开启正常服务
	OPServiceRequest_Start OPServiceRequest_ActionType = 6
	// 查找服务
	OPServiceRequest_Search OPServiceRequest_ActionType = 7
)

func (OPServiceRequest_ActionType) EnumDescriptor

func (OPServiceRequest_ActionType) EnumDescriptor() ([]byte, []int)

func (OPServiceRequest_ActionType) String

type OPServiceRequest_OpOption

type OPServiceRequest_OpOption int32

操作选项

const (
	// 搜索选项 - 只有一个结果集(服务中心,自动选择一个可用的服务)
	OPServiceRequest_WithSearchOnlyOne OPServiceRequest_OpOption = 0
	// 搜索选项 - 多个结果集,(服务中心,根据搜索条件,返回多个服务列表结果集))
	OPServiceRequest_WithSearchMultiple OPServiceRequest_OpOption = 1
	// 搜索选项 - 只有指定了这个选项,才会使用 searchKey 来搜索
	OPServiceRequest_WithSearchKey OPServiceRequest_OpOption = 2
)

func (OPServiceRequest_OpOption) EnumDescriptor

func (OPServiceRequest_OpOption) EnumDescriptor() ([]byte, []int)

func (OPServiceRequest_OpOption) String

func (x OPServiceRequest_OpOption) String() string

type OPServiceResponse

type OPServiceResponse struct {
	// 操作是否成功
	Ok bool `protobuf:"varint,1,opt,name=Ok,proto3" json:"Ok,omitempty"`
	// 操作结果code
	OpCode OPServiceResponse_OpCode `protobuf:"varint,2,opt,name=opCode,proto3,enum=services.OPServiceResponse_OpCode" json:"opCode,omitempty"`
	// 操作消息,错误消息等
	OpMessage string `protobuf:"bytes,3,opt,name=opMessage,proto3" json:"opMessage,omitempty"`
	// 操作结果
	OpResult             *OPServiceResult `protobuf:"bytes,4,opt,name=opResult,proto3" json:"opResult,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

funcService 控制服务 响应

func (*OPServiceResponse) Descriptor

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

func (*OPServiceResponse) GetOk

func (m *OPServiceResponse) GetOk() bool

func (*OPServiceResponse) GetOpCode

func (*OPServiceResponse) GetOpMessage

func (m *OPServiceResponse) GetOpMessage() string

func (*OPServiceResponse) GetOpResult

func (m *OPServiceResponse) GetOpResult() *OPServiceResult

func (*OPServiceResponse) ProtoMessage

func (*OPServiceResponse) ProtoMessage()

func (*OPServiceResponse) Reset

func (m *OPServiceResponse) Reset()

func (*OPServiceResponse) String

func (m *OPServiceResponse) String() string

func (*OPServiceResponse) XXX_DiscardUnknown

func (m *OPServiceResponse) XXX_DiscardUnknown()

func (*OPServiceResponse) XXX_Marshal

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

func (*OPServiceResponse) XXX_Merge

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

func (*OPServiceResponse) XXX_Size

func (m *OPServiceResponse) XXX_Size() int

func (*OPServiceResponse) XXX_Unmarshal

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

type OPServiceResponse_OpCode

type OPServiceResponse_OpCode int32

操作结果code >=0, 遵循类unix风格,0代表成功,非0是错误码.

const (
	OPServiceResponse_Success              OPServiceResponse_OpCode = 0
	OPServiceResponse_RegisterFailed       OPServiceResponse_OpCode = 1
	OPServiceResponse_RegisterFailed_exist OPServiceResponse_OpCode = 11
	//
	OPServiceResponse_SearchFailed         OPServiceResponse_OpCode = 7
	OPServiceResponse_SearchFailed_noExist OPServiceResponse_OpCode = 71
)

func (OPServiceResponse_OpCode) EnumDescriptor

func (OPServiceResponse_OpCode) EnumDescriptor() ([]byte, []int)

func (OPServiceResponse_OpCode) String

func (x OPServiceResponse_OpCode) String() string

type OPServiceResult

type OPServiceResult struct {
	// 根据指定条件,查找出的service结果集,以服务中心使用的key名,作为结果集的key,以服务注册信息为value,返回有效的service的map结果集
	ServiceList          map[string]*ServiceDetailInfo `` /* 163-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
	XXX_unrecognized     []byte                        `json:"-"`
	XXX_sizecache        int32                         `json:"-"`
}

操作结果(查找服务结果)

func (*OPServiceResult) Descriptor

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

func (*OPServiceResult) GetServiceList

func (m *OPServiceResult) GetServiceList() map[string]*ServiceDetailInfo

func (*OPServiceResult) ProtoMessage

func (*OPServiceResult) ProtoMessage()

func (*OPServiceResult) Reset

func (m *OPServiceResult) Reset()

func (*OPServiceResult) String

func (m *OPServiceResult) String() string

func (*OPServiceResult) XXX_DiscardUnknown

func (m *OPServiceResult) XXX_DiscardUnknown()

func (*OPServiceResult) XXX_Marshal

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

func (*OPServiceResult) XXX_Merge

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

func (*OPServiceResult) XXX_Size

func (m *OPServiceResult) XXX_Size() int

func (*OPServiceResult) XXX_Unmarshal

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

type ProxyFuncServiceClient

type ProxyFuncServiceClient interface {
	// 透传分配请求
	Dispatch(ctx context.Context, in *ProxyRpcRequest, opts ...grpc.CallOption) (*ProxyRpcRespone, error)
}

ProxyFuncServiceClient is the client API for ProxyFuncService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewProxyFuncServiceClient

func NewProxyFuncServiceClient(cc *grpc.ClientConn) ProxyFuncServiceClient

type ProxyFuncServiceServer

type ProxyFuncServiceServer interface {
	// 透传分配请求
	Dispatch(context.Context, *ProxyRpcRequest) (*ProxyRpcRespone, error)
}

ProxyFuncServiceServer is the server API for ProxyFuncService service.

type ProxyRpcRequest

type ProxyRpcRequest struct {
	ServiceInfo          *ServicePointInfo `protobuf:"bytes,1,opt,name=serviceInfo,proto3" json:"serviceInfo,omitempty"`
	Rpcrequet            *RpcFuncRequest   `protobuf:"bytes,2,opt,name=rpcrequet,proto3" json:"rpcrequet,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

服务透传请求信息

func (*ProxyRpcRequest) Descriptor

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

func (*ProxyRpcRequest) GetRpcrequet

func (m *ProxyRpcRequest) GetRpcrequet() *RpcFuncRequest

func (*ProxyRpcRequest) GetServiceInfo

func (m *ProxyRpcRequest) GetServiceInfo() *ServicePointInfo

func (*ProxyRpcRequest) ProtoMessage

func (*ProxyRpcRequest) ProtoMessage()

func (*ProxyRpcRequest) Reset

func (m *ProxyRpcRequest) Reset()

func (*ProxyRpcRequest) String

func (m *ProxyRpcRequest) String() string

func (*ProxyRpcRequest) XXX_DiscardUnknown

func (m *ProxyRpcRequest) XXX_DiscardUnknown()

func (*ProxyRpcRequest) XXX_Marshal

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

func (*ProxyRpcRequest) XXX_Merge

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

func (*ProxyRpcRequest) XXX_Size

func (m *ProxyRpcRequest) XXX_Size() int

func (*ProxyRpcRequest) XXX_Unmarshal

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

type ProxyRpcRespone

type ProxyRpcRespone struct {
	ServiceInfo *ServicePointInfo `protobuf:"bytes,1,opt,name=serviceInfo,proto3" json:"serviceInfo,omitempty"`
	Rpcresponse *RpcFuncResponse  `protobuf:"bytes,2,opt,name=rpcresponse,proto3" json:"rpcresponse,omitempty"`
	// 概念和网络中的TTL类似,当请求包在众多代理proxy中透传时,经过一个代理层,该值就减一,如果减到0,就返回服务不可达错误信息
	Ttl                  *Ack     `protobuf:"bytes,3,opt,name=ttl,proto3" json:"ttl,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

服务透传请求信息

func (*ProxyRpcRespone) Descriptor

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

func (*ProxyRpcRespone) GetRpcresponse

func (m *ProxyRpcRespone) GetRpcresponse() *RpcFuncResponse

func (*ProxyRpcRespone) GetServiceInfo

func (m *ProxyRpcRespone) GetServiceInfo() *ServicePointInfo

func (*ProxyRpcRespone) GetTtl

func (m *ProxyRpcRespone) GetTtl() *Ack

func (*ProxyRpcRespone) ProtoMessage

func (*ProxyRpcRespone) ProtoMessage()

func (*ProxyRpcRespone) Reset

func (m *ProxyRpcRespone) Reset()

func (*ProxyRpcRespone) String

func (m *ProxyRpcRespone) String() string

func (*ProxyRpcRespone) XXX_DiscardUnknown

func (m *ProxyRpcRespone) XXX_DiscardUnknown()

func (*ProxyRpcRespone) XXX_Marshal

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

func (*ProxyRpcRespone) XXX_Merge

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

func (*ProxyRpcRespone) XXX_Size

func (m *ProxyRpcRespone) XXX_Size() int

func (*ProxyRpcRespone) XXX_Unmarshal

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

type RpcFuncHeader

type RpcFuncHeader struct {
	Key                  string   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Val                  string   `protobuf:"bytes,2,opt,name=val,proto3" json:"val,omitempty"`
	Domain               string   `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RpcFuncHeader) Descriptor

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

func (*RpcFuncHeader) GetDomain

func (m *RpcFuncHeader) GetDomain() string

func (*RpcFuncHeader) GetKey

func (m *RpcFuncHeader) GetKey() string

func (*RpcFuncHeader) GetVal

func (m *RpcFuncHeader) GetVal() string

func (*RpcFuncHeader) ProtoMessage

func (*RpcFuncHeader) ProtoMessage()

func (*RpcFuncHeader) Reset

func (m *RpcFuncHeader) Reset()

func (*RpcFuncHeader) String

func (m *RpcFuncHeader) String() string

func (*RpcFuncHeader) XXX_DiscardUnknown

func (m *RpcFuncHeader) XXX_DiscardUnknown()

func (*RpcFuncHeader) XXX_Marshal

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

func (*RpcFuncHeader) XXX_Merge

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

func (*RpcFuncHeader) XXX_Size

func (m *RpcFuncHeader) XXX_Size() int

func (*RpcFuncHeader) XXX_Unmarshal

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

type RpcFuncRequest

type RpcFuncRequest struct {
	// 调取的服务实例信息
	ServiceInfo *ServicePointInfo `protobuf:"bytes,1,opt,name=serviceInfo,proto3" json:"serviceInfo,omitempty"`
	// 请求id,用于在消息队列中去重和唯一(暂时还没考虑好生成方式的效率唯一性)
	RequestId uint64 `protobuf:"varint,2,opt,name=requestId,proto3" json:"requestId,omitempty"`
	// 功能函数id(在同一个服务中定义的唯一标识)
	FuncId uint32 `protobuf:"varint,3,opt,name=funcId,proto3" json:"funcId,omitempty"`
	// 请求头
	RequestHead map[string]*RpcFuncHeader `` /* 163-byte string literal not displayed */
	// 请求体
	RequestBody []byte `protobuf:"bytes,5,opt,name=requestBody,proto3" json:"requestBody,omitempty"`
	// 校验和,前16个字节是requestHead的校验和,后16个字节是requestBody的校验和
	Checksum uint32 `protobuf:"varint,6,opt,name=checksum,proto3" json:"checksum,omitempty"`
	// 服务调用授权方式和授权码
	Authorize            *ServiceAuth `protobuf:"bytes,7,opt,name=authorize,proto3" json:"authorize,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

统一 内部Rpc资源服务调用请求包,无论是调用哪台机器实例,还是那个具体的服务,都是可以识别此包的.

func (*RpcFuncRequest) Descriptor

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

func (*RpcFuncRequest) GetAuthorize

func (m *RpcFuncRequest) GetAuthorize() *ServiceAuth

func (*RpcFuncRequest) GetChecksum

func (m *RpcFuncRequest) GetChecksum() uint32

func (*RpcFuncRequest) GetFuncId

func (m *RpcFuncRequest) GetFuncId() uint32

func (*RpcFuncRequest) GetRequestBody

func (m *RpcFuncRequest) GetRequestBody() []byte

func (*RpcFuncRequest) GetRequestHead

func (m *RpcFuncRequest) GetRequestHead() map[string]*RpcFuncHeader

func (*RpcFuncRequest) GetRequestId

func (m *RpcFuncRequest) GetRequestId() uint64

func (*RpcFuncRequest) GetServiceInfo

func (m *RpcFuncRequest) GetServiceInfo() *ServicePointInfo

func (*RpcFuncRequest) ProtoMessage

func (*RpcFuncRequest) ProtoMessage()

func (*RpcFuncRequest) Reset

func (m *RpcFuncRequest) Reset()

func (*RpcFuncRequest) String

func (m *RpcFuncRequest) String() string

func (*RpcFuncRequest) XXX_DiscardUnknown

func (m *RpcFuncRequest) XXX_DiscardUnknown()

func (*RpcFuncRequest) XXX_Marshal

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

func (*RpcFuncRequest) XXX_Merge

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

func (*RpcFuncRequest) XXX_Size

func (m *RpcFuncRequest) XXX_Size() int

func (*RpcFuncRequest) XXX_Unmarshal

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

type RpcFuncResponse

type RpcFuncResponse struct {
	// 请求id,用于在消息队列中去重和唯一(暂时还没考虑好生成方式的效率唯一性)
	RequestId uint64 `protobuf:"varint,2,opt,name=requestId,proto3" json:"requestId,omitempty"`
	// 响应头
	ResponseHead map[string]*RpcFuncHeader `` /* 165-byte string literal not displayed */
	// 响应体
	ResponseBody []byte `protobuf:"bytes,5,opt,name=responseBody,proto3" json:"responseBody,omitempty"`
	// 校验和,前16个字节是responseHead的校验和,后16个字节是responseBody的校验和
	Checksum             uint32   `protobuf:"varint,6,opt,name=checksum,proto3" json:"checksum,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

统一内部Rpc 资源服务相应包

func (*RpcFuncResponse) Descriptor

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

func (*RpcFuncResponse) GetChecksum

func (m *RpcFuncResponse) GetChecksum() uint32

func (*RpcFuncResponse) GetRequestId

func (m *RpcFuncResponse) GetRequestId() uint64

func (*RpcFuncResponse) GetResponseBody

func (m *RpcFuncResponse) GetResponseBody() []byte

func (*RpcFuncResponse) GetResponseHead

func (m *RpcFuncResponse) GetResponseHead() map[string]*RpcFuncHeader

func (*RpcFuncResponse) ProtoMessage

func (*RpcFuncResponse) ProtoMessage()

func (*RpcFuncResponse) Reset

func (m *RpcFuncResponse) Reset()

func (*RpcFuncResponse) String

func (m *RpcFuncResponse) String() string

func (*RpcFuncResponse) XXX_DiscardUnknown

func (m *RpcFuncResponse) XXX_DiscardUnknown()

func (*RpcFuncResponse) XXX_Marshal

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

func (*RpcFuncResponse) XXX_Merge

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

func (*RpcFuncResponse) XXX_Size

func (m *RpcFuncResponse) XXX_Size() int

func (*RpcFuncResponse) XXX_Unmarshal

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

type ServiceAuth

type ServiceAuth struct {
	AuthType             ServiceAuth_AuthType `protobuf:"varint,1,opt,name=authType,proto3,enum=services.ServiceAuth_AuthType" json:"authType,omitempty"`
	AuthObj              []byte               `protobuf:"bytes,2,opt,name=authObj,proto3" json:"authObj,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*ServiceAuth) Descriptor

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

func (*ServiceAuth) GetAuthObj

func (m *ServiceAuth) GetAuthObj() []byte

func (*ServiceAuth) GetAuthType

func (m *ServiceAuth) GetAuthType() ServiceAuth_AuthType

func (*ServiceAuth) ProtoMessage

func (*ServiceAuth) ProtoMessage()

func (*ServiceAuth) Reset

func (m *ServiceAuth) Reset()

func (*ServiceAuth) String

func (m *ServiceAuth) String() string

func (*ServiceAuth) XXX_DiscardUnknown

func (m *ServiceAuth) XXX_DiscardUnknown()

func (*ServiceAuth) XXX_Marshal

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

func (*ServiceAuth) XXX_Merge

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

func (*ServiceAuth) XXX_Size

func (m *ServiceAuth) XXX_Size() int

func (*ServiceAuth) XXX_Unmarshal

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

type ServiceAuth_AuthType

type ServiceAuth_AuthType int32
const (
	ServiceAuth_basic       ServiceAuth_AuthType = 0
	ServiceAuth_code        ServiceAuth_AuthType = 1
	ServiceAuth_accessToken ServiceAuth_AuthType = 2
)

func (ServiceAuth_AuthType) EnumDescriptor

func (ServiceAuth_AuthType) EnumDescriptor() ([]byte, []int)

func (ServiceAuth_AuthType) String

func (x ServiceAuth_AuthType) String() string

type ServiceDetailInfo

type ServiceDetailInfo struct {
	// 可阅读名称
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// 服务一句话描述信息
	Describe string `protobuf:"bytes,2,opt,name=describe,proto3" json:"describe,omitempty"`
	// 服务备注信息
	Remark string `protobuf:"bytes,3,opt,name=remark,proto3" json:"remark,omitempty"`
	// 服务启动时间
	BootTime int64 `protobuf:"fixed64,4,opt,name=bootTime,proto3" json:"bootTime,omitempty"`
	// 服务启动随机数(每次启动的时候不一样)
	BootCode string `protobuf:"bytes,5,opt,name=bootCode,proto3" json:"bootCode,omitempty"`
	// 服务注册有效期(0代表永久, 大于0 代表时间到期后自动注销该服务,单位秒)
	ExpirySecend int32 `protobuf:"fixed32,6,opt,name=expirySecend,proto3" json:"expirySecend,omitempty"`
	// 服务保活有效期 ,这段时间内,没有任何链接请求的,将自动关闭该服务,(需要考虑服务监控进程不能在过期后在自动拉起), 适用场景比较少
	AliveSecend int32 `protobuf:"fixed32,7,opt,name=aliveSecend,proto3" json:"aliveSecend,omitempty"`
	// 会话并发请求限制量,向服务中心获取服务地址,算是一次session,一个session内调用多个函数只算一个会话并发,
	Connlimit            uint32            `protobuf:"varint,8,opt,name=connlimit,proto3" json:"connlimit,omitempty"`
	PointInfo            *ServicePointInfo `protobuf:"bytes,9,opt,name=pointInfo,proto3" json:"pointInfo,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

侧重服务的可视化描述信息

func (*ServiceDetailInfo) Descriptor

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

func (*ServiceDetailInfo) GetAliveSecend

func (m *ServiceDetailInfo) GetAliveSecend() int32

func (*ServiceDetailInfo) GetBootCode

func (m *ServiceDetailInfo) GetBootCode() string

func (*ServiceDetailInfo) GetBootTime

func (m *ServiceDetailInfo) GetBootTime() int64

func (*ServiceDetailInfo) GetConnlimit

func (m *ServiceDetailInfo) GetConnlimit() uint32

func (*ServiceDetailInfo) GetDescribe

func (m *ServiceDetailInfo) GetDescribe() string

func (*ServiceDetailInfo) GetExpirySecend

func (m *ServiceDetailInfo) GetExpirySecend() int32

func (*ServiceDetailInfo) GetName

func (m *ServiceDetailInfo) GetName() string

func (*ServiceDetailInfo) GetPointInfo

func (m *ServiceDetailInfo) GetPointInfo() *ServicePointInfo

func (*ServiceDetailInfo) GetRemark

func (m *ServiceDetailInfo) GetRemark() string

func (*ServiceDetailInfo) ProtoMessage

func (*ServiceDetailInfo) ProtoMessage()

func (*ServiceDetailInfo) Reset

func (m *ServiceDetailInfo) Reset()

func (*ServiceDetailInfo) String

func (m *ServiceDetailInfo) String() string

func (*ServiceDetailInfo) XXX_DiscardUnknown

func (m *ServiceDetailInfo) XXX_DiscardUnknown()

func (*ServiceDetailInfo) XXX_Marshal

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

func (*ServiceDetailInfo) XXX_Merge

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

func (*ServiceDetailInfo) XXX_Size

func (m *ServiceDetailInfo) XXX_Size() int

func (*ServiceDetailInfo) XXX_Unmarshal

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

type ServiceFunList

type ServiceFunList struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

模块功能列表

func (*ServiceFunList) Descriptor

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

func (*ServiceFunList) ProtoMessage

func (*ServiceFunList) ProtoMessage()

func (*ServiceFunList) Reset

func (m *ServiceFunList) Reset()

func (*ServiceFunList) String

func (m *ServiceFunList) String() string

func (*ServiceFunList) XXX_DiscardUnknown

func (m *ServiceFunList) XXX_DiscardUnknown()

func (*ServiceFunList) XXX_Marshal

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

func (*ServiceFunList) XXX_Merge

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

func (*ServiceFunList) XXX_Size

func (m *ServiceFunList) XXX_Size() int

func (*ServiceFunList) XXX_Unmarshal

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

type ServicePointInfo

type ServicePointInfo struct {
	// 服务id(相同版本的同一服务,但是不同实例,id是不一样的,服务在部署(第一次启动时)注册时生成的,每次重启不变.是有状态的.)
	ServiceId uint32 `protobuf:"fixed32,1,opt,name=serviceId,proto3" json:"serviceId,omitempty"`
	// 同一服务标识号,(无关版本和服务实例),在创建一个新服务时,全局统一分配唯一,用来标识一种服务.和部署的哪台服务器无关.
	// 服务固定唯一标识,当多个服务自动发现时,可以在一个网页上,看到相关服务资源和调取接口的方法说明,可以将自动发现到的服务,添加到系统中,并配置,serviceCode<->系统的serviceCode映射
	ServiceCode string `protobuf:"bytes,2,opt,name=serviceCode,proto3" json:"serviceCode,omitempty"`
	// 服务在系统发布时,每个版本自动+1,不可以在代码中手动指定,后面在实现服务调用者封装的时候,可以使用一些表达式来路由,服务接口的兼容版本 12<x<200 -> serverId, x>200 -> serviceId
	ServiceVersion uint32 `protobuf:"varint,3,opt,name=serviceVersion,proto3" json:"serviceVersion,omitempty"`
	// 服务地址类型,同一个服务id只能同时注册一个,但是同一服务id可以注册多个不同的链接方式.
	AddrType AddressType `protobuf:"varint,4,opt,name=addrType,proto3,enum=services.AddressType" json:"addrType,omitempty"`
	// 服务访问地址:
	// 1. unix: unix:///tmp/test.socket
	// 2. http://test.com/test
	// 3. tcp://10.10.10.1:3300
	Address              string       `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"`
	Authorized           *ServiceAuth `protobuf:"bytes,6,opt,name=authorized,proto3" json:"authorized,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

侧重于服务的调用,传输 类基本信息.

func (*ServicePointInfo) Descriptor

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

func (*ServicePointInfo) GetAddrType

func (m *ServicePointInfo) GetAddrType() AddressType

func (*ServicePointInfo) GetAddress

func (m *ServicePointInfo) GetAddress() string

func (*ServicePointInfo) GetAuthorized

func (m *ServicePointInfo) GetAuthorized() *ServiceAuth

func (*ServicePointInfo) GetServiceCode

func (m *ServicePointInfo) GetServiceCode() string

func (*ServicePointInfo) GetServiceId

func (m *ServicePointInfo) GetServiceId() uint32

func (*ServicePointInfo) GetServiceVersion

func (m *ServicePointInfo) GetServiceVersion() uint32

func (*ServicePointInfo) ProtoMessage

func (*ServicePointInfo) ProtoMessage()

func (*ServicePointInfo) Reset

func (m *ServicePointInfo) Reset()

func (*ServicePointInfo) String

func (m *ServicePointInfo) String() string

func (*ServicePointInfo) XXX_DiscardUnknown

func (m *ServicePointInfo) XXX_DiscardUnknown()

func (*ServicePointInfo) XXX_Marshal

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

func (*ServicePointInfo) XXX_Merge

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

func (*ServicePointInfo) XXX_Size

func (m *ServicePointInfo) XXX_Size() int

func (*ServicePointInfo) XXX_Unmarshal

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

type ServiceRegisterServiceClient

type ServiceRegisterServiceClient interface {
	// funcService 控制(1.Register | 2.UnRegister | 3.Stop | 4.Terminal | 5.Pause | 6.Start | 7.Search )
	SetupService(ctx context.Context, in *OPServiceRequest, opts ...grpc.CallOption) (*OPServiceResponse, error)
}

ServiceRegisterServiceClient is the client API for ServiceRegisterService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewServiceRegisterServiceClient

func NewServiceRegisterServiceClient(cc *grpc.ClientConn) ServiceRegisterServiceClient

type ServiceRegisterServiceServer

type ServiceRegisterServiceServer interface {
	// funcService 控制(1.Register | 2.UnRegister | 3.Stop | 4.Terminal | 5.Pause | 6.Start | 7.Search )
	SetupService(context.Context, *OPServiceRequest) (*OPServiceResponse, error)
}

ServiceRegisterServiceServer is the server API for ServiceRegisterService service.

type ServiceStatus

type ServiceStatus struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ServiceStatus) Descriptor

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

func (*ServiceStatus) ProtoMessage

func (*ServiceStatus) ProtoMessage()

func (*ServiceStatus) Reset

func (m *ServiceStatus) Reset()

func (*ServiceStatus) String

func (m *ServiceStatus) String() string

func (*ServiceStatus) XXX_DiscardUnknown

func (m *ServiceStatus) XXX_DiscardUnknown()

func (*ServiceStatus) XXX_Marshal

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

func (*ServiceStatus) XXX_Merge

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

func (*ServiceStatus) XXX_Size

func (m *ServiceStatus) XXX_Size() int

func (*ServiceStatus) XXX_Unmarshal

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

type UnimplementedFuncServiceServer

type UnimplementedFuncServiceServer struct {
}

UnimplementedFuncServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedFuncServiceServer) Ack

func (*UnimplementedFuncServiceServer) FuncInvoker

func (*UnimplementedFuncServiceServer) GetServiceFunList

func (*UnimplementedFuncServiceServer) GetServiceStatus

type UnimplementedHelloServiceServer

type UnimplementedHelloServiceServer struct {
}

UnimplementedHelloServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedHelloServiceServer) Hello

type UnimplementedProxyFuncServiceServer

type UnimplementedProxyFuncServiceServer struct {
}

UnimplementedProxyFuncServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedProxyFuncServiceServer) Dispatch

type UnimplementedServiceRegisterServiceServer

type UnimplementedServiceRegisterServiceServer struct {
}

UnimplementedServiceRegisterServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedServiceRegisterServiceServer) SetupService

Jump to

Keyboard shortcuts

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