github.com/nyan233/littlerpc@v0.4.6-0.20230316182519-0c8d5c48abaf/core/middle/plugin/abstract.go (about) 1 package plugin 2 3 import ( 4 perror "github.com/nyan233/littlerpc/core/protocol/error" 5 "github.com/nyan233/littlerpc/core/protocol/message" 6 "reflect" 7 ) 8 9 type Abstract struct { 10 AbstractClient 11 AbstractServer 12 } 13 14 type AbstractServer struct{} 15 type AbstractClient struct{} 16 17 func (a AbstractServer) Event4S(ev Event) (next bool) { 18 return true 19 } 20 21 func (a AbstractServer) Receive4S(pub *Context, msg *message.Message) perror.LErrorDesc { 22 return nil 23 } 24 25 func (a AbstractServer) Call4S(pub *Context, args []reflect.Value, err perror.LErrorDesc) perror.LErrorDesc { 26 return nil 27 } 28 29 func (a AbstractServer) AfterCall4S(pub *Context, args, results []reflect.Value, err perror.LErrorDesc) perror.LErrorDesc { 30 return nil 31 } 32 33 func (a AbstractServer) Send4S(pub *Context, msg *message.Message, err perror.LErrorDesc) perror.LErrorDesc { 34 return nil 35 } 36 37 func (a AbstractServer) AfterSend4S(pub *Context, msg *message.Message, err perror.LErrorDesc) perror.LErrorDesc { 38 return nil 39 } 40 41 func (a AbstractClient) Request4C(pub *Context, args []interface{}, msg *message.Message) perror.LErrorDesc { 42 return nil 43 } 44 45 func (a AbstractClient) Send4C(pub *Context, msg *message.Message, err perror.LErrorDesc) perror.LErrorDesc { 46 return nil 47 } 48 49 func (a AbstractClient) AfterSend4C(pub *Context, msg *message.Message, err perror.LErrorDesc) perror.LErrorDesc { 50 return nil 51 } 52 53 func (a AbstractClient) Receive4C(pub *Context, msg *message.Message, err perror.LErrorDesc) perror.LErrorDesc { 54 return nil 55 } 56 57 func (a AbstractClient) AfterReceive4C(pub *Context, results []interface{}, err perror.LErrorDesc) perror.LErrorDesc { 58 return nil 59 }