synerex_api

package module
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: Apache-2.0 Imports: 11 Imported by: 12

README

synerex_api

Protocol Description for Synerex

Synerex is a demand/supply exchange platform for supporting smart environment.

update history

Since synerex v0.5.0 we add SelectModified{Supply/Demand} Since synerex v0.4.0 we update mbus specification.

Synerex Protocol

4 types of messages. Demand Supply Target Mbus MbusMsg MbusOpt MbusState


Synerex API: rpc NotifyDemand(Demand) returns (Response) {} rpc NotifySupply(Supply) returns (Response) {} rpc ProposeDemand(Demand) returns (Response) {} rpc ProposeSupply(Supply) returns (Response) {} rpc SelectSupply(Target) returns (ConfirmResponse) {} rpc SelectModifiedSupply(Supply) returns (ConfirmResponse) {} rpc SelectDemand(Target) returns (ConfirmResponse) {} rpc SelectModifiedDemand(Demand) returns (ConfirmResponse) {} rpc Confirm(Target) returns (Response){} rpc SubscribeDemand(Channel) returns (stream Demand) {} rpc SubscribeSupply(Channel) returns (stream Supply) {}

Mbus is a selectable message bus for specific members. rpc SubscribeMbus(Mbus) returns (stream MbusMsg) {} rpc SendMsg(MbusMsg) returns (Response){} rpc CloseMbus(Mbus) returns (Response){}

To create new Mbus, we can ask to create new MbusID for Synerex Server (since v0.4.0) rpc CreateMbus(MbsOpt) returns (Mbus){} rpc GetMbusState(Mbus) returns (MBusState){}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GatewayType_name = map[int32]string{
		0: "BIDIRECTIONAL",
		1: "WRITE_ONLY",
		2: "READ_ONLY",
	}
	GatewayType_value = map[string]int32{
		"BIDIRECTIONAL": 0,
		"WRITE_ONLY":    1,
		"READ_ONLY":     2,
	}
)

Enum value maps for GatewayType.

View Source
var (
	MsgType_name = map[int32]string{
		0: "DEMAND",
		1: "SUPPLY",
		2: "TARGET",
		3: "MBUS",
		4: "MBUSMSG",
	}
	MsgType_value = map[string]int32{
		"DEMAND":  0,
		"SUPPLY":  1,
		"TARGET":  2,
		"MBUS":    3,
		"MBUSMSG": 4,
	}
)

Enum value maps for MsgType.

View Source
var (
	MbusOpt_MbusType_name = map[int32]string{
		0: "PUBLIC",
		1: "PRIVATE",
	}
	MbusOpt_MbusType_value = map[string]int32{
		"PUBLIC":  0,
		"PRIVATE": 1,
	}
)

Enum value maps for MbusOpt_MbusType.

View Source
var (
	MbusState_MbusStatus_name = map[int32]string{
		0: "INTIALIZED",
		1: "SUBSCRIBERS",
		2: "CLOSED",
		3: "INVALID",
	}
	MbusState_MbusStatus_value = map[string]int32{
		"INTIALIZED":  0,
		"SUBSCRIBERS": 1,
		"CLOSED":      2,
		"INVALID":     3,
	}
)

Enum value maps for MbusState_MbusStatus.

View Source
var File_synerex_proto protoreflect.FileDescriptor

Functions

func RegisterSynerexServer

func RegisterSynerexServer(s *grpc.Server, srv SynerexServer)

Types

type Channel

type Channel struct {
	ClientId    uint64 `protobuf:"fixed64,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	ChannelType uint32 `protobuf:"varint,2,opt,name=channel_type,json=channelType,proto3" json:"channel_type,omitempty"` // channel type
	ArgJson     string `protobuf:"bytes,3,opt,name=arg_json,json=argJson,proto3" json:"arg_json,omitempty"`              // for Channel Argument
	// contains filtered or unexported fields
}

func (*Channel) Descriptor deprecated

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

Deprecated: Use Channel.ProtoReflect.Descriptor instead.

func (*Channel) GetArgJson

func (x *Channel) GetArgJson() string

func (*Channel) GetChannelType

func (x *Channel) GetChannelType() uint32

func (*Channel) GetClientId

func (x *Channel) GetClientId() uint64

func (*Channel) ProtoMessage

func (*Channel) ProtoMessage()

func (*Channel) ProtoReflect added in v0.4.0

func (x *Channel) ProtoReflect() protoreflect.Message

func (*Channel) Reset

func (x *Channel) Reset()

func (*Channel) String

func (x *Channel) String() string

type ConfirmResponse

type ConfirmResponse struct {
	Ok     bool                 `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	MbusId uint64               `protobuf:"fixed64,2,opt,name=mbus_id,json=mbusId,proto3" json:"mbus_id,omitempty"`
	Wait   *durationpb.Duration `protobuf:"bytes,3,opt,name=wait,proto3" json:"wait,omitempty"`
	Err    string               `protobuf:"bytes,4,opt,name=err,proto3" json:"err,omitempty"`
	// contains filtered or unexported fields
}

