mirror of
https://github.com/foomo/gotsrpc.git
synced 2025-10-16 12:35:35 +00:00
41 lines
676 B
Go
41 lines
676 B
Go
package demo
|
|
|
|
type Err struct {
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
func (e *Err) Error() string {
|
|
return e.Message
|
|
}
|
|
|
|
type ScalarError string
|
|
|
|
func (se *ScalarError) Error() string {
|
|
return string(*se)
|
|
}
|
|
|
|
type ScalarInPlace string
|
|
|
|
type Demo struct {
|
|
Bla bool
|
|
}
|
|
|
|
func (d *Demo) Hello(name string) (string, *Err) {
|
|
if name == "Peter" {
|
|
return "", &Err{"fuck you Peter I do not like you"}
|
|
}
|
|
return "Hello from the server: " + name, nil
|
|
}
|
|
|
|
func (d *Demo) HelloInterface(anything interface{}, anythingMap map[string]interface{}, anythingSlice []interface{}) {
|
|
|
|
}
|
|
|
|
func (d *Demo) HelloScalarError() (err *ScalarError) {
|
|
return
|
|
}
|
|
|
|
func (d *Demo) nothingInNothinOut() {
|
|
|
|
}
|