Documentation
¶
Index ¶
Constants ¶
View Source
const ( ParseError = -32700 ParseErrorMessage = "Parse error" InvalidRequest = -32600 InvalidRequestMessage = "Invalid request" MethodNotFound = -32601 MethodNotFoundMessage = "Method not found" InvalidParams = -32602 InvalidParamsMessage = "Invalid params" InternalError = -32603 InternalErrorMessage = "Internal error" // Implementation-defined errors CallerError = -32000 ServerErrorMessage = "Server error" )
View Source
const ScopeName = "github.com/kofuk/premises/runner/internal/rpc"
Variables ¶
Functions ¶
func InitializeDefaultServer ¶
func InitializeDefaultServer(path string)
Types ¶
type AbstractRequest ¶
type AbstractRequest Request[json.RawMessage]
func (*AbstractRequest) Bind ¶
func (req *AbstractRequest) Bind(v any) error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type HandlerFunc ¶
type HandlerFunc func(ctx context.Context, req *AbstractRequest) (any, error)
type NotifyHandlerFunc ¶
type NotifyHandlerFunc func(ctx context.Context, req *AbstractRequest) error
type Packet ¶ added in v0.3.0
type Packet struct { ContentLength int Traceparent string Body json.RawMessage }
type RPCError ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
var DefaultServer *Server
func (*Server) RegisterMethod ¶
func (s *Server) RegisterMethod(name string, fn HandlerFunc)
func (*Server) RegisterNotifyMethod ¶
func (s *Server) RegisterNotifyMethod(name string, fn NotifyHandlerFunc)
Click to show internal directories.
Click to hide internal directories.