func (*ConfirmResponse) Descriptor deprecated

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

Deprecated: Use ConfirmResponse.ProtoReflect.Descriptor instead.

func (*ConfirmResponse) GetErr

func (x *ConfirmResponse) GetErr() string

func (*ConfirmResponse) GetMbusId

func (x *ConfirmResponse) GetMbusId() uint64

func (*ConfirmResponse) GetOk

func (x *ConfirmResponse) GetOk() bool

func (*ConfirmResponse) GetWait

func (x *ConfirmResponse) GetWait() *durationpb.Duration

func (*ConfirmResponse) ProtoMessage

func (*ConfirmResponse) ProtoMessage()

func (*ConfirmResponse) ProtoReflect added in v0.4.0

func (x *ConfirmResponse) ProtoReflect() protoreflect.Message

func (*ConfirmResponse) Reset

func (x *ConfirmResponse) Reset()

func (*ConfirmResponse) String

func (x *ConfirmResponse) String() string

type Content

type Content struct {
	Entity []byte `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"`
	// contains filtered or unexported fields
}

func (*Content) Descriptor deprecated

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

Deprecated: Use Content.ProtoReflect.Descriptor instead.

func (*Content) GetEntity

func (x *Content) GetEntity() []byte

func (*Content) ProtoMessage

func (*Content) ProtoMessage()

func (*Content) ProtoReflect added in v0.4.0

func (x *Content) ProtoReflect() protoreflect.Message

func (*Content) Reset

func (x *Content) Reset()

func (*Content) String

func (x *Content) String() string

type Demand

type Demand struct {
	Id          uint64                 `protobuf:"fixed64,1,opt,name=id,proto3" json:"id,omitempty"`
	SenderId    uint64                 `protobuf:"fixed64,2,opt,name=sender_id,json=senderId,proto3" json:"sender_id,omitempty"`
	TargetId    uint64                 `protobuf:"fixed64,3,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"`         // if set with message id (not for sender_id) (select for supply)
	ChannelType uint32                 `protobuf:"varint,4,opt,name=channel_type,json=channelType,proto3" json:"channel_type,omitempty"` // channel type
	DemandName  string                 `protobuf:"bytes,5,opt,name=demand_name,json=demandName,proto3" json:"demand_name,omitempty"`
	Ts          *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=ts,proto3" json:"ts,omitempty"`
	ArgJson     string                 `protobuf:"bytes,7,opt,name=arg_json,json=argJson,proto3" json:"arg_json,omitempty"`
	MbusId      uint64                 `protobuf:"fixed64,8,opt,name=mbus_id,json=mbusId,proto3" json:"mbus_id,omitempty"` // new mbus id for select supply...
	Cdata       *Content               `protobuf:"bytes,9,opt,name=cdata,proto3" json:"cdata,omitempty"`                   // content data
	// contains filtered or unexported fields
}

func (*Demand) Descriptor deprecated

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

Deprecated: Use Demand.ProtoReflect.Descriptor instead.

func (*Demand) GetArgJson

func (x *Demand) GetArgJson() string

func (*Demand) GetCdata

func (x *Demand) GetCdata() *Content

func (*Demand) GetChannelType

func (x *Demand) GetChannelType() uint32

func (*Demand) GetDemandName

func (x *Demand) GetDemandName() string

func (*Demand) GetId

func (x *Demand) GetId() uint64

func (*Demand) GetMbusId

func (x *Demand) GetMbusId() uint64

func (*Demand) GetSenderId

func (x *Demand) GetSenderId() uint64

func (*Demand) GetTargetId

func (x *Demand) GetTargetId() uint64

func (*Demand) GetTs

func (x *Demand) GetTs() *timestamppb.Timestamp

func (*Demand) ProtoMessage

func (*Demand) ProtoMessage()

func (*Demand) ProtoReflect added in v0.4.0

func (x *Demand) ProtoReflect() protoreflect.Message

func (*Demand) Reset

func (x *Demand) Reset()

func (*Demand) String

func (x *Demand) String() string

type GatewayInfo added in v0.1.1

type GatewayInfo struct {
	ClientId    uint64      `protobuf:"fixed64,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` // client_id (snowflake) of gateway
	GatewayType GatewayType `protobuf:"varint,2,opt,name=gateway_type,json=gatewayType,proto3,enum=api.GatewayType" json:"gateway_type,omitempty"`
	Channels    []uint32    `protobuf:"varint,3,rep,packed,name=channels,proto3" json:"channels,omitempty"` // which channel for forward
	// contains filtered or unexported fields
}

func (*GatewayInfo) Descriptor deprecated added in v0.1.1

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

Deprecated: Use GatewayInfo.ProtoReflect.Descriptor instead.

func (*GatewayInfo) GetChannels added in v0.2.1

func (x *GatewayInfo) GetChannels() []uint32

func (*GatewayInfo) GetClientId added in v0.2.1

func (x *GatewayInfo) GetClientId() uint64

func (*GatewayInfo) GetGatewayType added in v0.1.1

func (x *GatewayInfo) GetGatewayType() GatewayType

func (*GatewayInfo) ProtoMessage added in v0.1.1

func (*GatewayInfo) ProtoMessage()

func (*GatewayInfo) ProtoReflect added in v0.4.0

func (x *GatewayInfo) ProtoReflect() protoreflect.Message

func (*GatewayInfo) Reset added in v0.1.1

func (x *GatewayInfo) Reset()

func (*GatewayInfo) String added in v0.1.1

func (x *GatewayInfo) String() string

type GatewayMsg added in v0.1.1

type GatewayMsg struct {
	SrcSynerexId uint64  `protobuf:"fixed64,1,opt,name=src_synerex_id,json=srcSynerexId,proto3" json:"src_synerex_id,omitempty"`
	MsgType      MsgType `protobuf:"varint,2,opt,name=msg_type,json=msgType,proto3,enum=api.MsgType" json:"msg_type,omitempty"` // massage type
	// Types that are assignable to MsgOneof:
	//	*GatewayMsg_Demand
	//	*GatewayMsg_Supply
	//	*GatewayMsg_Target
	//	*GatewayMsg_Mbus
	//	*GatewayMsg_MbusMsg
	MsgOneof isGatewayMsg_MsgOneof `protobuf_oneof:"msg_oneof"`
	// contains filtered or unexported fields
}

Subscribe from Gateway to SynerexServer

func (*GatewayMsg) Descriptor deprecated added in v0.1.1

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

Deprecated: Use GatewayMsg.ProtoReflect.Descriptor instead.

func (*GatewayMsg) GetDemand added in v0.1.1

func (x *GatewayMsg) GetDemand() *Demand

func (*GatewayMsg) GetMbus added in v0.1.1

func (x *GatewayMsg) GetMbus() *Mbus

func (*GatewayMsg) GetMbusMsg added in v0.1.1

func (x *GatewayMsg) GetMbusMsg() *MbusMsg

func (*GatewayMsg) GetMsgOneof added in v0.1.1

func (m *GatewayMsg) GetMsgOneof() isGatewayMsg_MsgOneof

func (*GatewayMsg) GetMsgType added in v0.1.1

func (x *GatewayMsg) GetMsgType() MsgType

func (*GatewayMsg) GetSrcSynerexId added in v0.1.1

func (x *GatewayMsg) GetSrcSynerexId() uint64

func (*GatewayMsg) GetSupply added in v0.1.1

func (x *GatewayMsg) GetSupply() *Supply

func (*GatewayMsg) GetTarget added in v0.1.1

func (x *GatewayMsg) GetTarget() *Target

func (*GatewayMsg) ProtoMessage added in v0.1.1

func (*GatewayMsg) ProtoMessage()

func (*GatewayMsg) ProtoReflect added in v0.4.0

func (x *GatewayMsg) ProtoReflect() protoreflect.Message

func (*GatewayMsg) Reset added in v0.1.1

func (x *GatewayMsg) Reset()

func (*GatewayMsg) String added in v0.1.1

func (x *GatewayMsg) String() string

type GatewayMsg_Demand added in v0.1.1

type GatewayMsg_Demand struct {
	Demand *Demand `protobuf:"bytes,3,opt,name=demand,proto3,oneof"`
}

type GatewayMsg_Mbus added in v0.1.1

type GatewayMsg_Mbus struct {
	Mbus *Mbus `protobuf:"bytes,6,opt,name=mbus,proto3,oneof"`
}

type GatewayMsg_MbusMsg added in v0.1.1

type GatewayMsg_MbusMsg struct {
	MbusMsg *MbusMsg `protobuf:"bytes,7,opt,name=mbus_msg,json=mbusMsg,proto3,oneof"`
}

type GatewayMsg_Supply added in v0.1.1

type GatewayMsg_Supply struct {
	Supply *Supply `protobuf:"bytes,4,opt,name=supply,proto3,oneof"`
}

type GatewayMsg_Target added in v0.1.1

type GatewayMsg_Target struct {
	Target *Target `protobuf:"bytes,5,opt,name=target,proto3,oneof"`
}

type GatewayType added in v0.1.1

type GatewayType int32
const (
	GatewayType_BIDIRECTIONAL GatewayType = 0 // normal gateway
	GatewayType_WRITE_ONLY    GatewayType = 1 // no need to receive
	GatewayType_READ_ONLY     GatewayType = 2 //
)

func (GatewayType) Descriptor added in v0.4.0

func (GatewayType) Enum added in v0.4.0

func (x GatewayType) Enum() *GatewayType

func (GatewayType) EnumDescriptor deprecated added in v0.1.1

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

Deprecated: Use GatewayType.Descriptor instead.

func (GatewayType) Number added in v0.4.0

func (x GatewayType) Number() protoreflect.EnumNumber

func (GatewayType) String added in v0.1.1

func (x GatewayType) String() string

func (GatewayType) Type added in v0.4.0

type Mbus

type Mbus struct {
	ClientId uint64 `protobuf:"fixed64,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	MbusId   uint64 `protobuf:"fixed64,2,opt,name=mbus_id,json=mbusId,proto3" json:"mbus_id,omitempty"`
	ArgJson  string `protobuf:"bytes,3,opt,name=arg_json,json=argJson,proto3" json:"arg_json,omitempty"` // for mbus description
	// contains filtered or unexported fields
}

func (*Mbus) Descriptor deprecated

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

Deprecated: Use Mbus.ProtoReflect.Descriptor instead.

func (*Mbus) GetArgJson

func (x *Mbus) GetArgJson() string

func (*Mbus) GetClientId

func (x *Mbus) GetClientId() uint64

func (*Mbus) GetMbusId

func (x *Mbus) GetMbusId() uint64

func (*Mbus) ProtoMessage

func (*Mbus) ProtoMessage()

func (*Mbus) ProtoReflect added in v0.4.0

func (x *Mbus) ProtoReflect() protoreflect.Message

func (*Mbus) Reset

func (x *Mbus) Reset()

func (*Mbus) String

func (x *Mbus) String() string

type MbusMsg

type MbusMsg struct {
	MsgId    uint64   `protobuf:"fixed64,1,opt,name=msg_id,json=msgId,proto3" json:"msg_id,omitempty"` // if 0 for close message
	SenderId uint64   `protobuf:"fixed64,2,opt,name=sender_id,json=senderId,proto3" json:"sender_id,omitempty"`
	TargetId uint64   `protobuf:"fixed64,3,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` // for target // if 0 for broadcast in mbus
	MbusId   uint64   `protobuf:"fixed64,4,opt,name=mbus_id,json=mbusId,proto3" json:"mbus_id,omitempty"`
	MsgType  uint32   `protobuf:"varint,5,opt,name=msg_type,json=msgType,proto3" json:"msg_type,omitempty"` // for message type
	MsgInfo  string   `protobuf:"bytes,6,opt,name=msg_info,json=msgInfo,proto3" json:"msg_info,omitempty"`  // for abstract information
	ArgJson  string   `protobuf:"bytes,7,opt,name=arg_json,json=argJson,proto3" json:"arg_json,omitempty"`
	Cdata    *Content `protobuf:"bytes,8,opt,name=cdata,proto3" json:"cdata,omitempty"` // content data (enbedded from v0.4.0)
	// contains filtered or unexported fields
}

func (*MbusMsg) Descriptor deprecated

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

Deprecated: Use MbusMsg.ProtoReflect.Descriptor instead.

func (*MbusMsg) GetArgJson

func (x *MbusMsg) GetArgJson() string

func (*MbusMsg) GetCdata added in v0.4.0

func (x *MbusMsg) GetCdata() *Content

func (*MbusMsg) GetMbusId

func (x *MbusMsg) GetMbusId() uint64

func (*MbusMsg) GetMsgId

func (x *MbusMsg) GetMsgId() uint64

func (*MbusMsg) GetMsgInfo

func (x *MbusMsg) GetMsgInfo() string

func (*MbusMsg) GetMsgType

func (x *MbusMsg) GetMsgType() uint32

func (*MbusMsg) GetSenderId

func (x *MbusMsg) GetSenderId() uint64

func (*MbusMsg) GetTargetId

func (x *MbusMsg) GetTargetId() uint64

func (*MbusMsg) ProtoMessage

func (*MbusMsg) ProtoMessage()

func (*MbusMsg) ProtoReflect added in v0.4.0

func (x *MbusMsg) ProtoReflect() protoreflect.Message

func (*MbusMsg) Reset

func (x *MbusMsg) Reset()

func (*MbusMsg) String

func (x *MbusMsg) String() string

type MbusOpt added in v0.4.0

type MbusOpt struct {
	MbusType    MbusOpt_MbusType `protobuf:"varint,1,opt,name=mbus_type,json=mbusType,proto3,enum=api.MbusOpt_MbusType" json:"mbus_type,omitempty"`
	Subscribers []uint64         `protobuf:"fixed64,2,rep,packed,name=subscribers,proto3" json:"subscribers,omitempty"` // use this for limiting subscribers
	// contains filtered or unexported fields
}

options for creating Mbus from v0.4.0

func (*MbusOpt) Descriptor deprecated added in v0.4.0

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

Deprecated: Use MbusOpt.ProtoReflect.Descriptor instead.

func (*MbusOpt) GetMbusType added in v0.4.0

func (x *MbusOpt) GetMbusType() MbusOpt_MbusType

func (*MbusOpt) GetSubscribers added in v0.4.0

func (x *MbusOpt) GetSubscribers() []uint64

func (*MbusOpt) ProtoMessage added in v0.4.0

func (*MbusOpt) ProtoMessage()

func (*MbusOpt) ProtoReflect added in v0.4.0

func (x *MbusOpt) ProtoReflect() protoreflect.Message

func (*MbusOpt) Reset added in v0.4.0

func (x *MbusOpt) Reset()

func (*MbusOpt) String added in v0.4.0

func (x *MbusOpt) String() string

type MbusOpt_MbusType added in v0.4.0

type MbusOpt_MbusType int32
const (
	MbusOpt_PUBLIC  MbusOpt_MbusType = 0
	MbusOpt_PRIVATE MbusOpt_MbusType = 1
)

func (MbusOpt_MbusType) Descriptor added in v0.4.0

func (MbusOpt_MbusType) Enum added in v0.4.0

func (MbusOpt_MbusType) EnumDescriptor deprecated added in v0.4.0

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

Deprecated: Use MbusOpt_MbusType.Descriptor instead.

func (MbusOpt_MbusType) Number added in v0.4.0

func (MbusOpt_MbusType) String added in v0.4.0

func (x MbusOpt_MbusType) String() string

func (MbusOpt_MbusType) Type added in v0.4.0

type MbusState added in v0.4.0

type MbusState struct {
	MbusId      uint64               `protobuf:"fixed64,1,opt,name=mbus_id,json=mbusId,proto3" json:"mbus_id,omitempty"`
	Status      MbusState_MbusStatus `protobuf:"varint,2,opt,name=status,proto3,enum=api.MbusState_MbusStatus" json:"status,omitempty"`
	Subscribers []uint64             `protobuf:"fixed64,3,rep,packed,name=subscribers,proto3" json:"subscribers,omitempty"` // subscriber count  (only with status= SUBSCRIBERS)
	// contains filtered or unexported fields
}

message for obtaining mbus state from 0.4.0

func (*MbusState) Descriptor deprecated added in v0.4.0

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

Deprecated: Use MbusState.ProtoReflect.Descriptor instead.

func (*MbusState) GetMbusId added in v0.4.0

func (x *MbusState) GetMbusId() uint64

func (*MbusState) GetStatus added in v0.4.0

func (x *MbusState) GetStatus() MbusState_MbusStatus

func (*MbusState) GetSubscribers added in v0.4.0

func (x *MbusState) GetSubscribers() []uint64

func (*MbusState) ProtoMessage added in v0.4.0

func (*MbusState) ProtoMessage()

func (*MbusState) ProtoReflect added in v0.4.0

func (x *MbusState) ProtoReflect() protoreflect.Message

func (*MbusState) Reset added in v0.4.0

func (x *MbusState) Reset()

func (*MbusState) String added in v0.4.0

func (x *MbusState) String() string

type MbusState_MbusStatus added in v0.4.0

type MbusState_MbusStatus int32
const (
	MbusState_INTIALIZED  MbusState_MbusStatus = 0 // just created (no subscribers)
	MbusState_SUBSCRIBERS MbusState_MbusStatus = 1 // there are some subscribers
	MbusState_CLOSED      MbusState_MbusStatus = 2 // closed mbus
	MbusState_INVALID     MbusState_MbusStatus = 3 // no mbus is available with the mbus_id or hidden.
)

func (MbusState_MbusStatus) Descriptor added in v0.4.0

func (MbusState_MbusStatus) Enum added in v0.4.0

func (MbusState_MbusStatus) EnumDescriptor deprecated added in v0.4.0

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

Deprecated: Use MbusState_MbusStatus.Descriptor instead.

func (MbusState_MbusStatus) Number added in v0.4.0

func (MbusState_MbusStatus) String added in v0.4.0

func (x MbusState_MbusStatus) String() string

func (MbusState_MbusStatus) Type added in v0.4.0

type MsgType added in v0.1.1

type MsgType int32
const (
	MsgType_DEMAND  MsgType = 0
	MsgType_SUPPLY  MsgType = 1
	MsgType_TARGET  MsgType = 2 // target for select/confirm
	MsgType_MBUS    MsgType = 3 // mbus id for subscribe
	MsgType_MBUSMSG MsgType = 4
)

