mirror of
https://github.com/foomo/gotsrpc.git
synced 2026-04-28 08:34:31 +00:00
47 lines
738 B
Go
47 lines
738 B
Go
package server
|
|
|
|
type ErrService string
|
|
|
|
const (
|
|
ErrUnauthorized ErrService = "unauthorized"
|
|
)
|
|
|
|
type ScalarError string
|
|
|
|
func (s *ScalarError) String() string {
|
|
return string(*s)
|
|
}
|
|
|
|
func (s *ScalarError) Error() string {
|
|
return s.String()
|
|
}
|
|
|
|
type StructError struct {
|
|
Message string `json:"message"`
|
|
Data string `json:"data"`
|
|
}
|
|
|
|
func (s *StructError) Error() string {
|
|
return s.Message
|
|
}
|
|
|
|
type (
|
|
ScalarA string
|
|
ScalarB string
|
|
MultiScalar struct {
|
|
ScalarA `json:",omitempty,inline"`
|
|
ScalarB `json:",omitempty,inline"`
|
|
}
|
|
)
|
|
|
|
const (
|
|
ScalarOne ScalarError = "one"
|
|
ScalarTwo ScalarError = "two"
|
|
|
|
ScalarAOne ScalarA = "one"
|
|
ScalarATwo ScalarA = "two"
|
|
|
|
ScalarBThree ScalarB = "three"
|
|
ScalarBFour ScalarB = "four"
|
|
)
|