Documentation
¶
Index ¶
- func CallDeferFunctions()
- func GenerateIntID() uint64
- func GetNodeName(n int) string
- func GrpcConnectServer(serverAddress string) api.SynerexClient
- func HandleSigInt()
- func InitNodeNum(n int)
- func MsgCountUp()
- func RegisterDeferFunction(f func())
- func RegisterNode(nodesrv string, nm string, channels []uint32, serv *SxServerOpt) (string, error)
- func SetNodeStatus(status int32, arg string)
- func UnRegisterNode()
- type DemandOpts
- type IDType
- type SXServiceClient
- func (clt *SXServiceClient) CloseMbus(ctx context.Context) error
- func (clt *SXServiceClient) Confirm(id IDType) error
- func (clt *SXServiceClient) IsDemandTarget(dm *api.Demand, idlist []uint64) bool
- func (clt *SXServiceClient) IsSupplyTarget(sp *api.Supply, idlist []uint64) bool
- func (clt *SXServiceClient) NotifyDemand(dmo *DemandOpts) (uint64, error)
- func (clt *SXServiceClient) NotifySupply(smo *SupplyOpts) (uint64, error)
- func (clt *SXServiceClient) ProposeSupply(spo *SupplyOpts) uint64
- func (clt *SXServiceClient) SelectDemand(dm *api.Demand) error
- func (clt *SXServiceClient) SelectSupply(sp *api.Supply) (uint64, error)
- func (clt *SXServiceClient) SendMsg(ctx context.Context, msg *api.MbusMsg) error
- func (clt *SXServiceClient) SubscribeDemand(ctx context.Context, dmcb func(*SXServiceClient, *api.Demand)) error
- func (clt *SXServiceClient) SubscribeMbus(ctx context.Context, mbcb func(*SXServiceClient, *api.MbusMsg)) error
- func (clt *SXServiceClient) SubscribeSupply(ctx context.Context, spcb func(*SXServiceClient, *api.Supply)) error
- type SupplyOpts
- type SxServerOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallDeferFunctions ¶ added in v0.0.2
func CallDeferFunctions()
func GetNodeName ¶
func GrpcConnectServer ¶ added in v0.3.4
func GrpcConnectServer(serverAddress string) api.SynerexClient
Utility Function for Conneting gRPC server
func HandleSigInt ¶ added in v0.0.2
func HandleSigInt()
func MsgCountUp ¶ added in v0.3.9
func MsgCountUp()
func RegisterDeferFunction ¶ added in v0.0.2
func RegisterDeferFunction(f func())
register closing functions.
func RegisterNode ¶ added in v0.2.1
RegisterNode is a function to register Node with node server address
func SetNodeStatus ¶
Types ¶
type DemandOpts ¶
DemandOpts is sender options for Demand
type SXServiceClient ¶ added in v0.3.3
type SXServiceClient struct { ClientID IDType ChannelType uint32 Client api.SynerexClient ArgJson string MbusID IDType }
SXServiceClient Wrappter Structure for market client
func NewSXServiceClient ¶ added in v0.3.3
func NewSXServiceClient(clt api.SynerexClient, mtype uint32, argJson string) *SXServiceClient
NewSXServiceClient Creates wrapper structre SXServiceClient from SynerexClient
func (*SXServiceClient) CloseMbus ¶ added in v0.3.3
func (clt *SXServiceClient) CloseMbus(ctx context.Context) error
func (*SXServiceClient) Confirm ¶ added in v0.3.3
func (clt *SXServiceClient) Confirm(id IDType) error
Confirm sends confirm message to sender
func (*SXServiceClient) IsDemandTarget ¶ added in v0.3.3
func (clt *SXServiceClient) IsDemandTarget(dm *api.Demand, idlist []uint64) bool
IsDemandTarget is a helper function to check target
func (*SXServiceClient) IsSupplyTarget ¶ added in v0.3.3
func (clt *SXServiceClient) IsSupplyTarget(sp *api.Supply, idlist []uint64) bool
IsSupplyTarget is a helper function to check target
func (*SXServiceClient) NotifyDemand ¶ added in v0.3.3
func (clt *SXServiceClient) NotifyDemand(dmo *DemandOpts) (uint64, error)
NotifyDemand sends Typed Demand to Server
func (*SXServiceClient) NotifySupply ¶ added in v0.3.3
func (clt *SXServiceClient) NotifySupply(smo *SupplyOpts) (uint64, error)
NotifySupply sends Typed Supply to Server
func (*SXServiceClient) ProposeSupply ¶ added in v0.3.3
func (clt *SXServiceClient) ProposeSupply(spo *SupplyOpts) uint64
ProposeSupply send proposal Supply message to server
func (*SXServiceClient) SelectDemand ¶ added in v0.3.3
func (clt *SXServiceClient) SelectDemand(dm *api.Demand) error
SelectDemand send select message to server
func (*SXServiceClient) SelectSupply ¶ added in v0.3.3
func (clt *SXServiceClient) SelectSupply(sp *api.Supply) (uint64, error)
SelectSupply send select message to server
func (*SXServiceClient) SubscribeDemand ¶ added in v0.3.3
func (clt *SXServiceClient) SubscribeDemand(ctx context.Context, dmcb func(*SXServiceClient, *api.Demand)) error
SubscribeDemand Wrapper function for SXServiceClient
func (*SXServiceClient) SubscribeMbus ¶ added in v0.3.3
func (clt *SXServiceClient) SubscribeMbus(ctx context.Context, mbcb func(*SXServiceClient, *api.MbusMsg)) error
SubscribeMbus Wrapper function for SXServiceClient
func (*SXServiceClient) SubscribeSupply ¶ added in v0.3.3
func (clt *SXServiceClient) SubscribeSupply(ctx context.Context, spcb func(*SXServiceClient, *api.Supply)) error
SubscribeSupply Wrapper function for SXServiceClient
type SupplyOpts ¶
SupplyOpts is sender options for Supply