func (MsgType) Descriptor added in v0.4.0

func (MsgType) Descriptor() protoreflect.EnumDescriptor

func (MsgType) Enum added in v0.4.0

func (x MsgType) Enum() *MsgType

func (MsgType) EnumDescriptor deprecated added in v0.1.1

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

Deprecated: Use MsgType.Descriptor instead.

func (MsgType) Number added in v0.4.0

func (x MsgType) Number() protoreflect.EnumNumber

func (MsgType) String added in v0.1.1

func (x MsgType) String() string

func (MsgType) Type added in v0.4.0

func (MsgType) Type() protoreflect.EnumType

type ProviderID added in v0.3.1

type ProviderID struct {
	ClientId uint64 `protobuf:"fixed64,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	ArgJson  string `protobuf:"bytes,3,opt,name=arg_json,json=argJson,proto3" json:"arg_json,omitempty"` // for Any Argument
	// contains filtered or unexported fields
}

func (*ProviderID) Descriptor deprecated added in v0.3.1

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

Deprecated: Use ProviderID.ProtoReflect.Descriptor instead.

func (*ProviderID) GetArgJson added in v0.3.1

func (x *ProviderID) GetArgJson() string

func (*ProviderID) GetClientId added in v0.3.1

func (x *ProviderID) GetClientId() uint64

func (*ProviderID) ProtoMessage added in v0.3.1

func (*ProviderID) ProtoMessage()

func (*ProviderID) ProtoReflect added in v0.4.0

func (x *ProviderID) ProtoReflect() protoreflect.Message

func (*ProviderID) Reset added in v0.3.1

func (x *ProviderID) Reset()

func (*ProviderID) String added in v0.3.1

func (x *ProviderID) String() string

type Response

type Response struct {
	Ok  bool   `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	Err string `protobuf:"bytes,2,opt,name=err,proto3" json:"err,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetErr

func (x *Response) GetErr() string

func (*Response) GetOk

func (x *Response) GetOk() bool

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect added in v0.4.0

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type Supply

type Supply struct {
	Id          uint64                 `protobuf:"fixed64,1,opt,name=id,proto3" json:"id,omitempty"`
	SenderId    uint64                 `protobuf:"fixed64,2,opt,name=sender_id,json=senderId,proto3" json:"sender_id,omitempty"`
	TargetId    uint64                 `protobuf:"fixed64,3,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"`         // for message id (not for sender_id)
	ChannelType uint32                 `protobuf:"varint,4,opt,name=channel_type,json=channelType,proto3" json:"channel_type,omitempty"` // channel type
	SupplyName  string                 `protobuf:"bytes,5,opt,name=supply_name,json=supplyName,proto3" json:"supply_name,omitempty"`
	Ts          *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=ts,proto3" json:"ts,omitempty"`
	ArgJson     string                 `protobuf:"bytes,7,opt,name=arg_json,json=argJson,proto3" json:"arg_json,omitempty"`
	MbusId      uint64                 `protobuf:"fixed64,8,opt,name=mbus_id,json=mbusId,proto3" json:"mbus_id,omitempty"` // new mbus id for select demand.
	Cdata       *Content               `protobuf:"bytes,9,opt,name=cdata,proto3" json:"cdata,omitempty"`                   // content data
	// contains filtered or unexported fields
}

func (*Supply) Descriptor deprecated

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

Deprecated: Use Supply.ProtoReflect.Descriptor instead.

func (*Supply) GetArgJson

func (x *Supply) GetArgJson() string

func (*Supply) GetCdata

func (x *Supply) GetCdata() *Content

func (*Supply) GetChannelType

func (x *Supply) GetChannelType() uint32

func (*Supply) GetId

func (x *Supply) GetId() uint64

func (*Supply) GetMbusId

func (x *Supply) GetMbusId() uint64

func (*Supply) GetSenderId

func (x *Supply) GetSenderId() uint64

func (*Supply) GetSupplyName

func (x *Supply) GetSupplyName() string

func (*Supply) GetTargetId

func (x *Supply) GetTargetId() uint64

func (*Supply) GetTs

func (x *Supply) GetTs() *timestamppb.Timestamp

func (*Supply) ProtoMessage

func (*Supply) ProtoMessage()

func (*Supply) ProtoReflect added in v0.4.0

func (x *Supply) ProtoReflect() protoreflect.Message

func (*Supply) Reset

func (x *Supply) Reset()

func (*Supply) String

func (x *Supply) String() string

type SynerexClient

