util

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTooManyEmptyStreamMessages = errors.New("stream has sent too many empty messages")
)

Functions

func HttpGet

func HttpGet(ctx context.Context, url string, header map[string]string, data g.Map, result interface{}, proxyURL string) error

func HttpPost added in v0.1.2

func HttpPost(ctx context.Context, url string, header map[string]string, data, result interface{}, proxyURL string) error

Types

type RequestErrorHandler added in v0.2.0

type RequestErrorHandler func(ctx context.Context, response *gclient.Response) (err error)

type StreamReader added in v0.1.4

type StreamReader struct {
	// contains filtered or unexported fields
}

func SSEClient added in v0.1.4

func SSEClient(ctx context.Context, url string, header map[string]string, data interface{}, proxyURL string, requestErrorHandler RequestErrorHandler) (stream *StreamReader, err error)

func (*StreamReader) Close added in v0.1.4

func (stream *StreamReader) Close() error

func (*StreamReader) Recv added in v0.1.4

func (stream *StreamReader) Recv() (response []byte, err error)

type WebSocketConn added in v0.1.4

type WebSocketConn struct {
	// contains filtered or unexported fields
}

func WebSocketClient added in v0.1.2

func WebSocketClient(ctx context.Context, wsURL string, messageType int, message []byte, proxyURL string) (*WebSocketConn, error)

func (*WebSocketConn) Close added in v0.1.4

func (c *WebSocketConn) Close() (err error)

func (*WebSocketConn) ReadMessage added in v0.1.4

func (c *WebSocketConn) ReadMessage(ctx context.Context) ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL