Documentation ¶
Index ¶
- func IsNexusErr(err error) bool
- func IsNexusErrCode(err error, code int) bool
- func NewService(server string, prefix string, opts *ServiceOpts) *service.Service
- func ReplyToWrapper(f func(*nexus.Task) (interface{}, *nexus.JsonRpcErr)) func(*nexus.Task) (interface{}, *nexus.JsonRpcErr)
- type Server
- func (s *Server) AddService(name string, prefix string, opts *ServiceOpts) *service.Service
- func (s *Server) Serve() error
- func (s *Server) SetGracefulExitTime(t time.Duration)
- func (s *Server) SetLogLevel(l string)
- func (s *Server) SetPass(password string)
- func (s *Server) SetStatsPeriod(t time.Duration)
- func (s *Server) SetUrl(url string)
- func (s *Server) SetUser(user string)
- type ServiceOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNexusErr ¶
IsNexusErr returns whether the err is a *nexus.JsonRpcErr
func IsNexusErrCode ¶
IsNexusErrCode returns whether the err is a *nexus.JsonRpcErr and matches the *nexus.JsonRpcErr.Cod
func NewService ¶
func NewService(server string, prefix string, opts *ServiceOpts) *service.Service
NewService creates a new nexus service If passed ServiceOpts is nil the defaults are 1 pull, an hour of pullTimeout and runtime.NumCPU() maxThreads Debug output is disabled by deafult StatsPeriod defaults to 5 minutes GracefulExitTime defaults to 20 seconds
func ReplyToWrapper ¶
func ReplyToWrapper(f func(*nexus.Task) (interface{}, *nexus.JsonRpcErr)) func(*nexus.Task) (interface{}, *nexus.JsonRpcErr)
ReplyToWrapper is a wrapper for methods If a replyTo map parameter is set with a type parameter (with "pipe" or "service" values) and a path parameter with the service path or pipeId to respond to, the usual SendError/SendResult pattern will be skipped and the answer will go to the pipe or service specified after doing an Accept() to the task.
Types ¶
type Server ¶
type Server struct { Server string User string Password string Pulls int PullTimeout time.Duration MaxThreads int StatsPeriod time.Duration GracefulExitTime time.Duration LogLevel string // contains filtered or unexported fields }
func NewServer ¶
func NewServer(server string, opts *ServiceOpts) *Server