type SynerexClient interface {
	NotifyDemand(ctx context.Context, in *Demand, opts ...grpc.CallOption) (*Response, error)
	NotifySupply(ctx context.Context, in *Supply, opts ...grpc.CallOption) (*Response, error)
	ProposeDemand(ctx context.Context, in *Demand, opts ...grpc.CallOption) (*Response, error)
	ProposeSupply(ctx context.Context, in *Supply, opts ...grpc.CallOption) (*Response, error)
	SelectSupply(ctx context.Context, in *Target, opts ...grpc.CallOption) (*ConfirmResponse, error)
	SelectModifiedSupply(ctx context.Context, in *Supply, opts ...grpc.CallOption) (*ConfirmResponse, error)
	SelectDemand(ctx context.Context, in *Target, opts ...grpc.CallOption) (*ConfirmResponse, error)
	//    rpc SelectModifiedDemand(Demand) returns (ConfirmResponse) {} // select with modification(since 0.5.1)
	Confirm(ctx context.Context, in *Target, opts ...grpc.CallOption) (*Response, error)
	SubscribeDemand(ctx context.Context, in *Channel, opts ...grpc.CallOption) (Synerex_SubscribeDemandClient, error)
	SubscribeSupply(ctx context.Context, in *Channel, opts ...grpc.CallOption) (Synerex_SubscribeSupplyClient, error)
	CreateMbus(ctx context.Context, in *MbusOpt, opts ...grpc.CallOption) (*Mbus, error)
	CloseMbus(ctx context.Context, in *Mbus, opts ...grpc.CallOption) (*Response, error)
	SubscribeMbus(ctx context.Context, in *Mbus, opts ...grpc.CallOption) (Synerex_SubscribeMbusClient, error)
	SendMbusMsg(ctx context.Context, in *MbusMsg, opts ...grpc.CallOption) (*Response, error)
	GetMbusState(ctx context.Context, in *Mbus, opts ...grpc.CallOption) (*MbusState, error)
	SubscribeGateway(ctx context.Context, in *GatewayInfo, opts ...grpc.CallOption) (Synerex_SubscribeGatewayClient, error)
	ForwardToGateway(ctx context.Context, in *GatewayMsg, opts ...grpc.CallOption) (*Response, error)
	CloseDemandChannel(ctx context.Context, in *Channel, opts ...grpc.CallOption) (*Response, error)
	CloseSupplyChannel(ctx context.Context, in *Channel, opts ...grpc.CallOption) (*Response, error)
	CloseAllChannels(ctx context.Context, in *ProviderID, opts ...grpc.CallOption) (*Response, error)
}

SynerexClient is the client API for Synerex service.

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

func NewSynerexClient

func NewSynerexClient(cc grpc.ClientConnInterface) SynerexClient

type SynerexServer

type SynerexServer interface {
	NotifyDemand(context.Context, *Demand) (*Response, error)
	NotifySupply(context.Context, *Supply) (*Response, error)
	ProposeDemand(context.Context, *Demand) (*Response, error)
	ProposeSupply(context.Context, *Supply) (*Response, error)
	SelectSupply(context.Context, *Target) (*ConfirmResponse, error)
	SelectModifiedSupply(context.Context, *Supply) (*ConfirmResponse, error)
	SelectDemand(context.Context, *Target) (*ConfirmResponse, error)
	//    rpc SelectModifiedDemand(Demand) returns (ConfirmResponse) {} // select with modification(since 0.5.1)
	Confirm(context.Context, *Target) (*Response, error)
	SubscribeDemand(*Channel, Synerex_SubscribeDemandServer) error
	SubscribeSupply(*Channel, Synerex_SubscribeSupplyServer) error
	CreateMbus(context.Context, *MbusOpt) (*Mbus, error)
	CloseMbus(context.Context, *Mbus) (*Response, error)
	SubscribeMbus(*Mbus, Synerex_SubscribeMbusServer) error
	SendMbusMsg(context.Context, *MbusMsg) (*Response, error)
	GetMbusState(context.Context, *Mbus) (*MbusState, error)
	SubscribeGateway(*GatewayInfo, Synerex_SubscribeGatewayServer) error
	ForwardToGateway(context.Context, *GatewayMsg) (*Response, error)
	CloseDemandChannel(context.Context, *Channel) (*Response, error)
	CloseSupplyChannel(context.Context, *Channel) (*Response, error)
	CloseAllChannels(context.Context, *ProviderID) (*Response, error)
}

SynerexServer is the server API for Synerex service.

type Synerex_SubscribeDemandClient

type Synerex_SubscribeDemandClient interface {
	Recv() (*Demand, error)
	grpc.ClientStream
}

type Synerex_SubscribeDemandServer

type Synerex_SubscribeDemandServer interface {
	Send(*Demand) error
	grpc.ServerStream
}

type Synerex_SubscribeGatewayClient added in v0.1.1

