Documentation
¶
Overview ¶
Package anserpc implements JSON2.0 RPC. https://www.jsonrpc.org/specification
Index ¶
- Constants
- Variables
- type API
- type Anser
- func (a *Anser) Close()
- func (a *Anser) Register(group, service, version string, public bool, receiver interface{})
- func (a *Anser) RegisterAPI(apis ...*API)
- func (a *Anser) RegisterService(name, version string, public bool, receiver interface{})
- func (a *Anser) RegisterWithGroup(name string) *groupRegister
- func (a *Anser) Run()
- type CloserAndDeadline
- type Conn
- type Logger
- type Option
- func WithDefaultIPCEndpoint() Option
- func WithDefaultLogOpt() Option
- func WithDefaultRPCEndpoint() Option
- func WithDisableInterruptHandler() Option
- func WithHTTPDeniedMethodOpt(methods ...string) Option
- func WithHTTPVhostOpt(vhosts ...string) Option
- func WithIPCEndpoint(path string) Option
- func WithLogFileOpt(path string, filterLvl logLvl) Option
- func WithLoggerOpt(logger Logger) Option
- func WithRPCEndpoint(host string, port int) Option
- type ResultCodeError
- type ResultDataError
- type ResultError
- type ResultMessageError
- type StatusError
- type WriteCloserAndDeadline
Constants ¶
View Source
const ( LvlCrit logLvl = iota LvlError LvlWarn LvlInfo LvlDebug )
Variables ¶
View Source
var (
Fmt = util.Fmt
)
Functions ¶
This section is empty.
Types ¶
type Anser ¶
type Anser struct {
// contains filtered or unexported fields
}
func (*Anser) RegisterAPI ¶
func (*Anser) RegisterService ¶
func (*Anser) RegisterWithGroup ¶
type CloserAndDeadline ¶
type Conn ¶
type Conn interface { io.Reader WriteCloserAndDeadline }
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithDefaultIPCEndpoint ¶
func WithDefaultIPCEndpoint() Option
func WithDefaultLogOpt ¶
func WithDefaultLogOpt() Option
func WithDefaultRPCEndpoint ¶
func WithDefaultRPCEndpoint() Option
func WithDisableInterruptHandler ¶
func WithDisableInterruptHandler() Option
func WithHTTPDeniedMethodOpt ¶
func WithHTTPVhostOpt ¶
func WithIPCEndpoint ¶
func WithLogFileOpt ¶
func WithLoggerOpt ¶
func WithRPCEndpoint ¶
type ResultCodeError ¶
type ResultDataError ¶
type ResultDataError interface { ResultCodeError ErrorData() interface{} }
type ResultError ¶
type ResultError interface { ResultCodeError ResultMessageError ResultDataError }
type ResultMessageError ¶
type StatusError ¶
type StatusError struct {
// contains filtered or unexported fields
}
func (StatusError) Error ¶
func (s StatusError) Error() string
func (StatusError) ErrorCode ¶
func (s StatusError) ErrorCode() int
func (StatusError) ErrorMessage ¶
func (s StatusError) ErrorMessage() string
type WriteCloserAndDeadline ¶
type WriteCloserAndDeadline interface { io.Writer CloserAndDeadline }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.