Documentation
¶
Index ¶
- type Client
- func (c *Client) CompleteWebSocket(ctx context.Context, handle *WebSocketHandle, req *restfile.Request, ...) (*Response, error)
- func (c *Client) Execute(ctx context.Context, req *restfile.Request, resolver *vars.Resolver, ...) (resp *Response, err error)
- func (c *Client) ExecuteSSE(ctx context.Context, req *restfile.Request, resolver *vars.Resolver, ...) (*Response, error)
- func (c *Client) ExecuteWebSocket(ctx context.Context, req *restfile.Request, resolver *vars.Resolver, ...) (*Response, error)
- func (c *Client) SetHTTPFactory(factory func(Options) (*http.Client, error))
- func (c *Client) StartSSE(ctx context.Context, req *restfile.Request, resolver *vars.Resolver, ...) (*StreamHandle, *Response, error)
- func (c *Client) StartWebSocket(ctx context.Context, req *restfile.Request, resolver *vars.Resolver, ...) (*WebSocketHandle, *Response, error)
- type FileSystem
- type OSFileSystem
- type Options
- type Response
- type SSEEvent
- type SSESummary
- type SSETranscript
- type StreamHandle
- type StreamMeta
- type WebSocketEvent
- type WebSocketHandle
- type WebSocketSender
- func (s *WebSocketSender) Close(ctx context.Context, code websocket.StatusCode, reason string, ...) error
- func (s *WebSocketSender) Ping(ctx context.Context, meta map[string]string) error
- func (s *WebSocketSender) Pong(ctx context.Context, payload string, meta map[string]string) error
- func (s *WebSocketSender) SendBase64(ctx context.Context, data string, meta map[string]string) error
- func (s *WebSocketSender) SendBinary(ctx context.Context, data []byte, meta map[string]string) error
- func (s *WebSocketSender) SendJSON(ctx context.Context, jsonPayload string, meta map[string]string) error
- func (s *WebSocketSender) SendText(ctx context.Context, text string, meta map[string]string) error
- type WebSocketSummary
- type WebSocketTranscript
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(fs FileSystem) *Client
func (*Client) CompleteWebSocket ¶ added in v0.5.0
func (*Client) ExecuteSSE ¶ added in v0.5.0
func (*Client) ExecuteWebSocket ¶ added in v0.5.0
func (*Client) SetHTTPFactory ¶ added in v0.5.0
SetHTTPFactory allows callers to override how http.Client instances are created. Passing nil restores the default factory.
type FileSystem ¶
type OSFileSystem ¶
type OSFileSystem struct{}
type Response ¶
type Response struct {
Status string
StatusCode int
Proto string
Headers http.Header
Body []byte
Duration time.Duration
EffectiveURL string
Request *restfile.Request
}
func CompleteSSE ¶ added in v0.5.0
func CompleteSSE(handle *StreamHandle) (*Response, error)
type SSESummary ¶ added in v0.5.0
type SSETranscript ¶ added in v0.5.0
type SSETranscript struct {
Events []SSEEvent `json:"events"`
Summary SSESummary `json:"summary"`
}
func DecodeSSETranscript ¶ added in v0.5.0
func DecodeSSETranscript(data []byte) (*SSETranscript, error)
type StreamHandle ¶ added in v0.5.0
type StreamHandle struct {
Session *stream.Session
Meta StreamMeta
}
type StreamMeta ¶ added in v0.5.0
type WebSocketEvent ¶ added in v0.5.0
type WebSocketEvent struct {
Step string `json:"step,omitempty"`
Direction string `json:"direction"`
Type string `json:"type"`
Size int `json:"size"`
Text string `json:"text,omitempty"`
Base64 string `json:"base64,omitempty"`
Timestamp time.Time `json:"timestamp"`
Code int `json:"code,omitempty"`
Reason string `json:"reason,omitempty"`
}
type WebSocketHandle ¶ added in v0.5.0
type WebSocketHandle struct {
Session *stream.Session
Meta StreamMeta
Sender *WebSocketSender
}
type WebSocketSender ¶ added in v0.5.0
type WebSocketSender struct {
// contains filtered or unexported fields
}
func (*WebSocketSender) Close ¶ added in v0.5.0
func (s *WebSocketSender) Close(ctx context.Context, code websocket.StatusCode, reason string, meta map[string]string) error
func (*WebSocketSender) SendBase64 ¶ added in v0.5.0
func (*WebSocketSender) SendBinary ¶ added in v0.5.0
type WebSocketSummary ¶ added in v0.5.0
type WebSocketTranscript ¶ added in v0.5.0
type WebSocketTranscript struct {
Events []WebSocketEvent `json:"events"`
Summary WebSocketSummary `json:"summary"`
}
func DecodeWebSocketTranscript ¶ added in v0.5.0
func DecodeWebSocketTranscript(data []byte) (*WebSocketTranscript, error)
Click to show internal directories.
Click to hide internal directories.