type Synerex_SubscribeGatewayClient interface {
	Recv() (*GatewayMsg, error)
	grpc.ClientStream
}

type Synerex_SubscribeGatewayServer added in v0.1.1

type Synerex_SubscribeGatewayServer interface {
	Send(*GatewayMsg) error
	grpc.ServerStream
}

type Synerex_SubscribeMbusClient

type Synerex_SubscribeMbusClient interface {
	Recv() (*MbusMsg, error)
	grpc.ClientStream
}

type Synerex_SubscribeMbusServer

type Synerex_SubscribeMbusServer interface {
	Send(*MbusMsg) error
	grpc.ServerStream
}

type Synerex_SubscribeSupplyClient

type Synerex_SubscribeSupplyClient interface {
	Recv() (*Supply, error)
	grpc.ClientStream
}

type Synerex_SubscribeSupplyServer

type Synerex_SubscribeSupplyServer interface {
	Send(*Supply) error
	grpc.ServerStream
}

type Target

type Target struct {
	Id          uint64               `protobuf:"fixed64,1,opt,name=id,proto3" json:"id,omitempty"`
	SenderId    uint64               `protobuf:"fixed64,2,opt,name=sender_id,json=senderId,proto3" json:"sender_id,omitempty"`
	TargetId    uint64               `protobuf:"fixed64,3,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"`         // for target
	ChannelType uint32               `protobuf:"varint,4,opt,name=channel_type,json=channelType,proto3" json:"channel_type,omitempty"` // channel type
	Wait        *durationpb.Duration `protobuf:"bytes,5,opt,name=wait,proto3" json:"wait,omitempty"`
	MbusId      uint64               `protobuf:"fixed64,6,opt,name=mbus_id,json=mbusId,proto3" json:"mbus_id,omitempty"` // if you need message bus, set Mbus with mbus_id = 1
	// contains filtered or unexported fields
}

func (*Target) Descriptor deprecated

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

Deprecated: Use Target.ProtoReflect.Descriptor instead.

func (*Target) GetChannelType

func (x *Target) GetChannelType() uint32

func (*Target) GetId

func (x *Target) GetId() uint64

func (*Target) GetMbusId

func (x *Target) GetMbusId() uint64

func (*Target) GetSenderId

func (x *Target) GetSenderId() uint64

func (*Target) GetTargetId

func (x *Target) GetTargetId() uint64

func (*Target) GetWait

func (x *Target) GetWait() *durationpb.Duration

func (*Target) ProtoMessage

func (*Target) ProtoMessage()

func (*Target) ProtoReflect added in v0.4.0

func (x *Target) ProtoReflect() protoreflect.Message

func (*Target) Reset

func (x *Target) Reset()

func (*Target) String

func (x *Target) String() string

type UnimplementedSynerexServer added in v0.4.0

type UnimplementedSynerexServer struct {
}

UnimplementedSynerexServer can be embedded to have forward compatible implementations.

func (*UnimplementedSynerexServer) CloseAllChannels added in v0.4.0

func (*UnimplementedSynerexServer) CloseDemandChannel added in v0.4.0

func (*UnimplementedSynerexServer) CloseDemandChannel(context.Context, *Channel) (*Response, error)

func (*UnimplementedSynerexServer) CloseMbus added in v0.4.0

func (*UnimplementedSynerexServer) CloseSupplyChannel added in v0.4.0

func (*UnimplementedSynerexServer) CloseSupplyChannel(context.Context, *Channel) (*Response, error)

func (*UnimplementedSynerexServer) Confirm added in v0.4.0

func (*UnimplementedSynerexServer) CreateMbus added in v0.4.0

func (*UnimplementedSynerexServer) ForwardToGateway added in v0.4.0

func (*UnimplementedSynerexServer) GetMbusState added in v0.4.0

func (*UnimplementedSynerexServer) NotifyDemand added in v0.4.0

func (*UnimplementedSynerexServer) NotifySupply added in v0.4.0

func (*UnimplementedSynerexServer) ProposeDemand added in v0.4.0

func (*UnimplementedSynerexServer) ProposeSupply added in v0.4.0

func (*UnimplementedSynerexServer) SelectDemand added in v0.4.0

func (*UnimplementedSynerexServer) SelectModifiedSupply added in v0.5.0

func (*UnimplementedSynerexServer) SelectSupply added in v0.4.0

func (*UnimplementedSynerexServer) SendMbusMsg added in v0.4.1

func (*UnimplementedSynerexServer) SubscribeDemand added in v0.4.0

func (*UnimplementedSynerexServer) SubscribeGateway added in v0.4.0

func (*UnimplementedSynerexServer) SubscribeMbus added in v0.4.0

func (*UnimplementedSynerexServer) SubscribeSupply added in v0.4.0

Jump to

Keyboard shortcuts

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