github.com/15mga/kiwi@v0.0.2-0.20240324021231-b95d5c3ac751/snd_pkt.go (about)

     1  package kiwi
     2  
     3  import "github.com/15mga/kiwi/util"
     4  
     5  type ISndPacket interface {
     6  	InitHead()
     7  	Pid() int64
     8  	Tid() int64
     9  	Json() bool
    10  	Svc() TSvc
    11  	Code() TCode
    12  	Head() util.M
    13  	GetSvcNodeId() (int64, bool)
    14  	Payload() []byte
    15  	Msg() util.IMsg
    16  	Dispose()
    17  }
    18  
    19  type ISndRequest interface {
    20  	ISndPacket
    21  	SetBytesHandler(fail util.FnInt64MUint16, ok util.FnInt64MBytes)
    22  	SetHandler(fail util.FnInt64MUint16, ok util.FnInt64MMsg)
    23  	OkBytes(head util.M, bytes []byte)
    24  	Ok(head util.M, msg util.IMsg)
    25  	Fail(head util.M, code uint16)
    26  }
    27  
    28  type ISndPush interface {
    29  	ISndPacket
    30  }
    31  
    32  type ISndNotice interface {
    33  	ISndPacket
    34  }