Documentation
¶
Index ¶
- Constants
- func DecodeMessage[T any](msg []byte) (*T, []byte, error)
- func JRPCRes(bytes []byte) []byte
- func SplitFunc(data []byte, atEOF bool) (advance int, token []byte, err error)
- type CancelationReq
- type CancelationReqParams
- type CustomJRPCRequest
- type ErrorData
- type GetPipelinesReq
- type GetReportsParams
- type GetReportsReq
- type JRPCError
- type JRPCRequest
- type JRPCResponse
- type JRPCSuccess
- type ListPipelinesParams
- type SimpleMessage
- type StartPipelineParams
- type StartPipelineReq
- type TerminationReq
Constants ¶
View Source
const ( PARSE_ERROR = -32700 INVALID_REQUEST = -32600 METHOD_NOT_FOUND = -32601 INVALID_PARAMS = -32602 INTERNAL_ERROR = -32603 )
Variables ¶
This section is empty.
Functions ¶
func DecodeMessage ¶
DecodeMessage gets the content of the message as deserializable JSON, and the method type from a standard PMSP client message.
Types ¶
type CancelationReq ¶
type CancelationReq struct {
JRPCRequest
Params CancelationReqParams `json:"params"`
}
type CancelationReqParams ¶
type CustomJRPCRequest ¶
type CustomJRPCRequest struct {
JRPCRequest
Params map[string]any
}
type ErrorData ¶
type ErrorData struct {
Code int16 `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
ErrorData is the Response interface for whenever it encounters an error
type GetPipelinesReq ¶
type GetPipelinesReq struct {
JRPCRequest
Params ListPipelinesParams `json:"params"`
}
type GetReportsParams ¶
type GetReportsParams struct {
PipelineId *string `json:"pipeline-id"` // To specify if you want the reports of a single run of a pipeline
PipelineName *string `json:"pipeline-name"` // To specify if you want all the reports of a named pipeline
Type string `json:"type"` // Specify the report type
Fields []string `json:"fields"` // To specify if you only want some fields of the pipeline.
OmittedFields []string `json:"omitted-fields"` // To specify if you want every info except one
}
type GetReportsReq ¶
type GetReportsReq struct {
JRPCRequest
Params GetReportsParams
}
type JRPCError ¶
type JRPCError struct {
JRPCResponse
Error ErrorData `json:"error"`
}
Error type for JRPC Response
type JRPCRequest ¶
type JRPCRequest struct {
JsonRpcVersion string `json:"jsonprc"`
Id int `json:"id"`
Method string `json:"method"`
}
Received structure to decode in JSON
type JRPCResponse ¶
Response sent by the server to the client after receiving a JRPCRequest
type JRPCSuccess ¶
type JRPCSuccess[T any] struct { JRPCResponse Value T `json:"value"` }
func NewResult ¶
func NewResult[T any](reqId int, value T) JRPCSuccess[T]
NewResult helps build a standardized JRPC success response
type ListPipelinesParams ¶
type ListPipelinesParams struct {
Id *string `json:"id,omitempty"` // Id if the pipeline to list. If not present, return every pipeline
Active bool `json:"active"` // To know if the pipeline to search is a running process
All bool `json:"all"` // tells if we need to see every pipeline
}
ListPipelinesParams list request options to get a json representation of a / multiple pipelines
type SimpleMessage ¶
type SimpleMessage struct {
Message string `json:"message"`
}
type StartPipelineParams ¶
type StartPipelineParams struct {
Name string
}
type StartPipelineReq ¶
type StartPipelineReq struct {
JRPCRequest
Params StartPipelineParams `json:"params"`
}
type TerminationReq ¶
type TerminationReq struct {
}
Click to show internal directories.
Click to hide internal directories.