Documentation
¶
Index ¶
- func CallDeferFunctions()
- func GenerateIntID() uint64
- func GetNodeName(n int) string
- func HandleSigInt()
- func InitNodeNum(n int)
- 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 SMServiceClient
- func (clt *SMServiceClient) CloseMbus(ctx context.Context) error
- func (clt *SMServiceClient) Confirm(id IDType) error
- func (clt *SMServiceClient) IsDemandTarget(dm *api.Demand, idlist []uint64) bool
- func (clt *SMServiceClient) IsSupplyTarget(sp *api.Supply, idlist []uint64) bool
- func (clt *SMServiceClient) NotifyDemand(dmo *DemandOpts) uint64
- func (clt *SMServiceClient) NotifySupply(smo *SupplyOpts) uint64
- func (clt *SMServiceClient) ProposeSupply(spo *SupplyOpts) uint64
- func (clt *SMServiceClient) SelectDemand(dm *api.Demand) error
- func (clt *SMServiceClient) SelectSupply(sp *api.Supply) (uint64, error)
- func (clt *SMServiceClient) SendMsg(ctx context.Context, msg *api.MbusMsg) error
- func (clt *SMServiceClient) SubscribeDemand(ctx context.Context, dmcb func(*SMServiceClient, *api.Demand)) error
- func (clt *SMServiceClient) SubscribeMbus(ctx context.Context, mbcb func(*SMServiceClient, *api.MbusMsg)) error
- func (clt *SMServiceClient) SubscribeSupply(ctx context.Context, spcb func(*SMServiceClient, *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 HandleSigInt ¶ added in v0.0.2
func HandleSigInt()
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 SMServiceClient ¶
type SMServiceClient struct { ClientID IDType ChannelType uint32 Client api.SynerexClient ArgJson string MbusID IDType }
SMServiceClient Wrappter Structure for market client
func NewSMServiceClient ¶
func NewSMServiceClient(clt api.SynerexClient, mtype uint32, argJson string) *SMServiceClient
NewSMServiceClient Creates wrapper structre SMServiceClient from SynerexClient
func (*SMServiceClient) CloseMbus ¶
func (clt *SMServiceClient) CloseMbus(ctx context.Context) error
func (*SMServiceClient) Confirm ¶
func (clt *SMServiceClient) Confirm(id IDType) error
Confirm sends confirm message to sender
func (*SMServiceClient) IsDemandTarget ¶
func (clt *SMServiceClient) IsDemandTarget(dm *api.Demand, idlist []uint64) bool
IsDemandTarget is a helper function to check target
func (*SMServiceClient) IsSupplyTarget ¶
func (clt *SMServiceClient) IsSupplyTarget(sp *api.Supply, idlist []uint64) bool
IsSupplyTarget is a helper function to check target
func (*SMServiceClient) NotifyDemand ¶
func (clt *SMServiceClient) NotifyDemand(dmo *DemandOpts) uint64
NotifyDemand sends Typed Demand to Server
func (*SMServiceClient) NotifySupply ¶
func (clt *SMServiceClient) NotifySupply(smo *SupplyOpts) uint64
NotifySupply sends Typed Supply to Server
func (*SMServiceClient) ProposeSupply ¶
func (clt *SMServiceClient) ProposeSupply(spo *SupplyOpts) uint64
ProposeSupply send proposal Supply message to server
func (*SMServiceClient) SelectDemand ¶
func (clt *SMServiceClient) SelectDemand(dm *api.Demand) error
SelectDemand send select message to server
func (*SMServiceClient) SelectSupply ¶
func (clt *SMServiceClient) SelectSupply(sp *api.Supply) (uint64, error)
SelectSupply send select message to server
func (*SMServiceClient) SubscribeDemand ¶
func (clt *SMServiceClient) SubscribeDemand(ctx context.Context, dmcb func(*SMServiceClient, *api.Demand)) error
SubscribeDemand Wrapper function for SMServiceClient
func (*SMServiceClient) SubscribeMbus ¶
func (clt *SMServiceClient) SubscribeMbus(ctx context.Context, mbcb func(*SMServiceClient, *api.MbusMsg)) error
SubscribeMbus Wrapper function for SMServiceClient
func (*SMServiceClient) SubscribeSupply ¶
func (clt *SMServiceClient) SubscribeSupply(ctx context.Context, spcb func(*SMServiceClient, *api.Supply)) error
SubscribeSupply Wrapper function for SMServiceClient
type SupplyOpts ¶
SupplyOpts is sender options for Supply